import cran: Distinguish Bioconductor data packages.

* guix/import/cran.scm (bioconductor-package?): Exclude Bioconductor
data packages.
(bioconductor-data-package?): New procedure.
This commit is contained in:
Ricardo Wurmus 2016-10-26 09:47:40 +02:00
parent 1108a920bd
commit 5ae63362ae
No known key found for this signature in database
GPG Key ID: 197A5888235FACAC
1 changed files with 24 additions and 7 deletions

View File

@ -424,13 +424,30 @@ dependencies."
(define (bioconductor-package? package)
"Return true if PACKAGE is an R package from Bioconductor."
(and (string-prefix? "r-" (package-name package))
(match (and=> (package-source package) origin-uri)
((? string? uri)
(string-prefix? "http://bioconductor.org" uri))
((? list? uris)
(any (cut string-prefix? "http://bioconductor.org" <>) uris))
(_ #f))))
(let ((predicate (lambda (uri)
(and (string-prefix? "http://bioconductor.org" uri)
;; Data packages are not listed in SVN
(not (string-contains uri "/data/annotation/"))))))
(and (string-prefix? "r-" (package-name package))
(match (and=> (package-source package) origin-uri)
((? string? uri)
(predicate uri))
((? list? uris)
(any predicate uris))
(_ #f)))))
(define (bioconductor-data-package? package)
"Return true if PACKAGE is an R data package from Bioconductor."
(let ((predicate (lambda (uri)
(and (string-prefix? "http://bioconductor.org" uri)
(string-contains uri "/data/annotation/")))))
(and (string-prefix? "r-" (package-name package))
(match (and=> (package-source package) origin-uri)
((? string? uri)
(predicate uri))
((? list? uris)
(any predicate uris))
(_ #f)))))
(define %cran-updater
(upstream-updater