[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/09: transformations: Raise '&formatted-message' exceptions instead of
From: |
guix-commits |
Subject: |
05/09: transformations: Raise '&formatted-message' exceptions instead of 'leave'. |
Date: |
Sat, 31 Oct 2020 18:18:09 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 31726f32ac6202cdcac50fba204279f2ffe227ba
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Thu Oct 29 23:40:14 2020 +0100
transformations: Raise '&formatted-message' exceptions instead of 'leave'.
* guix/transformations.scm (evaluate-replacement-specs)
(package-git-url, evaluate-git-replacement-specs)
(transform-package-source-git-url)
(transform-package-toolchain): Use 'raise' and 'formatted-message'
instead of 'leave'.
---
guix/transformations.scm | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/guix/transformations.scm b/guix/transformations.scm
index 126a9a6..30142dd 100644
--- a/guix/transformations.scm
+++ b/guix/transformations.scm
@@ -38,6 +38,7 @@
#:use-module (srfi srfi-9)
#:use-module (srfi srfi-11)
#:use-module (srfi srfi-26)
+ #:use-module (srfi srfi-34)
#:use-module (srfi srfi-37)
#:use-module (ice-9 match)
#:export (options->transformation
@@ -169,7 +170,9 @@ package it refers to could not be found."
(lambda (old)
(proc old new)))))
(x
- (leave (G_ "invalid replacement specification: ~s~%") spec))))
+ (raise (formatted-message
+ (G_ "invalid replacement specification: ~s")
+ spec)))))
specs))
(define (transform-package-inputs replacement-specs)
@@ -216,8 +219,9 @@ the source of PACKAGE is not fetched from a Git repository."
((git-checkout? source)
(git-checkout-url source))
(else
- (leave (G_ "the source of ~a is not a Git reference~%")
- (package-full-name package))))))
+ (raise
+ (formatted-message (G_ "the source of ~a is not a Git reference")
+ (package-full-name package)))))))
(define (evaluate-git-replacement-specs specs proc)
"Parse SPECS, a list of strings like \"guile=stable-2.2\", and return a list
@@ -234,7 +238,9 @@ syntax, or if a package it refers to could not be found."
(cons spec replace))
(_
- (leave (G_ "invalid replacement specification: ~s~%") spec))))
+ (raise
+ (formatted-message (G_ "invalid replacement specification: ~s")
+ spec)))))
specs))
(define (transform-package-source-branch replacement-specs)
@@ -304,8 +310,10 @@ a checkout of the Git repository at the given URL."
(source (git-checkout (url url)
(recursive? #t)))))))
(_
- (leave (G_ "~a: invalid Git URL replacement specification~%")
- spec))))
+ (raise
+ (formatted-message
+ (G_ "~a: invalid Git URL replacement specification")
+ spec)))))
replacement-specs))
(define rewrite
@@ -380,8 +388,10 @@ the equal sign."
((spec (= split-on-commas toolchain))
(cons spec (map specification->input toolchain)))
(_
- (leave (G_ "~a: invalid toolchain replacement specification~%")
- spec))))
+ (raise
+ (formatted-message
+ (G_ "~a: invalid toolchain replacement specification")
+ spec)))))
replacement-specs))
(lambda (obj)
- branch master updated (48dec2e -> 70876b0), guix-commits, 2020/10/31
- 02/09: guix build: Remove unnecessary (replacement #f)., guix-commits, 2020/10/31
- 01/09: guix build: 'package-with-source' no longer takes a 'store' parameter., guix-commits, 2020/10/31
- 03/09: guix build: 'options->transformation' no longer takes a 'store' parameter., guix-commits, 2020/10/31
- 06/09: doc: Add "Defining Package Variants" section., guix-commits, 2020/10/31
- 04/09: guix build: Move transformation options to (guix transformations)., guix-commits, 2020/10/31
- 05/09: transformations: Raise '&formatted-message' exceptions instead of 'leave'.,
guix-commits <=
- 09/09: gnu: httpie: Update to 2.3.0., guix-commits, 2020/10/31
- 07/09: pack: Relocatable wrapper leaves root available to child processes., guix-commits, 2020/10/31
- 08/09: gnu: esbuild: Update to 0.8.0., guix-commits, 2020/10/31