summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2015-12-29 09:22:32 -0800
committerTodd Gamblin <tgamblin@llnl.gov>2015-12-29 09:22:32 -0800
commit99a73c5991bd53fb6409c3ee2a684abb997d6473 (patch)
tree5044c0f4b97603bd9f1c094a7b5cc15b4f853254
parent487ac9cd191d529fe1de5c7a108a72b70ad7a7a2 (diff)
parentd7607973fa37ec2a5325111336be44f02cb95860 (diff)
downloadspack-99a73c5991bd53fb6409c3ee2a684abb997d6473.tar.gz
spack-99a73c5991bd53fb6409c3ee2a684abb997d6473.tar.bz2
spack-99a73c5991bd53fb6409c3ee2a684abb997d6473.tar.xz
spack-99a73c5991bd53fb6409c3ee2a684abb997d6473.zip
Merge pull request #285 from trws/args-check
fix for array handling in ancient bash
-rwxr-xr-xshare/spack/setup-env.sh9
1 files changed, 4 insertions, 5 deletions
diff --git a/share/spack/setup-env.sh b/share/spack/setup-env.sh
index 47202f6087..4faae0d2c9 100755
--- a/share/spack/setup-env.sh
+++ b/share/spack/setup-env.sh
@@ -55,13 +55,12 @@
# avoids the need to come up with a user-friendly naming scheme for
# spack dotfiles.
########################################################################
+arrtest[0]='test' || (echo 'Failure: arrays not supported in this version of bash.' && exit 2)
+
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
+ declare -a args=( "$@" )
+
# accumulate initial flags for main spack command
_sp_flags=""
while [[ "$1" =~ ^- ]]; do