diff options
author | Marius Bakke <mbakke@fastmail.com> | 2017-08-26 15:15:49 +0200 |
---|---|---|
committer | Marius Bakke <mbakke@fastmail.com> | 2017-08-26 15:15:49 +0200 |
commit | 72e2815d18ad688b0a16ce3b3efba1172423cec4 (patch) | |
tree | b3d6aa01aec86a7f224e15d97a40b64de4e5cdb8 /guix/build/utils.scm | |
parent | c20cd0d24d9b5e8a47b864db9799e0992ffd44b9 (diff) | |
parent | 2f837cf7fe100b0584fb02cf8f19d4cfb4e14d88 (diff) | |
download | guix-patches-72e2815d18ad688b0a16ce3b3efba1172423cec4.tar guix-patches-72e2815d18ad688b0a16ce3b3efba1172423cec4.tar.gz |
Merge branch 'core-updates'
Diffstat (limited to 'guix/build/utils.scm')
-rw-r--r-- | guix/build/utils.scm | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/guix/build/utils.scm b/guix/build/utils.scm index e8efb0653a..7391307c87 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -32,7 +32,12 @@ #:use-module (rnrs bytevectors) #:use-module (rnrs io ports) #:re-export (alist-cons - alist-delete) + alist-delete + + ;; Note: Re-export 'delete' to allow for proper syntax matching + ;; in 'modify-phases' forms. See + ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26805#16>. + delete) #:export (%store-directory store-file-name? strip-store-file-name @@ -79,6 +84,7 @@ fold-port-matches remove-store-references wrap-program + invoke locale-category->string)) @@ -574,6 +580,15 @@ Where every <*-phase-name> is an expression evaluating to a symbol, and ((_ phases (add-after old-phase-name new-phase-name new-phase)) (alist-cons-after old-phase-name new-phase-name new-phase phases)))) +(define (invoke program . args) + "Invoke PROGRAM with the given ARGS. Raise an error if the exit +code is non-zero; otherwise return #t." + (let ((status (apply system* program args))) + (unless (zero? status) + (error (format #f "program ~s exited with non-zero code" program) + status)) + #t)) + ;;; ;;; Text substitution (aka. sed). |