Page MenuHomePhabricator

Make sure LC_ALL=C is set in all shell scripts
ClosedPublic

Authored by Fabien on Aug 28 2019, 17:00.

Details

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.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
PR13454
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 7290
Build 12625: Bitcoin ABC Buildbot (legacy)
Build 12624: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Aug 28 2019, 17:39