HomePhabricator

Make sure LC_ALL=C is set in all shell scripts

Description

Make sure LC_ALL=C is set in all shell scripts

Summary:

From the grep(1) documentation:

    Within a bracket expression, a range expression consists of two
characters separated by a hyphen. It matches any single character that
sorts between the two characters, inclusive, using the locale's
collating sequence and character set. For example, in the default C
locale, [a-d] is equivalent to [abcd]. Many locales sort characters in
dictionary order, and in these locales [a-d] is typically not equivalent
to [abcd]; it might be equivalent to [aBbCcDd], for example. To obtain
the traditional interpretation of bracket expressions, you can use the C
locale by setting the LC_ALL environment variable to the value C.

Backport of core PR13454
https://github.com/bitcoin/bitcoin/pull/13454/files

Test Plan:
Should return no error:

arc lint --everything

Edit a script to remove the export LC_ALL=C statement.

arc lint

Check the linter catches the error.

Edit a script to make the export LC_ALL=C statement being the seconf
statement by adding a line above: echo "Fail the linter".

arc lint

Check the linter catches the error.

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D3964

Details

Provenance
practicalswift <practicalswift@users.noreply.github.com>Authored on Jun 13 2018, 14:50
FabienCommitted on Aug 30 2019, 13:49
FabienPushed on Aug 30 2019, 16:33
Reviewer
Restricted Project
Differential Revision
D3964: Make sure LC_ALL=C is set in all shell scripts
Parents
rSTAGING1cf3629759b9: Fix deprecated copy warnings in amount.h
Branches
Unknown
Tags
Unknown
References
tag: phabricator/base/11050, tag: phabricator/base/11047