From b5191ea140386dd9b73e4509ffa9a6d347c1b5fa Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Tue, 21 Aug 2018 10:15:12 -0400 Subject: makepkg: use builtin globbing to print files in package - it comes with free collation when moving the LC_ALL declaration up a bit; this fixes a bug where the .FILES were not being properly sorted and their order depended on directory creation order, which broke reproducible builds in the wild. - it handles sorting null-delimited output everywhere, without sort -z; this lets us get rid of sed hacks - it is faster than invoking multiple find subprocesses - dotfiles can be automatically printed *and the C locale sorts them first* with a single ** glob Signed-off-by: Eli Schwartz Signed-off-by: Allan McRae --- scripts/makepkg.sh.in | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'scripts/makepkg.sh.in') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 25a8fc26..33f5deb4 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -708,8 +708,11 @@ write_buildinfo() { # database files are placed at the beginning of the package regardless of # sorting list_package_files() { - (find . -path './.*' \! -name '.'; find . \! -path './.*' \! -name '.' | LC_ALL=C sort) | - sed -e 's|^\./||' | tr '\n' '\0' + ( + export LC_COLLATE=C + shopt -s dotglob globstar + printf '%s\0' ** + ) } create_package() { -- cgit v1.2.3-54-g00ecf