lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 6198c3a 5/5: Don't '. ./name_of_script_that_c


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 6198c3a 5/5: Don't '. ./name_of_script_that_could_reside_elsewhere'
Date: Fri, 31 May 2019 19:23:50 -0400 (EDT)

branch: master
commit 6198c3ad6cfc7627e080766ce5e3a82a85dcb679
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Don't '. ./name_of_script_that_could_reside_elsewhere'
    
    This:
      touch /a/b/script.sh
      chmod +x /a/b/script.sh
      cd /x/y/z
      . ./script.sh
    won't source the remote script, but this:
      . /a/b/script.sh
    will.
---
 gui_test.sh          | 7 ++++++-
 nychthemeral_test.sh | 7 ++++++-
 set_toolchain.sh     | 6 +++---
 3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/gui_test.sh b/gui_test.sh
index 97fdc62..e059fb9 100755
--- a/gui_test.sh
+++ b/gui_test.sh
@@ -36,7 +36,12 @@ set -e
 # provides no convenient alternative):
 setopt PIPE_FAIL
 
-. ./set_toolchain.sh
+# Directory where this script resides.
+
+srcdir=$(dirname "$(readlink --canonicalize "$0")")
+
+# shellcheck disable=SC1090
+. "$srcdir"/set_toolchain.sh
 
 # Lines beginning with a capitalized word, viz.
 #   /^NOTE: starting the test suite$/d
diff --git a/nychthemeral_test.sh b/nychthemeral_test.sh
index d2046c8..e0e19e8 100755
--- a/nychthemeral_test.sh
+++ b/nychthemeral_test.sh
@@ -36,7 +36,12 @@ set -e
 # provides no convenient alternative):
 setopt PIPE_FAIL
 
-. ./set_toolchain.sh
+# Directory where this script resides.
+
+srcdir=$(dirname "$(readlink --canonicalize "$0")")
+
+# shellcheck disable=SC1090
+. "$srcdir"/set_toolchain.sh
 
 coefficiency=${coefficiency:-"--jobs=$(nproc)"}
 
diff --git a/set_toolchain.sh b/set_toolchain.sh
index e3245a1..379ff14 100755
--- a/set_toolchain.sh
+++ b/set_toolchain.sh
@@ -21,14 +21,14 @@
 # email: <address@hidden>
 # snail: Chicares, 186 Belle Woods Drive, Glastonbury CT 06033, USA
 
-# Invoke as ". ./set_toolchain.sh" without the quotes.
+# Invoke as ". /opt/lmi/src/lmi/set_toolchain.sh" without the quotes.
 #
 # $LMI_COMPILER and $LMI_TRIPLET are set to default values currently
 # used in production if they were unset or null beforehand. They can
 # be overridden at the command line, e.g.:
 #
-#   LMI_COMPILER=gcc ; LMI_TRIPLET=i686-w64-mingw32 ; . ./set_toolchain.sh
-#   LMI_COMPILER=gcc ; LMI_TRIPLET=x86_64-w64-mingw32 ; . ./set_toolchain.sh
+#   LMI_COMPILER=gcc ; LMI_TRIPLET=i686-w64-mingw32   ; . 
/opt/lmi/src/lmi/set_toolchain.sh
+#   LMI_COMPILER=gcc ; LMI_TRIPLET=x86_64-w64-mingw32 ; . 
/opt/lmi/src/lmi/set_toolchain.sh
 #
 # Implemented as a function that runs and then erases itself, so that
 # sourcing this script changes the environment only as intended. This



reply via email to

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