guix-commits
[Top][All Lists]
Advanced

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

01/01: import cran: Distinguish Bioconductor data packages.


From: Ricardo Wurmus
Subject: 01/01: import cran: Distinguish Bioconductor data packages.
Date: Wed, 5 Apr 2017 12:39:11 -0400 (EDT)

rekado pushed a commit to branch master
in repository guix.

commit 5ae63362ae919caaf722bd4b0199e1c14c994aa5
Author: Ricardo Wurmus <address@hidden>
Date:   Wed Oct 26 09:47:40 2016 +0200

    import cran: Distinguish Bioconductor data packages.
    
    * guix/import/cran.scm (bioconductor-package?): Exclude Bioconductor
    data packages.
    (bioconductor-data-package?): New procedure.
---
 guix/import/cran.scm | 31 ++++++++++++++++++++++++-------
 1 file changed, 24 insertions(+), 7 deletions(-)

diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index a5f91fe..4d36882 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -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



reply via email to

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