diff options
author | Gregory Becker <becker33@llnl.gov> | 2016-05-12 17:20:48 -0700 |
---|---|---|
committer | Gregory Becker <becker33@llnl.gov> | 2016-05-12 17:20:48 -0700 |
commit | 4c9dd028d2305360329767831e65bafe403c6e8a (patch) | |
tree | 97853cd6cb8ff53588f4463ba3b9b80d905aa5ba /lib | |
parent | 90b7b7ba5c483054a3b6687f84306601d0e62d15 (diff) | |
download | spack-4c9dd028d2305360329767831e65bafe403c6e8a.tar.gz spack-4c9dd028d2305360329767831e65bafe403c6e8a.tar.bz2 spack-4c9dd028d2305360329767831e65bafe403c6e8a.tar.xz spack-4c9dd028d2305360329767831e65bafe403c6e8a.zip |
Fixed error causing hang in env/cc
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/spack/env/cc | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/lib/spack/env/cc b/lib/spack/env/cc index 4a3e6eddc9..91916c4532 100755 --- a/lib/spack/env/cc +++ b/lib/spack/env/cc @@ -153,6 +153,29 @@ fi # Save original command for debug logging input_command="$@" +# +# Filter '.' and Spack environment directories out of PATH so that +# this script doesn't just call itself +# +IFS=':' read -ra env_path <<< "$PATH" +IFS=':' read -ra spack_env_dirs <<< "$SPACK_ENV_PATH" +spack_env_dirs+=(".") +PATH="" +for dir in "${env_path[@]}"; do + remove="" + for rm_dir in "${spack_env_dirs[@]}"; do + if [ "$dir" = "$rm_dir" ]; then remove=True; fi + done + if [ -z "$remove" ]; then + if [ -z "$PATH" ]; then + PATH="$dir" + else + PATH="$PATH:$dir" + fi + fi +done +export PATH + if [ "$mode" == vcheck ] ; then exec ${command} "$@" fi @@ -317,29 +340,6 @@ unset LD_LIBRARY_PATH unset LD_RUN_PATH unset DYLD_LIBRARY_PATH -# -# Filter '.' and Spack environment directories out of PATH so that -# this script doesn't just call itself -# -IFS=':' read -ra env_path <<< "$PATH" -IFS=':' read -ra spack_env_dirs <<< "$SPACK_ENV_PATH" -spack_env_dirs+=(".") -PATH="" -for dir in "${env_path[@]}"; do - remove="" - for rm_dir in "${spack_env_dirs[@]}"; do - if [ "$dir" = "$rm_dir" ]; then remove=True; fi - done - if [ -z "$remove" ]; then - if [ -z "$PATH" ]; then - PATH="$dir" - else - PATH="$PATH:$dir" - fi - fi -done -export PATH - full_command=("$command") full_command+=("${args[@]}") |