Merge bitcoin/bitcoin#35778: scripted-diff: Use C.UTF-8 locale in all shell scripts

46654094be lint: Use C.UTF-8 locale only in shell scripts (Hennadii Stepanov)
982ee64938 lint: Skip `libmultiprocess` subtree in `lint-shell-locale.py` (Hennadii Stepanov)
1194918a5d scripted-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:
    ACK 46654094be

Tree-SHA512: e72e076614602937c5fe6ca27d0bb7bebe4464ef28455c43a1bd1d700ffeeea684365fa5749cb1e5fdad56178a1e88a544b5854783b57aef468efb105a03af57
This commit is contained in:
merge-script
2026-09-09 12:02:03 +01:00
13 changed files with 16 additions and 17 deletions

View File

@@ -4,7 +4,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
set -o errexit -o pipefail -o xtrace

View File

@@ -4,7 +4,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
set -o errexit -o pipefail -o xtrace

View File

@@ -3,7 +3,7 @@
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://opensource.org/license/mit/.
export LC_ALL=C
export LC_ALL=C.UTF-8
if [ -n "$SOURCE_DATE_EPOCH" ]; then
find . -exec touch -d "@$SOURCE_DATE_EPOCH" {} +

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
export LC_ALL=C
export LC_ALL=C.UTF-8
set -Eeuo pipefail
# Declare paths to libraries

View File

@@ -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
TOPDIR=${TOPDIR:-$(git rev-parse --show-toplevel)}
BUILDDIR=${BUILDDIR:-$TOPDIR/build}
BINDIR=${BINDIR:-$BUILDDIR/bin}

View File

@@ -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
set -e
SIGNAPPLE=signapple

View File

@@ -4,7 +4,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
#network interface on which to limit traffic
IF="eth0"
#limit of the network interface in question

View File

@@ -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
INPUT=$(cat /dev/stdin)
if [ "$BITCOIN_VERIFY_COMMITS_ALLOW_SHA1" = 1 ]; then
printf '%s\n' "$INPUT" | gpg --trust-model always "$@" 2>/dev/null

View File

@@ -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
if [ -z "$OSSLSIGNCODE" ]; then
OSSLSIGNCODE=osslsigncode
fi

View File

@@ -4,7 +4,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
FRAMEDIR=$(dirname "$0")
for i in {0..35}
do

View File

@@ -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

View File

@@ -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

View File

@@ -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)