mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-18 13:26:27 +00:00
tool: use local LC_ALL=C instead of LC_COLLATE=C
We used to export 'LC_COLLATE=C' for the environment of Genode tools. This was meant to ensure that sorting is always done C-style and not dependent on the users locale settings. This is required, for instance, to ensure that the same archive always yields the same hash. However, 'export LC_COLLATE=C' is not sufficient. It can be outruled by an 'LC_ALL' setting in the users environment. The manual of 'sort' recommends to set 'LC_ALL=C' locally if you want reliable results and this is what this commit does. Furthermore it removes the former 'export LC_COLLATE=C' directives. Note that I couldn't find a way to set 'LC_ALL' local to 'exec ... sort' in TCL. This is why I set it global instead using TCLs 'env' array. Note that the Make directive '$(sort ...)' and the TCL directive 'lsort', unlike the Shell directive 'sort', are not affected by the users locale settings. Fixes #4144
This commit is contained in:
parent
1c20ed12c1
commit
139a2cfae9
@ -11,7 +11,7 @@
|
||||
#
|
||||
|
||||
# normalize sort order across platforms
|
||||
set env(LC_COLLATE) C
|
||||
set env(LC_ALL) C
|
||||
|
||||
# obtain symbol information via 'nm'
|
||||
set symbols [exec nm --format posix --dynamic $argv | sort]
|
||||
|
@ -67,9 +67,6 @@ export ECHO ?= echo -e
|
||||
export CONTRIB_DIR
|
||||
export BOARD
|
||||
|
||||
# Force stable sorting order
|
||||
export LC_COLLATE=C
|
||||
|
||||
#
|
||||
# Convert user-defined directories to absolute directories
|
||||
#
|
||||
|
@ -12,7 +12,7 @@
|
||||
#
|
||||
|
||||
# normalize sort order across platforms
|
||||
set env(LC_COLLATE) C
|
||||
set env(LC_ALL) C
|
||||
|
||||
set lib_path [lindex $argv 0]
|
||||
set abi_path [lindex $argv 1]
|
||||
|
@ -32,4 +32,4 @@ EMPTY :=
|
||||
file_content = $(if $(wildcard $1),$(shell cat $1),)
|
||||
|
||||
# Force stable sorting order
|
||||
export LC_COLLATE=C
|
||||
SORT := LC_ALL=C sort
|
||||
|
@ -214,8 +214,8 @@ _check_hash: $(DEPOT_ARCHIVE_DIR).hash checked_recipe_hash_value_exists
|
||||
# command).
|
||||
#
|
||||
HASH_CMD := cd $(DEPOT_ARCHIVE_DIR); \
|
||||
(find . -type f | sort; \
|
||||
find . -type f | sort | xargs -d '\n' cat) \
|
||||
(find . -type f | $(SORT); \
|
||||
find . -type f | $(SORT) | xargs -d '\n' cat) \
|
||||
| $(HASHSUM) | sed "s/ .*//"
|
||||
|
||||
#
|
||||
|
@ -34,7 +34,7 @@ endif
|
||||
#
|
||||
# \param $1 absolute file path
|
||||
#
|
||||
sorted_file_content = $(if $(wildcard $1),$(shell cat $1 | sort -u),\
|
||||
sorted_file_content = $(if $(wildcard $1),$(shell cat $1 | $(SORT) -u),\
|
||||
$(error Failed to read file $1))
|
||||
|
||||
#
|
||||
|
@ -28,9 +28,6 @@ MSG_GENERATE := $(MSG_PREFIX)"generate "
|
||||
MSG_EXTRACT := $(MSG_PREFIX)"extract "
|
||||
MSG_GIT := $(MSG_PREFIX_TXT)git
|
||||
|
||||
# Force stable sorting order
|
||||
export LC_COLLATE=C
|
||||
|
||||
#
|
||||
# Utility to check if a tool is installed
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user