scripts: import: elpa: Return consistent error code.
Fixes <https://bug.gnu.org/58308>. Reported by Ricardo Wurmus. * guix/scripts/import/elpa.scm (guix-import-elpa): Return consistent error code independently of the 'recursive' option. Signed-off-by: Josselin Poiret <dev@jpoiret.xyz>
This commit is contained in:
parent
b89ab866bc
commit
d81701a85a
@ -97,20 +97,21 @@ Import the latest package named PACKAGE-NAME from an ELPA repository.\n"))
|
|||||||
(package-name->name+version spec))
|
(package-name->name+version spec))
|
||||||
(when version
|
(when version
|
||||||
(warning (G_ "this importer does not consider the version~%")))
|
(warning (G_ "this importer does not consider the version~%")))
|
||||||
(if (assoc-ref opts 'recursive)
|
(match (if (assoc-ref opts 'recursive)
|
||||||
(with-error-handling
|
|
||||||
(map (match-lambda
|
|
||||||
((and ('package ('name name) . rest) pkg)
|
|
||||||
`(define-public ,(string->symbol name)
|
|
||||||
,pkg))
|
|
||||||
(_ #f))
|
|
||||||
(elpa-recursive-import package-name
|
(elpa-recursive-import package-name
|
||||||
(or (assoc-ref opts 'repo) 'gnu))))
|
(or (assoc-ref opts 'repo) 'gnu))
|
||||||
(let ((sexp (elpa->guix-package package-name
|
(elpa->guix-package package-name
|
||||||
#:repo (assoc-ref opts 'repo))))
|
#:repo (assoc-ref opts 'repo)))
|
||||||
(unless sexp
|
((or #f '())
|
||||||
(leave (G_ "failed to download package '~a'~%") package-name))
|
(leave (G_ "failed to download meta-data for package '~a'~%") package-name))
|
||||||
sexp)))
|
(('package etc ...) `(package ,etc))
|
||||||
|
((? list? sexps) (map
|
||||||
|
(match-lambda
|
||||||
|
((and ('package ('name name) . rest) pkg)
|
||||||
|
`(define-public ,(string->symbol name)
|
||||||
|
,pkg))
|
||||||
|
(_ #f))
|
||||||
|
sexps))))
|
||||||
(()
|
(()
|
||||||
(leave (G_ "too few arguments~%")))
|
(leave (G_ "too few arguments~%")))
|
||||||
((many ...)
|
((many ...)
|
||||||
|
Loading…
Reference in New Issue
Block a user