mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-01-19 05:57:04 +01:00
import/cran: Abort with error message when recursive import fails.
Previously, after a failed recursive import "guix import" would signal success. * guix/import/cran.scm (cran->guix-package): Raise a condition when all repositories have been exhausted. * guix/scripts/import/cran.scm (guix-import-cran): Handle errors.
This commit is contained in:
parent
7eb920351a
commit
482b8ae2cd
2 changed files with 10 additions and 5 deletions
|
@ -29,6 +29,7 @@ (define-module (guix import cran)
|
|||
#:use-module (srfi srfi-11)
|
||||
#:use-module (srfi srfi-26)
|
||||
#:use-module (srfi srfi-34)
|
||||
#:use-module (srfi srfi-35)
|
||||
#:use-module (ice-9 receive)
|
||||
#:use-module (web uri)
|
||||
#:use-module (guix memoization)
|
||||
|
@ -585,7 +586,10 @@ (define cran->guix-package
|
|||
((bioconductor)
|
||||
;; Retry import from CRAN
|
||||
(cran->guix-package package-name #:repo 'cran))
|
||||
(else (values #f '()))))))))
|
||||
(else
|
||||
(raise (condition
|
||||
(&message
|
||||
(message "couldn't find meta-data for R package")))))))))))
|
||||
|
||||
(define* (cran-recursive-import package-name #:key (repo 'cran))
|
||||
(recursive-import package-name
|
||||
|
|
|
@ -97,10 +97,11 @@ (define (parse-options)
|
|||
((package-name)
|
||||
(if (assoc-ref opts 'recursive)
|
||||
;; Recursive import
|
||||
(map package->definition
|
||||
(filter identity
|
||||
(cran-recursive-import package-name
|
||||
#:repo (or (assoc-ref opts 'repo) 'cran))))
|
||||
(with-error-handling
|
||||
(map package->definition
|
||||
(filter identity
|
||||
(cran-recursive-import package-name
|
||||
#:repo (or (assoc-ref opts 'repo) 'cran)))))
|
||||
;; Single import
|
||||
(let ((sexp (cran->guix-package package-name
|
||||
#:repo (or (assoc-ref opts 'repo) 'cran))))
|
||||
|
|
Loading…
Reference in a new issue