Skip to content

Commit 9c4324d

Browse files
author
MarcoFalke
committed
Merge #13851: fix locale for lint-shell
83c48d9 fix locale for lint-shell (Julian Fleischer) Pull request description: A piece of code from bitcoin/bitcoin#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
2 parents 990e182 + 83c48d9 commit 9c4324d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

test/lint/lint-shell.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@
66
#
77
# Check for shellcheck warnings in shell scripts.
88

9-
# This script is intentionally locale dependent by not setting "export LC_ALL=C"
10-
# to allow running certain versions of shellcheck that core dump when LC_ALL=C
11-
# is set.
9+
export LC_ALL=C
10+
11+
# The shellcheck binary segfault/coredumps in Travis with LC_ALL=C
12+
# It does not do so in Ubuntu 14.04, 16.04, 18.04 in versions 0.3.3, 0.3.7, 0.4.6
13+
# respectively. So export LC_ALL=C is set as required by lint-shell-locale.sh
14+
# but unset here in case of running in Travis.
15+
if [ "$TRAVIS" = "true" ]; then
16+
unset LC_ALL
17+
fi
1218

1319
# Disabled warnings:
1420
# SC2001: See if you can use ${variable//search/replace} instead.

0 commit comments

Comments
 (0)