Page MenuHomePhabricator

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

Authored by Fabien on Wed, Aug 28, 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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
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

Rebase.