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:
MarcoFalke 2018-08-02 09:08:38 -04:00
commit 9c4324d866
No known key found for this signature in database
GPG key ID: D2EA4850E7528B25

View file

@ -6,9 +6,15 @@
# #
# Check for shellcheck warnings in shell scripts. # Check for shellcheck warnings in shell scripts.
# This script is intentionally locale dependent by not setting "export LC_ALL=C" export LC_ALL=C
# to allow running certain versions of shellcheck that core dump when LC_ALL=C
# is set. # 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: # Disabled warnings:
# SC2001: See if you can use ${variable//search/replace} instead. # SC2001: See if you can use ${variable//search/replace} instead.