Page MenuHomePhabricator

Make sure LC_ALL=C is set in all shell scripts

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


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

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

rABC Bitcoin ABC
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fabien created this revision.Wed, Aug 28, 17:00
Herald added a reviewer: Restricted Project. · View Herald TranscriptWed, Aug 28, 17:00
deadalnix accepted this revision.Wed, Aug 28, 17:39
This revision is now accepted and ready to land.Wed, Aug 28, 17:39
Fabien updated this revision to Diff 11044.Fri, Aug 30, 13:26