guix-commits
[Top][All Lists]
Advanced

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

branch master updated: import/cran: Abort with error message when recurs


From: guix-commits
Subject: branch master updated: import/cran: Abort with error message when recursive import fails.
Date: Fri, 11 Dec 2020 18:13:30 -0500

This is an automated email from the git hooks/post-receive script.

rekado pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 482b8ae  import/cran: Abort with error message when recursive import 
fails.
482b8ae is described below

commit 482b8ae2cd3f126a1300178e317df8993bf75b16
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Sat Dec 12 00:06:18 2020 +0100

    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.
---
 guix/import/cran.scm         | 6 +++++-
 guix/scripts/import/cran.scm | 9 +++++----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index 6c1fbd7..1d25a51 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -29,6 +29,7 @@
   #: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 @@ s-expression corresponding to that package, or #f on 
failure."
              ((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
diff --git a/guix/scripts/import/cran.scm b/guix/scripts/import/cran.scm
index 33944c4..20e82ae 100644
--- a/guix/scripts/import/cran.scm
+++ b/guix/scripts/import/cran.scm
@@ -97,10 +97,11 @@ Import and convert the CRAN package for PACKAGE-NAME.\n"))
       ((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))))



reply via email to

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