mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-11 21:20:39 +02:00
Merge bitcoin/bitcoin#35778: scripted-diff: Use C.UTF-8 locale in all shell scripts
46654094belint: Use C.UTF-8 locale only in shell scripts (Hennadii Stepanov)982ee64938lint: Skip `libmultiprocess` subtree in `lint-shell-locale.py` (Hennadii Stepanov)1194918a5dscripted-diff: Use C.UTF-8 locale in all shell scripts (Hennadii Stepanov) Pull request description: This unifies the used locales across the entire codebase. Additionally, the `test/lint/lint-shell-locale.py` linter has been adjusted accordingly. Also see https://github.com/bitcoin/bitcoin/pull/35775#issuecomment-5047323736. ACKs for top commit: fanquake: ACK46654094beTree-SHA512: e72e076614602937c5fe6ca27d0bb7bebe4464ef28455c43a1bd1d700ffeeea684365fa5749cb1e5fdad56178a1e88a544b5854783b57aef468efb105a03af57
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
# The resulting script should exactly transform the previous commit into the current
|
||||
# one. Any remaining diff signals an error.
|
||||
|
||||
export LC_ALL=C
|
||||
export LC_ALL=C.UTF-8
|
||||
if test -z "$1"; then
|
||||
echo "Usage: $0 <commit>..."
|
||||
exit 1
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
export LC_ALL=C
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
check_remote=0
|
||||
while getopts "?hr" opt; do
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
"""
|
||||
Make sure all shell scripts explicitly opt out of locale dependence using
|
||||
"export LC_ALL=C" or "export LC_ALL=C.UTF-8", which also enables UTF-8 mode in
|
||||
Make sure all shell scripts explicitly opt out of locale dependence
|
||||
using "export LC_ALL=C.UTF-8", which also enables UTF-8 mode in
|
||||
Python. See: https://docs.python.org/3/library/os.html#python-utf-8-mode
|
||||
"""
|
||||
|
||||
@@ -15,7 +15,6 @@ import sys
|
||||
import re
|
||||
|
||||
OPT_OUT_LINES = [
|
||||
'export LC_ALL=C',
|
||||
'export LC_ALL=C.UTF-8',
|
||||
]
|
||||
|
||||
@@ -38,7 +37,7 @@ def main():
|
||||
exit_code = 0
|
||||
shell_files = get_shell_files_list()
|
||||
for file_path in shell_files:
|
||||
if re.search('src/(secp256k1|minisketch)/', file_path):
|
||||
if re.search('src/(ipc/libmultiprocess|secp256k1|minisketch)/', file_path):
|
||||
continue
|
||||
|
||||
with open(file_path, 'r') as file_obj:
|
||||
@@ -51,7 +50,7 @@ def main():
|
||||
|
||||
first_non_comment_line = non_comment_lines[0]
|
||||
if first_non_comment_line not in OPT_OUT_LINES:
|
||||
print(f'Missing "export LC_ALL=C" (to avoid locale dependence) as first non-comment non-empty line in {file_path}')
|
||||
print(f'Missing "export LC_ALL=C.UTF-8" (to avoid locale dependence) as first non-comment non-empty line in {file_path}')
|
||||
exit_code = 1
|
||||
|
||||
return sys.exit(exit_code)
|
||||
|
||||
Reference in New Issue
Block a user