about summary refs log tree commit diff
path: root/pkgs/test/make-wrapper
diff options
context:
space:
mode:
authortalyz <kim.lindberger@gmail.com>2022-02-12 02:11:33 +0100
committertalyz <kim.lindberger@gmail.com>2022-02-12 11:03:32 +0100
commit183147a037b68c656e5e568f4d7f00e994068e0f (patch)
tree7e9d21a90b901b80c661fd04be0498521a8bb258 /pkgs/test/make-wrapper
parent2ea430e6240e31c0c88bed8964490a70807915e6 (diff)
makeWrapper: Don't glob in prefix/suffix
Disable file globbing in --prefix/--suffix, since bash will otherwise
try to find filenames matching the the value to be prefixed/suffixed
if it contains characters considered wildcards, such as `?` and
`*`. We want the value as is, except we also want to split it on on
the separator; hence we can't quote it.
Diffstat (limited to 'pkgs/test/make-wrapper')
-rw-r--r--pkgs/test/make-wrapper/default.nix3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkgs/test/make-wrapper/default.nix b/pkgs/test/make-wrapper/default.nix
index 6e70945ee194b..62ccd272adf47 100644
--- a/pkgs/test/make-wrapper/default.nix
+++ b/pkgs/test/make-wrapper/default.nix
@@ -64,6 +64,7 @@ runCommand "make-wrapper-test"
     (mkWrapperBinary { name = "test-run-and-set"; args = [ "--run" "export VAR=foo" "--set" "VAR" "bar" ]; })
     (mkWrapperBinary { name = "test-args"; args = [ "--add-flags" "abc" ]; wrapped = wrappedBinaryArgs; })
     (mkWrapperBinary { name = "test-prefix"; args = [ "--prefix" "VAR" ":" "abc" ]; })
+    (mkWrapperBinary { name = "test-prefix-noglob"; args = [ "--prefix" "VAR" ":" "./*" ]; })
     (mkWrapperBinary { name = "test-suffix"; args = [ "--suffix" "VAR" ":" "abc" ]; })
     (mkWrapperBinary { name = "test-prefix-and-suffix"; args = [ "--prefix" "VAR" ":" "foo" "--suffix" "VAR" ":" "bar" ]; })
     (mkWrapperBinary { name = "test-prefix-multi"; args = [ "--prefix" "VAR" ":" "abc:foo:foo" ]; })
@@ -112,6 +113,8 @@ runCommand "make-wrapper-test"
     # Only append the value once when given multiple times in a parameter
     # to makeWrapper
     + mkTest "test-prefix" "VAR=abc"
+    # --prefix doesn't expand globs
+    + mkTest "VAR=f?oo test-prefix-noglob" "VAR=./*:f?oo"
 
 
     # --suffix works