GNU bug report logs -
#63053
[PATCH 0/3] Fix "guix import crate"
Previous Next
Full log
View this message in rfc822 format
Fixes <https://bugs/gnu.org/63020>.
* guix/scripts/import/crate.scm (guix-import-crate): Handle non-existent
package input.
---
guix/scripts/import/crate.scm | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/guix/scripts/import/crate.scm b/guix/scripts/import/crate.scm
index 97152904ac..038faa87db 100644
--- a/guix/scripts/import/crate.scm
+++ b/guix/scripts/import/crate.scm
@@ -4,6 +4,7 @@
;;; Copyright © 2016 David Craven <david <at> craven.ch>
;;; Copyright © 2019, 2020 Martin Becze <mjbecze <at> riseup.net>
;;; Copyright © 2021 Sarah Morgensen <iskarian <at> mgsn.dev>
+;;; Copyright © 2023 Simon Tournier <zimon.toutoune <at> gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -90,15 +91,16 @@ (define (parse-options)
(define-values (name version)
(package-name->name+version spec))
- (if (assoc-ref opts 'recursive)
- (crate-recursive-import name #:version version)
- (let ((sexp (crate->guix-package name #:version version #:include-dev-deps? #t)))
- (unless sexp
- (leave (G_ "failed to download meta-data for package '~a'~%")
- (if version
- (string-append name "@" version)
- name)))
- (list sexp))))
+ (match (if (assoc-ref opts 'recursive)
+ (crate-recursive-import name #:version version)
+ (crate->guix-package name #:version version #:include-dev-deps? #t))
+ ((or #f '())
+ (leave (G_ "failed to download meta-data for package '~a'~%")
+ (if version
+ (string-append name "@" version)
+ name)))
+ ((? list? sexps) sexps)
+ (sexp (list sexp))))
(()
(leave (G_ "too few arguments~%")))
((many ...)
--
2.38.1
This bug report was last modified 2 years and 25 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.