guix-commits
[Top][All Lists]
Advanced

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

03/06: import cran: Add predicate for Bioconductor experiment packages.


From: Ricardo Wurmus
Subject: 03/06: import cran: Add predicate for Bioconductor experiment packages.
Date: Tue, 16 May 2017 15:46:28 -0400 (EDT)

rekado pushed a commit to branch master
in repository guix.

commit daaa270eccb2b43dfb9eee48ac264c37174adc8c
Author: Ricardo Wurmus <address@hidden>
Date:   Wed Apr 5 18:42:06 2017 +0200

    import cran: Add predicate for Bioconductor experiment packages.
    
    * guix/import/cran.scm (bioconductor-experiment-package?): New variable.
---
 guix/import/cran.scm | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index 1adffc4..2de1cd9 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -457,6 +457,19 @@ dependencies."
             (any predicate uris))
            (_ #f)))))
 
+(define (bioconductor-experiment-package? package)
+  "Return true if PACKAGE is an R experiment package from Bioconductor."
+  (let ((predicate (lambda (uri)
+                     (and (string-prefix? "http://bioconductor.org"; uri)
+                          (string-contains uri "/data/experiment/")))))
+    (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
    (name 'cran)



reply via email to

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