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.
This commit is contained in:
Ricardo Wurmus 2019-09-02 14:46:04 +02:00
parent c7358ac4fc
commit 8786fec485
No known key found for this signature in database
GPG Key ID: 197A5888235FACAC
1 changed files with 11 additions and 10 deletions

View File

@ -230,6 +230,7 @@ from ~s: ~a (~s)~%"
(if (boolean? type) meta
(cons `(bioconductor-type . ,type) meta))))))))))
((git)
(and (string-prefix? "http" name)
;; Download the git repository at "NAME"
(call-with-values
(lambda () (download name #t))
@ -239,7 +240,7 @@ from ~s: ~a (~s)~%"
(lambda (meta)
(cons* `(git . ,name)
`(git-commit . ,commit)
meta))))))))
meta)))))))))
(define (listify meta field)
"Look up FIELD in the alist META. If FIELD contains a comma-separated