lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] odd/multiarch cdfac5b 5/5: Restrict $PATH to a hardc


From: Greg Chicares
Subject: [lmi-commits] [lmi] odd/multiarch cdfac5b 5/5: Restrict $PATH to a hardcoded minimum
Date: Mon, 15 Apr 2019 19:53:44 -0400 (EDT)

branch: odd/multiarch
commit cdfac5baba5838d381fed18a6437bf0b8f08db61
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Restrict $PATH to a hardcoded minimum
---
 install_msw.sh | 16 +++++++++-------
 set_arch.sh    |  8 ++------
 2 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/install_msw.sh b/install_msw.sh
index 56f4936..44e558b 100755
--- a/install_msw.sh
+++ b/install_msw.sh
@@ -35,7 +35,10 @@ stamp0=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
 echo "Started: $stamp0"
 
 # This should work with a rather minimal path.
-export PATH="/usr/bin:/bin:/usr/sbin:/sbin"
+# It might be better to rely on 'set_arch.sh' for this instead of
+# setting $minimal_path identically here.
+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).
@@ -230,12 +233,11 @@ echo "$PATH"
 echo "$PATH"
 
 command -v wx-config
-# get rid of this 'minimal_path' variable:
-minimal_path="$PATH"
-make $coefficiency --output-sync=recurse PATH=$minimal_path wx_config_check
-make $coefficiency --output-sync=recurse PATH=$minimal_path show_flags
-make $coefficiency --output-sync=recurse PATH=$minimal_path clean
-make $coefficiency --output-sync=recurse PATH=$minimal_path install
+
+make $coefficiency --output-sync=recurse wx_config_check
+make $coefficiency --output-sync=recurse show_flags
+make $coefficiency --output-sync=recurse clean
+make $coefficiency --output-sync=recurse install
 
 if [ "Cygwin" = "$platform" ]
 then
diff --git a/set_arch.sh b/set_arch.sh
index 50d5fd0..ec24876 100755
--- a/set_arch.sh
+++ b/set_arch.sh
@@ -60,17 +60,13 @@ local extrabindir=/opt/lmi/third_party/bin
 # mistyping, to "x64_86" would find 32-bit binaries where 64-bit
 # binaries were wanted.
 #
-# Therefore, the technique used to set the $minimal_path variable
-# introduced 20080428T1634Z in commit a762296122e is best for $PATH
-# here as well. Of course, this means that there is no need for a
-# distinct $minimal_path, so it can be removed here and elsewhere.
-#
 # The default non-lmi portion of this $PATH is, as always, debatable;
 # debian's default in '/etc/login.defs' adds silly 'games' directories
 # but omits '/usr/sbin' and '/sbin', for instance. The initial value
 # set in '~/.zshrc' should be made consistent with this.
 
-export PATH="$localbindir":"$locallibdir":/usr/bin:/bin:/usr/sbin:/sbin
+minimal_path="/usr/bin:/bin:/usr/sbin:/sbin"
+export PATH="$localbindir":"$locallibdir":"$minimal_path"
 
 unset -v WINEPATH
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]