guix-commits
[Top][All Lists]
Advanced

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

02/02: import: cran: Only use the git import with what looks like a URL.


From: guix-commits
Subject: 02/02: import: cran: Only use the git import with what looks like a URL.
Date: Mon, 2 Sep 2019 08:46:59 -0400 (EDT)

rekado pushed a commit to branch master
in repository guix.

commit 8786fec4859f36aeb2e6b5d136b4507088d2b5a1
Author: Ricardo Wurmus <address@hidden>
Date:   Mon Sep 2 14:46:04 2019 +0200

    import: cran: Only use the git import with what looks like a URL.
    
    * guix/import/cran.scm (fetch-description): Abort if the argument does not
    look like a URL.
---
 guix/import/cran.scm | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index b5321b4..35caa3e 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -230,16 +230,17 @@ from ~s: ~a (~s)~%"
                           (if (boolean? type) meta
                               (cons `(bioconductor-type . ,type) meta))))))))))
     ((git)
-     ;; Download the git repository at "NAME"
-     (call-with-values
-         (lambda () (download name #t))
-       (lambda (dir commit)
-         (and=> (description->alist (with-input-from-file
-                                        (string-append dir "/DESCRIPTION") 
read-string))
-                (lambda (meta)
-                  (cons* `(git . ,name)
-                         `(git-commit . ,commit)
-                         meta))))))))
+     (and (string-prefix? "http" name)
+          ;; Download the git repository at "NAME"
+          (call-with-values
+              (lambda () (download name #t))
+            (lambda (dir commit)
+              (and=> (description->alist (with-input-from-file
+                                             (string-append dir 
"/DESCRIPTION") read-string))
+                     (lambda (meta)
+                       (cons* `(git . ,name)
+                              `(git-commit . ,commit)
+                              meta)))))))))
 
 (define (listify meta field)
   "Look up FIELD in the alist META.  If FIELD contains a comma-separated



reply via email to

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