Fix setup-env when going back and forth between instances (#40924)

* setup-env: Fix back and forth between two instances

* setup-env.csh: Fix SPACK_ROOT when switch to a different instance

i.e. Always look for the current SPACK_ROOT

* setup-env: Update comments
This commit is contained in:
Jordan Galby
2024-01-05 18:31:32 +01:00
committed by GitHub
parent c1af62783a
commit 73dae78ab3
4 changed files with 33 additions and 34 deletions

View File

@@ -25,8 +25,8 @@ if ($_pa_set == 1) then
eval set _pa_old_value='$'$_pa_varname
endif
# Do the actual prepending here, if it is a dir and not already in the path
if ( -d $_pa_new_path && \:$_pa_old_value\: !~ *\:$_pa_new_path\:* ) then
# Do the actual prepending here, if it is a dir and not first in the path
if ( -d $_pa_new_path && $_pa_old_value\: !~ $_pa_new_path\:* ) then
if ("x$_pa_old_value" == "x") then
setenv $_pa_varname $_pa_new_path
else