[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
- [lmi-commits] [lmi] master updated (b0a3562 -> 6198c3a), Greg Chicares, 2019/05/31
- [lmi-commits] [lmi] master a896830 4/5: Fix defect introduced 20190519T1745Z: incomplete export, Greg Chicares, 2019/05/31
- [lmi-commits] [lmi] master ab38ad6 1/5: Add a 'show_env' makefile target, Greg Chicares, 2019/05/31
- [lmi-commits] [lmi] master 0e30bf7 2/5: Inhibit 'shellcheck' for cygwin, which doesn't provide it, Greg Chicares, 2019/05/31
- [lmi-commits] [lmi] master b44f960 3/5: Generally prefer printf to echo, Greg Chicares, 2019/05/31
- [lmi-commits] [lmi] master 6198c3a 5/5: Don't '. ./name_of_script_that_could_reside_elsewhere',
Greg Chicares <=