From a6bb2ede232940a96150da7207a3ecd15eb6328c Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 28 Dec 2019 22:10:28 +0100 Subject: [PATCH] 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. --- pkgs/development/interpreters/python/wrap.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/development/interpreters/python/wrap.sh b/pkgs/development/interpreters/python/wrap.sh index 6beb55f055b5..030b3d2b6d85 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[@]}")