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
This commit is contained in:
commit
9c4324d866
1 changed files with 9 additions and 3 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue