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

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