aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2018-08-02 09:08:38 -0400
committerMarcoFalke <falke.marco@gmail.com>2018-08-02 09:08:40 -0400
commit9c4324d866db2892b1f99b0415cfa7f9195fc777 (patch)
treec26ccd54bf1206a4fa30edefe53c7b94e1feb19b
parent990e182587999dba33f2a8172cc39d4a20d2e207 (diff)
parent83c48d9a1f15e1531ac7bec0c1440f69ace3ee37 (diff)
downloadbitcoin-9c4324d866db2892b1f99b0415cfa7f9195fc777.tar.xz
Merge #13851: fix locale for lint-shell
83c48d9a1f fix locale for lint-shell (Julian Fleischer) Pull request description: A piece of code from https://github.com/bitcoin/bitcoin/pull/13816 which I am hereby splitting into smaller PRs. The `shellcheck` executable shipped with travis's trusty linux environment (contains shellcheck `0.3.1` in `/usr/local/bin` as opposed to the distros `0.3.3` in `/usr/bin`) segfaults when `LC_ALL=C`. This makes sure that in travis, no matter from where the script is called, `LC_ALL` is left unset. Comment changed accordingly. Tree-SHA512: 86afa9247f2adbeefa75bf3d56a94766f8e8e1839f40b73763ff7b893a09c848ee64648fc06ce3e6bd0f650127365f508b37fdefb48d61e49f5d551c074cb16e
-rwxr-xr-xtest/lint/lint-shell.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/lint/lint-shell.sh b/test/lint/lint-shell.sh
index e2ccdb5165..5e1e136e7d 100755
--- a/test/lint/lint-shell.sh
+++ b/test/lint/lint-shell.sh
@@ -6,9 +6,15 @@
#
# Check for shellcheck warnings in shell scripts.
-# This script is intentionally locale dependent by not setting "export LC_ALL=C"
-# to allow running certain versions of shellcheck that core dump when LC_ALL=C
-# is set.
+export LC_ALL=C
+
+# The shellcheck binary segfault/coredumps in Travis with LC_ALL=C
+# It does not do so in Ubuntu 14.04, 16.04, 18.04 in versions 0.3.3, 0.3.7, 0.4.6
+# respectively. So export LC_ALL=C is set as required by lint-shell-locale.sh
+# but unset here in case of running in Travis.
+if [ "$TRAVIS" = "true" ]; then
+ unset LC_ALL
+fi
# Disabled warnings:
# SC2001: See if you can use ${variable//search/replace} instead.