Skip to content

Commit 0661c4b

Browse files
Copilotpcanal
andcommitted
Fix thisroot.sh to properly remove previous ROOT version from paths
The second call to drop_from_path was using the original path variable instead of $newpath (result of first call), causing only the last transformation to be applied. This affected LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, SHLIB_PATH, LIBPATH, and PYTHONPATH. Fixes the issue where old_rootsys/lib was not being removed when switching ROOT versions. Co-authored-by: pcanal <[email protected]>
1 parent a9e5f8c commit 0661c4b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

config/thisroot.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,27 +39,27 @@ clean_environment()
3939
fi
4040
if [ -n "${LD_LIBRARY_PATH-}" ]; then
4141
drop_from_path "$LD_LIBRARY_PATH" "${old_rootsys}/lib"
42-
drop_from_path "$LD_LIBRARY_PATH" "${old_rootsys}/lib/root"
42+
drop_from_path "$newpath" "${old_rootsys}/lib/root"
4343
LD_LIBRARY_PATH=$newpath
4444
fi
4545
if [ -n "${DYLD_LIBRARY_PATH-}" ]; then
4646
drop_from_path "$DYLD_LIBRARY_PATH" "${old_rootsys}/lib"
47-
drop_from_path "$DYLD_LIBRARY_PATH" "${old_rootsys}/lib/root"
47+
drop_from_path "$newpath" "${old_rootsys}/lib/root"
4848
DYLD_LIBRARY_PATH=$newpath
4949
fi
5050
if [ -n "${SHLIB_PATH-}" ]; then
5151
drop_from_path "$SHLIB_PATH" "${old_rootsys}/lib"
52-
drop_from_path "$SHLIB_PATH" "${old_rootsys}/lib/root"
52+
drop_from_path "$newpath" "${old_rootsys}/lib/root"
5353
SHLIB_PATH=$newpath
5454
fi
5555
if [ -n "${LIBPATH-}" ]; then
5656
drop_from_path "$LIBPATH" "${old_rootsys}/lib"
57-
drop_from_path "$LIBPATH" "${old_rootsys}/lib/root"
57+
drop_from_path "$newpath" "${old_rootsys}/lib/root"
5858
LIBPATH=$newpath
5959
fi
6060
if [ -n "${PYTHONPATH-}" ]; then
6161
drop_from_path "$PYTHONPATH" "${old_rootsys}/lib"
62-
drop_from_path "$PYTHONPATH" "${old_rootsys}/lib/root"
62+
drop_from_path "$newpath" "${old_rootsys}/lib/root"
6363
PYTHONPATH=$newpath
6464
fi
6565
if [ -n "${MANPATH-}" ]; then

0 commit comments

Comments
 (0)