about summary refs log tree commit diff
path: root/pkgs/development/interpreters/tcl
diff options
context:
space:
mode:
authorAndrew Brooks <andrew.brooks@flightaware.com>2021-05-10 11:01:19 -0500
committerAndrew Brooks <andrew.brooks@flightaware.com>2021-05-21 15:18:26 -0500
commite22fe366afc982c0e0e2af11d4f1a54a4a00035b (patch)
tree5d9ddd5a734772ba9ff9952147a7f45d9396b9e0 /pkgs/development/interpreters/tcl
parent1c44a44932786cdc5ba99d87b5a505f5ae94eaee (diff)
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.
Diffstat (limited to 'pkgs/development/interpreters/tcl')
-rw-r--r--pkgs/development/interpreters/tcl/tcl-package-hook.sh4
1 files 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 5f105e2fc7ea7..261feda55af11 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
 }