lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 0bbe38b 2/3: Improve concinnity


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 0bbe38b 2/3: Improve concinnity
Date: Sun, 18 Oct 2020 06:24:30 -0400 (EDT)

branch: master
commit 0bbe38b2db1df162ac8393bd079dae09c76c6a2f
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Improve concinnity
    
    In each script that
     - is intended to be run at the command line, and
     - sources 'set_toolchain.sh', and
     - does not already cd to $srcdir,
    ascertain $srcdir and source '"$srcdir"/set_toolchain.sh'
    rather than assume that [ "$PWD" = "$srcdir" ] .
    
    Changed the only script that didn't already fulfill that invariant. See:
      https://lists.nongnu.org/archive/html/lmi/2020-10/msg00091.html
---
 transume_toolchain.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/transume_toolchain.sh b/transume_toolchain.sh
index 672bda1..e038ea8 100755
--- a/transume_toolchain.sh
+++ b/transume_toolchain.sh
@@ -23,7 +23,12 @@
 
 # See 'GNUmakefile' for suggested use.
 
-. ./set_toolchain.sh
+# Directory where this script resides.
+
+srcdir=$(dirname "$(readlink --canonicalize "$0")")
+
+# shellcheck disable=SC1090
+. "$srcdir"/set_toolchain.sh
 
 printf '%s\n' "export LMI_COMPILER := $LMI_COMPILER"
 printf '%s\n' "export LMI_TRIPLET  := $LMI_TRIPLET"



reply via email to

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