summary refs log tree commit diff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2019-09-02 14:46:04 +0200
committerRicardo Wurmus <rekado@elephly.net>2019-09-02 14:46:04 +0200
commit8786fec4859f36aeb2e6b5d136b4507088d2b5a1 (patch)
treece07aac47f1114b1fcf1b03a5b06cbe670c7662d
parentc7358ac4fc6369cdf87f95ec8600a21e809a22eb (diff)
downloadguix-8786fec4859f36aeb2e6b5d136b4507088d2b5a1.tar.gz
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.
-rw-r--r--guix/import/cran.scm21
1 files changed, 11 insertions, 10 deletions
diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index b5321b44ef..35caa3e463 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