[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
42/155: import cran: Add "recursive" option.
From: |
John Darrington |
Subject: |
42/155: import cran: Add "recursive" option. |
Date: |
Wed, 21 Dec 2016 20:48:32 +0000 (UTC) |
jmd pushed a commit to branch wip-installer
in repository guix.
commit 0e774caf19fdc5a4296fabff49c2261923a0665f
Author: Ricardo Wurmus <address@hidden>
Date: Tue May 17 16:41:13 2016 +0200
import cran: Add "recursive" option.
* guix/scripts/import/cran.scm: (%options): Add "recursive" option.
(guix-import-cran): Handle "recursive" option.
* doc/guix.texi (Invoking guix import): Document it.
---
doc/guix.texi | 4 ++++
guix/scripts/import/cran.scm | 26 ++++++++++++++++++++------
2 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index bd782ca..5d3a175 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -5148,6 +5148,10 @@ R package:
guix import cran Cairo
@end example
+When @code{--recursive} is added, the importer will traverse the
+dependency graph of the given upstream package recursively and generate
+package expressions for all those packages that are not yet in Guix.
+
When @code{--archive=bioconductor} is added, metadata is imported from
@uref{http://www.bioconductor.org/, Bioconductor}, a repository of R
packages for for the analysis and comprehension of high-throughput
diff --git a/guix/scripts/import/cran.scm b/guix/scripts/import/cran.scm
index ace1123..66c660a 100644
--- a/guix/scripts/import/cran.scm
+++ b/guix/scripts/import/cran.scm
@@ -26,6 +26,7 @@
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-11)
#:use-module (srfi srfi-37)
+ #:use-module (srfi srfi-41)
#:use-module (ice-9 match)
#:use-module (ice-9 format)
#:export (guix-import-cran))
@@ -63,6 +64,9 @@ Import and convert the CRAN package for PACKAGE-NAME.\n"))
(lambda (opt name arg result)
(alist-cons 'repo (string->symbol arg)
(alist-delete 'repo result))))
+ (option '(#\r "recursive") #f #f
+ (lambda (opt name arg result)
+ (alist-cons 'recursive #t result)))
%standard-import-options))
@@ -88,12 +92,22 @@ Import and convert the CRAN package for PACKAGE-NAME.\n"))
(reverse opts))))
(match args
((package-name)
- (let ((sexp (cran->guix-package package-name
- (or (assoc-ref opts 'repo) 'cran))))
- (unless sexp
- (leave (_ "failed to download description for package '~a'~%")
- package-name))
- sexp))
+ (if (assoc-ref opts 'recursive)
+ ;; Recursive import
+ (map (match-lambda
+ ((and ('package ('name name) . rest) pkg)
+ `(define-public ,(string->symbol name)
+ ,pkg))
+ (_ #f))
+ (stream->list (recursive-import package-name
+ (or (assoc-ref opts 'repo)
'cran))))
+ ;; Single import
+ (let ((sexp (cran->guix-package package-name
+ (or (assoc-ref opts 'repo) 'cran))))
+ (unless sexp
+ (leave (_ "failed to download description for package '~a'~%")
+ package-name))
+ sexp)))
(()
(leave (_ "too few arguments~%")))
((many ...)
- 28/155: gnu: Add emacs-guix., (continued)
- 28/155: gnu: Add emacs-guix., John Darrington, 2016/12/21
- 30/155: gnu: star: Update to 2.5.2b., John Darrington, 2016/12/21
- 46/155: gnu: pinentry: Update to 1.0.0., John Darrington, 2016/12/21
- 52/155: gnu: r: Update to 3.3.2., John Darrington, 2016/12/21
- 44/155: import cran: Handle HTTP errors., John Darrington, 2016/12/21
- 26/155: gnu: imagemagick: Update to 6.9.6-8., John Darrington, 2016/12/21
- 40/155: import cran: Ignore default R packages., John Darrington, 2016/12/21
- 50/155: gnu: sane-backends: Remove timestamps from the output., John Darrington, 2016/12/21
- 39/155: import cran: description->package: Also return package dependencies., John Darrington, 2016/12/21
- 45/155: gnu: npth: Update to 1.3., John Darrington, 2016/12/21
- 42/155: import cran: Add "recursive" option.,
John Darrington <=
- 32/155: profiles: Remove dependency on 'glibc-utf8-locales' for tests., John Darrington, 2016/12/21
- 31/155: gnu: bootstrap: Add FTP URL for bootstrap binaries., John Darrington, 2016/12/21
- 53/155: gnu: youtube-dl: Update to 2016.12.15., John Darrington, 2016/12/21
- 49/155: gnu: Add and use sane-backends., John Darrington, 2016/12/21
- 61/155: tests: Mock up http-fetch., John Darrington, 2016/12/21
- 57/155: gnu: yoshimi: Update to 1.5.0., John Darrington, 2016/12/21
- 56/155: tests: Mock up http-fetch in import test., John Darrington, 2016/12/21
- 48/155: gnu: Add and use sane-backends-minimal., John Darrington, 2016/12/21
- 41/155: import cran: Add recursive importer., John Darrington, 2016/12/21
- 67/155: build: Fix .service and .conf targets for VPATH builds., John Darrington, 2016/12/21