[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
11/13: scripts: import: gem: Fix recursive error handling.
From: |
guix-commits |
Subject: |
11/13: scripts: import: gem: Fix recursive error handling. |
Date: |
Mon, 7 Mar 2022 16:50:54 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit 5278cab3dc001b371e1ed2f920b7f0c5678938e3
Author: zimoun <zimon.toutoune@gmail.com>
AuthorDate: Tue Jan 19 16:47:21 2021 +0100
scripts: import: gem: Fix recursive error handling.
Partly fixes <https://bugs.gnu.org/44115>.
* guix/scripts/import/gem.scm (guix-import-gem): Handle error.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
guix/scripts/import/gem.scm | 33 ++++++++++++++++++---------------
1 file changed, 18 insertions(+), 15 deletions(-)
diff --git a/guix/scripts/import/gem.scm b/guix/scripts/import/gem.scm
index 328d20b946..82deac16ad 100644
--- a/guix/scripts/import/gem.scm
+++ b/guix/scripts/import/gem.scm
@@ -3,6 +3,7 @@
;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
+;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -80,24 +81,26 @@ Import and convert the RubyGems package for
PACKAGE-NAME.\n"))
(let* ((opts (parse-options))
(args (filter-map (match-lambda
- (('argument . value)
- value)
- (_ #f))
+ (('argument . value)
+ value)
+ (_ #f))
(reverse opts))))
(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))
- (gem-recursive-import package-name 'rubygems))
- (let ((sexp (gem->guix-package package-name)))
- (unless sexp
- (leave (G_ "failed to download meta-data for package '~a'~%")
- package-name))
- sexp)))
+ (let ((code (if (assoc-ref opts 'recursive)
+ (map (match-lambda
+ ((and ('package ('name name) . rest) pkg)
+ `(define-public ,(string->symbol name)
+ ,pkg))
+ (_ #f))
+ (gem-recursive-import package-name 'rubygems))
+ (let ((sexp (gem->guix-package package-name)))
+ (if sexp sexp #f)))))
+ (match code
+ ((or #f '(#f))
+ (leave (G_ "failed to download meta-data for package '~a'~%")
+ package-name))
+ (_ code))))
(()
(leave (G_ "too few arguments~%")))
((many ...)
- 01/13: tests: Adjust to (guix import github) changes., (continued)
- 01/13: tests: Adjust to (guix import github) changes., guix-commits, 2022/03/07
- 02/13: gnu: scotch: Explicitly pass "-DINTSIZE" to CMake., guix-commits, 2022/03/07
- 03/13: derivations: Coalesce inputs that have the same output path., guix-commits, 2022/03/07
- 04/13: gnu: Add gnusim8085., guix-commits, 2022/03/07
- 10/13: import: cran: Return multiple values for unknown packages., guix-commits, 2022/03/07
- 12/13: import: hackage: Avoid pointless use of 'compose'., guix-commits, 2022/03/07
- 13/13: import: hackage: Use SRFI-71 instead of SRFI-11., guix-commits, 2022/03/07
- 05/13: gnu: Add python-multipart., guix-commits, 2022/03/07
- 07/13: import: pypi: Return multiple values for unknown packages., guix-commits, 2022/03/07
- 08/13: import: hackage: Return multiple values for unknown packages., guix-commits, 2022/03/07
- 11/13: scripts: import: gem: Fix recursive error handling.,
guix-commits <=
- 06/13: import: pypi: Gracefully handle missing project home page., guix-commits, 2022/03/07
- 09/13: import: elpa: Return multiple values for unknown packages., guix-commits, 2022/03/07