summary refs log tree commit diff
path: root/pkgs/development/interpreters/python/wrap.sh
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2019-12-28 22:10:28 +0100
committerJan Tojnar <jtojnar@gmail.com>2019-12-28 22:23:36 +0100
commita6bb2ede232940a96150da7207a3ecd15eb6328c (patch)
tree311a1bdc8281b05b92d0d963078edf84bb37dbe4 /pkgs/development/interpreters/python/wrap.sh
parent4a2621da53705b602bcdd8460157517f23d14cff (diff)
downloadnixpkgs-a6bb2ede232940a96150da7207a3ecd15eb6328c.tar
nixpkgs-a6bb2ede232940a96150da7207a3ecd15eb6328c.tar.gz
nixpkgs-a6bb2ede232940a96150da7207a3ecd15eb6328c.tar.bz2
nixpkgs-a6bb2ede232940a96150da7207a3ecd15eb6328c.tar.lz
nixpkgs-a6bb2ede232940a96150da7207a3ecd15eb6328c.tar.xz
nixpkgs-a6bb2ede232940a96150da7207a3ecd15eb6328c.tar.zst
nixpkgs-a6bb2ede232940a96150da7207a3ecd15eb6328c.zip
python.pkgs.wrapPython: fix string makeWrapperArgs
Bash takes an assignment of a string to an array variable:

local -a user_args
user_args="(foo bar)"

to mean appending the string to the array, not parsing the string into
an array as is the case when on the same line as the declaration:

local -a user_args="(foo bar)"

b0633406cb70e0e4ae3470a6b49e32b38d99ac16 extracted the declaration before
the newly branched code block, causing string makeWrapperArgs being added
to the array verbatim.

Since local is function scoped, it does not matter if we move it inside
each of the branches so we fix it this way.
Diffstat (limited to 'pkgs/development/interpreters/python/wrap.sh')
-rw-r--r--pkgs/development/interpreters/python/wrap.sh5
1 files changed, 2 insertions, 3 deletions
diff --git a/pkgs/development/interpreters/python/wrap.sh b/pkgs/development/interpreters/python/wrap.sh
index 6beb55f055b..030b3d2b6d8 100644
--- a/pkgs/development/interpreters/python/wrap.sh
+++ b/pkgs/development/interpreters/python/wrap.sh
@@ -81,14 +81,13 @@ wrapPythonProgramsIn() {
 
                     # Add any additional arguments provided by makeWrapperArgs
                     # argument to buildPythonPackage.
-                    local -a user_args
                     # We need to support both the case when makeWrapperArgs
                     # is an array and a IFS-separated string.
                     # TODO: remove the string branch when __structuredAttrs are used.
                     if [[ "$(declare -p makeWrapperArgs)" =~ ^'declare -a makeWrapperArgs=' ]]; then
-                        user_args=("${makeWrapperArgs[@]}")
+                        local -a user_args=("${makeWrapperArgs[@]}")
                     else
-                        user_args="($makeWrapperArgs)"
+                        local -a user_args="($makeWrapperArgs)"
                     fi
 
                     local -a wrapProgramArgs=("${wrap_args[@]}" "${user_args[@]}")