summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Scogland <scogland1@llnl.gov>2015-11-25 11:02:51 -0800
committerTom Scogland <scogland1@llnl.gov>2015-11-25 11:02:51 -0800
commit3ce99cf4e18b599a42041a486b82498a0f43a488 (patch)
tree4f25df6b3eb741f31916ecd6ffde4cbeacd9f535
parentdd21a01dc41c648b3e6b289256f2043bd3b867f4 (diff)
downloadspack-3ce99cf4e18b599a42041a486b82498a0f43a488.tar.gz
spack-3ce99cf4e18b599a42041a486b82498a0f43a488.tar.bz2
spack-3ce99cf4e18b599a42041a486b82498a0f43a488.tar.xz
spack-3ce99cf4e18b599a42041a486b82498a0f43a488.zip
fix for the shell arg handling issues
The setup-env.sh script now saves off the argument array before shifting off all the arguments so that the final command invocation doesn't arbitrarily requote the arguments. All external quoting is preserved now. This has been thoroughly tested with zsh, but should probably be tested with bash etc. before acceptance.
-rwxr-xr-xshare/spack/setup-env.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/share/spack/setup-env.sh b/share/spack/setup-env.sh
index b90846d28f..8ee42bb10f 100755
--- a/share/spack/setup-env.sh
+++ b/share/spack/setup-env.sh
@@ -56,6 +56,12 @@
# spack dotfiles.
########################################################################
function spack {
+ # save raw arguments into an array before butchering them
+ args=()
+ for a in "$@"; do
+ # yup, this is awful, blame bash2 compat
+ args=("${args[@]}" "$a")
+ done
# accumulate initial flags for main spack command
_sp_flags=""
while [[ "$1" =~ ^- ]]; do
@@ -116,7 +122,7 @@ function spack {
esac
;;
*)
- command spack $_sp_flags $_sp_subcommand $_sp_spec
+ command spack "${args[@]}"
;;
esac
}