[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] odd/multiarch 3cad4c9 3/6: Write 'export var="value"
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] odd/multiarch 3cad4c9 3/6: Write 'export var="value"' on a single line |
Date: |
Sun, 7 Apr 2019 10:48:33 -0400 (EDT) |
branch: odd/multiarch
commit 3cad4c9eefebe08488609365d0db4b42eed59d55
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Write 'export var="value"' on a single line
POSIX requires that 'export var="value"' work as intended:
https://pubs.opengroup.org/onlinepubs/009604499/utilities/export.html
and shellcheck doesn't complain, if RHS of assignment is a literal:
https://github.com/koalaman/shellcheck/wiki/SC2155
---
install_msw.sh | 32 +++++++-------------------------
nychthemeral_test.sh | 9 +++------
2 files changed, 10 insertions(+), 31 deletions(-)
diff --git a/install_msw.sh b/install_msw.sh
index d1cd5c1..b4da6f3 100755
--- a/install_msw.sh
+++ b/install_msw.sh
@@ -39,30 +39,17 @@ echo "Started: $stamp0"
# '--output-sync=recurse' is also used, passim, to facilitate log
# comparison.
#
-# Here and elsewhere: assign variable on one line, export it on another?
-# Is that just an affectation that's no longer relevant?
-# POSIX requires that 'export foo=bar' work as intended:
-# https://pubs.opengroup.org/onlinepubs/009604499/utilities/export.html
-# shellcheck doesn't complain if RHS of assignment is a literal:
-# https://github.com/koalaman/shellcheck/wiki/SC2155
if [ -z "$coefficiency" ]
then
- coefficiency='--jobs=4'
- export coefficiency
+ export coefficiency='--jobs=4'
fi
-# Original version had 'export' here, before 'case'. Apparently the order
-# doesn't matter--POSIX is not entirely clear:
-# https://pubs.opengroup.org/onlinepubs/009604499/utilities/export.html
-# although zsh is (but this is a 'sh' script):
-# http://zsh.sourceforge.net/Doc/Release/Shell-Builtin-Commands.html
-# "If a parameter specified does not already exist, it is created in the
global scope."
+export platform
case $(uname) in
CYGWIN*)
platform=CYGWIN
;;
esac
-export platform
if [ "CYGWIN" = "$platform" ]
then
@@ -119,8 +106,7 @@ then
# https://cygwin.com/ml/cygwin/2012-03/threads.html#00005
# Cf.:
# https://lists.nongnu.org/archive/html/lmi/2016-01/msg00092.html
- CYGCHECK=$(cygpath --mixed /usr/bin/cygcheck)
- export CYGCHECK
+ export CYGCHECK=$(cygpath --mixed /usr/bin/cygcheck)
cmd /c "$CYGCHECK" -s -v -r | tr --delete '\r'
# 'core.fileMode' rationale:
@@ -196,8 +182,7 @@ rm --force --recursive scratch
# building with different '--host' settings (but for now $LMI_HOST
# is also used to determine whether 'wine' is used, which is wrong
# because that should properly depend on the '--build' system).
-LMI_HOST=${LMI_HOST:-"i686-w64-mingw32"}
-export LMI_HOST
+export LMI_HOST=${LMI_HOST:-"i686-w64-mingw32"}
if [ "CYGWIN" = "$platform" ]
then
@@ -235,10 +220,8 @@ export
minimal_path=/opt/lmi/local/bin:/opt/lmi/local/lib:/usr/bin:/bin:/usr/sbi
#localbindir="$exec_prefix"/local/bin
#locallibdir="$exec_prefix"/local/lib
#
-# PATH="$localbindir":"$locallibdir":"$PATH"
-#minimal_path="$localbindir":"$locallibdir":/usr/bin:/bin:/usr/sbin:/sbin
-#export PATH
-#export minimal_path
+#export PATH="$localbindir":"$locallibdir":"$PATH"
+#export
minimal_path="$localbindir":"$locallibdir":/usr/bin:/bin:/usr/sbin:/sbin
# USE SYMLINKS INSTEAD
# condition should be cross compilation, not !cygwin
@@ -251,8 +234,7 @@ export
minimal_path=/opt/lmi/local/bin:/opt/lmi/local/lib:/usr/bin:/bin:/usr/sbi
# w0="$(winepath -w "$localbindir" | sed -e's/\\/\\\\/g')"
# w1="$(winepath -w "$locallibdir" | sed -e's/\\/\\\\/g')"
# w2="$(winepath -w "$extrabindir" | sed -e's/\\/\\\\/g')"
-# WINEPATH="$w0;$w1:$w2"
-# export WINEPATH
+# export WINEPATH="$w0;$w1:$w2"
#fi
make $coefficiency --output-sync=recurse PATH=$minimal_path wx_config_check
diff --git a/nychthemeral_test.sh b/nychthemeral_test.sh
index 0090239..b68031c 100755
--- a/nychthemeral_test.sh
+++ b/nychthemeral_test.sh
@@ -48,10 +48,8 @@ exec_prefix=/opt/lmi/"$LMI_HOST"
localbindir="$exec_prefix"/local/bin
locallibdir="$exec_prefix"/local/lib
- PATH="$localbindir":"$locallibdir":"$PATH"
-minimal_path="$localbindir":"$locallibdir":/usr/bin:/bin:/usr/sbin:/sbin
-export PATH
-export minimal_path
+export PATH="$localbindir":"$locallibdir":"$PATH"
+export minimal_path="$localbindir":"$locallibdir":/usr/bin:/bin:/usr/sbin:/sbin
# condition should be cross compilation, not !cygwin
# double quotes inside double quotes--wrong?
@@ -61,8 +59,7 @@ then
w0="$(winepath -w "$localbindir" | sed -e's/\\/\\\\/g')"
w1="$(winepath -w "$locallibdir" | sed -e's/\\/\\\\/g')"
w2="$(winepath -w "$extrabindir" | sed -e's/\\/\\\\/g')"
- WINEPATH="$w0;$w1:$w2"
- export WINEPATH
+ export WINEPATH="$w0;$w1:$w2"
fi
# --- DISTRESSINGLY COPIED BLOCK
SUPPRESSED
- [lmi-commits] [lmi] odd/multiarch updated (e06e543 -> 3e4dbdf), Greg Chicares, 2019/04/07
- [lmi-commits] [lmi] odd/multiarch 3cad4c9 3/6: Write 'export var="value"' on a single line,
Greg Chicares <=
- [lmi-commits] [lmi] odd/multiarch 81bb4e6 2/6: Assume makefiles use a POSIX-compatible shell, Greg Chicares, 2019/04/07
- [lmi-commits] [lmi] odd/multiarch 3551a75 1/6: Make $(build_directory) an immediately-expanded variable again, Greg Chicares, 2019/04/07
- [lmi-commits] [lmi] odd/multiarch b94771d 4/6: Distinguish build from host architecture, Greg Chicares, 2019/04/07
- [lmi-commits] [lmi] odd/multiarch 3e4dbdf 6/6: Change a makefile variable's name to improve concinnity, Greg Chicares, 2019/04/07
- [lmi-commits] [lmi] odd/multiarch f800e93 5/6: Refine directory structure, Greg Chicares, 2019/04/07