diff options
author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2024-01-20 22:50:19 -0500 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2024-08-31 10:44:37 +0200 |
commit | 3de22656adbfa62362f735d8e137311a62ded856 (patch) | |
tree | 0e4146d22c2837590b25770244b6d328a6fda696 | |
parent | 47c595b147b06c90f75929f0886515a2d262b865 (diff) | |
download | guix-3de22656adbfa62362f735d8e137311a62ded856.tar.gz guix-3de22656adbfa62362f735d8e137311a62ded856.zip |
packages: Fix repacked file name extension when zstd is unavailable.
This is a follow-up commit to a869f4bef3 ("packages: Repack patched source
archives via zstd by default.").
* guix/packages.scm (patch-and-repack): Do not have xz fallback into the zstd
variable, which is confusing and caused the extension selection to be wrong
when the xz fallback was used. Refine how PATH is set to avoid duplicates.
Change-Id: I580deba4de822eccf5f6fe53355b8ba57178c166
-rw-r--r-- | guix/packages.scm | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/guix/packages.scm b/guix/packages.scm index 1fc10e6575..94254f0154 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -997,10 +997,7 @@ specifies modules in scope when evaluating SNIPPET." (bzip2 (lookup-input "bzip2")) (lzip (lookup-input "lzip")) (xz (lookup-input "xz")) - (zstd (or (lookup-input "zstd") - ;; Fallback to xz in case zstd is not available, such as - ;; for bootstrap packages. - xz)) + (zstd (lookup-input "zstd")) (patch (lookup-input "patch")) (comp (and=> (compressor source-file-name) lookup-input)) (patches (map instantiate-patch patches))) @@ -1081,10 +1078,13 @@ specifies modules in scope when evaluating SNIPPET." locale (system-error-errno args))))) (setenv "PATH" - (string-append #+zstd "/bin" - (if #+comp - (string-append ":" #+comp "/bin") - ""))) + (string-join + (map (cut string-append <> "/bin") + ;; Fallback to xz in case zstd is not + ;; available, such as for bootstrap packages. + (delete-duplicates + (filter-map identity (list #+zstd #+xz #+comp)))) + ":")) (setenv "ZSTD_NBTHREADS" (number->string (parallel-job-count))) |