lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] odd/multiarch 9a04659 2/3: Establish a global $MINIM


From: Greg Chicares
Subject: [lmi-commits] [lmi] odd/multiarch 9a04659 2/3: Establish a global $MINIMAL_PATH
Date: Thu, 18 Apr 2019 12:19:28 -0400 (EDT)

branch: odd/multiarch
commit 9a04659ce805d090c1c4d67143ea996dda59f738
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     | 19 +++++++++++--------
 install_msw.sh |  7 +++----
 set_arch.sh    |  9 ++++-----
 3 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/gwc/.zshrc b/gwc/.zshrc
index 5353168..34cecf1 100644
--- a/gwc/.zshrc
+++ b/gwc/.zshrc
@@ -1,14 +1,17 @@
 # Personal configuration for cross-building in a chroot.
 
-# Remove this:
-export WINEPATH='Z:\\opt\\lmi\\local\\bin;Z:\\opt\\lmi\\local\\lib'
-# This is probably unnecessary:
-# export LMI_BUILD
-#        LMI_BUILD=$(/usr/share/libtool/build-aux/config.guess)
 export LMI_HOST=i686-w64-mingw32
-# Remove 'local' parts:
-export PATH="/opt/lmi/local/bin:/opt/lmi/local/lib:$PATH"
-# and perhaps source 'set_arch.sh' instead.
+
+# To work with lmi, it is important to source 'set_arch.sh'. It's
+# deliberately not sourced here, so that it can assume that some
+# things have already been set up: for instance, it assumes that
+#   /usr/share/libtool/build-aux/config.guess
+# is present, which need not be the case in a brand-new chroot.
+
+# Minimal system path.
+export MINIMAL_PATH="/usr/bin:/bin:/usr/sbin:/sbin"
+export PATH="$MINIMAL_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 b9b82e6..f5ded01 100755
--- a/install_msw.sh
+++ b/install_msw.sh
@@ -35,10 +35,9 @@ stamp0=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
 echo "Started: $stamp0"
 
 # This should work with a rather minimal path.
-# 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
+
+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).
diff --git a/set_arch.sh b/set_arch.sh
index decfcca..1a8b9ec 100755
--- a/set_arch.sh
+++ b/set_arch.sh
@@ -62,17 +62,16 @@ local extrabindir=/opt/lmi/third_party/bin
 #
 # 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.
+# but omits '/usr/sbin' and '/sbin', for instance.
 
-minimal_path="/usr/bin:/bin:/usr/sbin:/sbin"
+minimal_path=${MINIMAL_PATH:-"/usr/bin:/bin:/usr/sbin:/sbin"}
 export PATH="$localbindir":"$locallibdir":"$minimal_path"
 
 unset -v WINEPATH
 
-# double quotes inside double quotes inside $()--wrong? IOW:
+# Are double quotes inside double quotes inside $() dubious? I.e.,
 #  " $( "is this string quoted?" ) "
-# answer: yes, it's quoted: everything inside '$()' is parsed separately
+# Answer: yes, it is: everything inside '$()' is parsed separately.
 #   
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_03
 # [2.3/5] "The characters found from the beginning of the
 # substitution to its end, allowing for any recursion necessary



reply via email to

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