[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/02: import: github: Use 'json-fetch'.

From: Ludovic Courtès
Subject: 02/02: import: github: Use 'json-fetch'.
Date: Tue, 20 Dec 2016 18:15:51 +0000 (UTC)

civodul pushed a commit to branch master
in repository guix.

commit 62bd24db39a86f80242f923eb4cc2f18f3b02c67
Author: Ludovic Courtès <address@hidden>
Date:   Tue Dec 20 19:08:22 2016 +0100

    import: github: Use 'json-fetch'.
    * guix/import/github.scm (json-fetch*): Remove.
    (latest-released-version): Adjust accordingly.
 guix/import/github.scm |   15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/guix/import/github.scm b/guix/import/github.scm
index 0843dde..01452b1 100644
--- a/guix/import/github.scm
+++ b/guix/import/github.scm
@@ -23,23 +23,12 @@
   #:use-module (guix utils)
   #:use-module ((guix download) #:prefix download:)
   #:use-module (guix import utils)
+  #:use-module (guix import json)
   #:use-module (guix packages)
   #:use-module (guix upstream)
   #:use-module (web uri)
   #:export (%github-updater))
-(define (json-fetch* url)
-  "Return a list/hash representation of the JSON resource URL, or #f on
-  (call-with-output-file "/dev/null"
-    (lambda (null)
-      (with-error-to-port null
-        (lambda ()
-          (call-with-temporary-output-file
-           (lambda (temp port)
-             (and (url-fetch url temp)
-                  (call-with-input-file temp json->scm)))))))))
 (define (find-extension url)
   "Return the extension of the archive e.g. '.tar.gz' given a URL, or
 false if none is recognized"
@@ -136,7 +125,7 @@ the package e.g. 'bedtools2'.  Return #f if there is no 
                    (github-user-slash-repository url)
-         (json (json-fetch*
+         (json (json-fetch
                 (if token
                     (string-append api-url "?access_token=" token)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]