[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master a48eb51 1/4: Establish a global $MINIMAL_PATH
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master a48eb51 1/4: Establish a global $MINIMAL_PATH |
Date: |
Fri, 19 Apr 2019 16:46:28 -0400 (EDT) |
branch: master
commit a48eb513812d88ff7d0e4449a97f82982385d08d
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Establish a global $MINIMAL_PATH
Motivation: frequent shifts among architectures, if made thus:
PATH=32_bit_path;$PATH
PATH=64_bit_path;$PATH
PATH=32_bit_path;$PATH
would cause $PATH to grow monstrously. This method:
PATH=32_bit_path;$MINIMAL_PATH
PATH=64_bit_path;$PATH
prevents that.
The default global value is readily customized in startup files.
---
gwc/.zshrc | 6 ++++++
install_msw.sh | 5 +++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/gwc/.zshrc b/gwc/.zshrc
index a87017f..75d420c 100644
--- a/gwc/.zshrc
+++ b/gwc/.zshrc
@@ -2,7 +2,13 @@
export WINEPATH='Z:\\opt\\lmi\\local\\bin;Z:\\opt\\lmi\\local\\lib'
export LMI_HOST=i686-w64-mingw32
+
+# Minimal system path.
+export MINIMAL_PATH="/usr/bin:/bin:/usr/sbin:/sbin"
+export PATH="$MINIMAL_PATH"
+# For the nonce, still do this:
export PATH="/opt/lmi/local/bin:/opt/lmi/local/lib:$PATH"
+
# At a regular user prompt, outside the chroot, do this:
# $ echo $DISPLAY
# and replace :0.0 below with the string it returns:
diff --git a/install_msw.sh b/install_msw.sh
index 63b70b3..436580a 100755
--- a/install_msw.sh
+++ b/install_msw.sh
@@ -35,8 +35,9 @@ stamp0=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
echo "Started: $stamp0"
# This should work with a rather minimal path.
-minimal_path="/usr/bin:/bin:/usr/sbin:/sbin"
-export PATH=$minimal_path
+
+minimal_path=${MINIMAL_PATH:-"/usr/bin:/bin:/usr/sbin:/sbin"}
+export PATH="$minimal_path"
# '--jobs=4': big benefit for multicore, no penalty for single core
# (but don't force it to 4 if it's already set).