diff options
author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2023-02-01 09:52:43 -0500 |
---|---|---|
committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2023-02-02 14:14:39 -0500 |
commit | 9e9346dc83ff585db9a721cab46e46713c597da1 (patch) | |
tree | 1309c9df99f3de4438cf27dc29248c5eb17dc3e0 | |
parent | 702cf01568f1af193424b1c6db9b7f32d1951c9a (diff) | |
download | guix-patches-9e9346dc83ff585db9a721cab46e46713c597da1.tar guix-patches-9e9346dc83ff585db9a721cab46e46713c597da1.tar.gz |
pack: Extract keyword-ref procedure from debian-archive.
Rationale: the upcoming rpm-archive builder will also use it.
* guix/scripts/pack.scm:
(keyword-ref): New top-level procedure, extracted from...
(debian-archive): ... here. Adjust usages accordingly.
-rw-r--r-- | guix/scripts/pack.scm | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index f65642fb85..7e466a2be7 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -194,6 +194,12 @@ target the profile's @file{bin/env} file: (leave (G_ "~a: invalid symlink specification~%") arg)))) +(define (keyword-ref lst keyword) + "Return the value of KEYWORD in LST, else #f." + (match (memq keyword lst) + ((_ value . _) value) + (#f #f))) + ;;; ;;; Tarball format. @@ -762,20 +768,15 @@ Valid compressors are: ~a~%") compressor-name %valid-compressors))) (copy-file #+data-tarball data-tarball-file-name) - (define (keyword-ref lst keyword) - (match (memq keyword lst) - ((_ value . _) value) - (#f #f))) - ;; Generate the control archive. (define control-file - (keyword-ref '#$extra-options #:control-file)) + #$(keyword-ref `(,@extra-options) #:control-file)) (define postinst-file - (keyword-ref '#$extra-options #:postinst-file)) + #$(keyword-ref `(,@extra-options) #:postinst-file)) (define triggers-file - (keyword-ref '#$extra-options #:triggers-file)) + #$(keyword-ref `(,@extra-options) #:triggers-file)) (define control-tarball-file-name (string-append "control.tar" |