summaryrefslogtreecommitdiff
path: root/guix/scripts/import
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2020-12-31 15:50:48 +0100
committerRicardo Wurmus <rekado@elephly.net>2020-12-31 15:50:48 +0100
commitf249af3086ce420d73feb385a4120f15210285fd (patch)
tree2700862028e9061f7be2c4f35996c4c83b8be6b3 /guix/scripts/import
parente3eea177c8741559a956d5430b7a9b2db98eb8a2 (diff)
import/elpa: Abort early on failure to fetch meta data.
* guix/import/elpa.scm (elpa->guix-package): Raise condition instead of returning #FALSE. * guix/scripts/import/elpa.scm (guix-import-elpa): Handle conditions when importing recursively.
Diffstat (limited to 'guix/scripts/import')
-rw-r--r--guix/scripts/import/elpa.scm15
1 files changed, 8 insertions, 7 deletions
diff --git a/guix/scripts/import/elpa.scm b/guix/scripts/import/elpa.scm
index 07ac07a3d5..d6b38e5c4b 100644
--- a/guix/scripts/import/elpa.scm
+++ b/guix/scripts/import/elpa.scm
@@ -96,13 +96,14 @@ Import the latest package named PACKAGE-NAME from an ELPA repository.\n"))
(match args
((package-name)
(if (assoc-ref opts 'recursive)
- (map (match-lambda
- ((and ('package ('name name) . rest) pkg)
- `(define-public ,(string->symbol name)
- ,pkg))
- (_ #f))
- (elpa-recursive-import package-name
- (or (assoc-ref opts 'repo) 'gnu)))
+ (with-error-handling
+ (map (match-lambda
+ ((and ('package ('name name) . rest) pkg)
+ `(define-public ,(string->symbol name)
+ ,pkg))
+ (_ #f))
+ (elpa-recursive-import package-name
+ (or (assoc-ref opts 'repo) 'gnu))))
(let ((sexp (elpa->guix-package package-name
#:repo (assoc-ref opts 'repo))))
(unless sexp