From 8786fec4859f36aeb2e6b5d136b4507088d2b5a1 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Mon, 2 Sep 2019 14:46:04 +0200 Subject: 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 b5321b44ef..35caa3e463 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -230,16 +230,17 @@ (define (fetch-description repository name) (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 -- cgit v1.2.3