Ensure stable sorting order in tools

This eliminates certain surprises with port contents and depot hashes.
This commit is contained in:
Christian Helmuth 2017-11-03 16:52:12 +01:00
parent 0f6afa3d89
commit 65b2e63bb9
4 changed files with 9 additions and 1 deletions

View File

@ -56,6 +56,9 @@ export LIB_DEP_FILE ?= var/libdeps
export ECHO ?= echo -e
export CONTRIB_DIR
# Force stable sorting order
export LC_COLLATE=C
#
# Convert user-defined directories to absolute directories
#

View File

@ -30,3 +30,6 @@ EMPTY :=
# is not empty.
#
file_content = $(if $(wildcard $1),$(shell cat $1),)
# Force stable sorting order
export LC_COLLATE=C

View File

@ -198,7 +198,7 @@ _check_hash: $(DEPOT_ARCHIVE_DIR).hash checked_recipe_hash_value_exists
# would otherwise prompt 'cat' to block for standard input.
#
HASH_CMD := cd $(DEPOT_ARCHIVE_DIR); \
echo | cat `find . -type f | LC_COLLATE=C sort` | $(HASHSUM) | sed "s/ .*//" \
echo | cat `find . -type f | sort` | $(HASHSUM) | sed "s/ .*//" \
#
# Generate the hash from the archive content

View File

@ -23,3 +23,5 @@ MSG_GENERATE := $(MSG_PREFIX)"generate "
MSG_EXTRACT := $(MSG_PREFIX)"extract "
MSG_GIT := $(MSG_PREFIX_TXT)git
# Force stable sorting order
export LC_COLLATE=C