tcl: fix TCLLIBPATH edge cases in tcl package hook

TCLLIBPATH was not actually extended if a package's path was a substring
of a package already on the path. This commit fixes that behavior.

Additionally, '--prefix' is now used in place of '--set', as the latter
was found to break tkremind from the remind package.
This commit is contained in:
Andrew Brooks 2021-05-10 11:01:19 -05:00
parent 1c44a44932
commit e22fe366af

View File

@ -21,7 +21,7 @@ _addToTclLibPath() {
if [ -z "${TCLLIBPATH-}" ]; then
export TCLLIBPATH="$tclPkg"
else
if [[ "$TCLLIBPATH" != *"$tclPkg"* ]]; then
if [[ "$TCLLIBPATH" != *"$tclPkg "* && "$TCLLIBPATH" != *"$tclPkg" ]]; then
export TCLLIBPATH="${TCLLIBPATH} $tclPkg"
fi
fi
@ -53,7 +53,7 @@ wrapTclBins() {
find "$tclBinsDir" -type f -executable -print |
while read -r someBin; do
echo "Adding TCLLIBPATH wrapper for $someBin"
wrapProgram "$someBin" --set TCLLIBPATH "$TCLLIBPATH"
wrapProgram "$someBin" --prefix TCLLIBPATH ' ' "$TCLLIBPATH"
done
}