From e22fe366afc982c0e0e2af11d4f1a54a4a00035b Mon Sep 17 00:00:00 2001 From: Andrew Brooks Date: Mon, 10 May 2021 11:01:19 -0500 Subject: [PATCH] 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. --- pkgs/development/interpreters/tcl/tcl-package-hook.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/tcl/tcl-package-hook.sh b/pkgs/development/interpreters/tcl/tcl-package-hook.sh index 5f105e2fc7ea..261feda55af1 100644 --- a/pkgs/development/interpreters/tcl/tcl-package-hook.sh +++ b/pkgs/development/interpreters/tcl/tcl-package-hook.sh @@ -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 }