From e18ea6c821881618d89c7309894e8d286d92ad95 Mon Sep 17 00:00:00 2001 From: Benoit Pierre Date: Sun, 26 Oct 2025 15:51:45 +0100 Subject: [PATCH] tools/mkrelease: don't include directories themselves They are no case of empty directory we would need to keep. --- tools/mkrelease.sh | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/tools/mkrelease.sh b/tools/mkrelease.sh index bdb078980..ed5e29967 100755 --- a/tools/mkrelease.sh +++ b/tools/mkrelease.sh @@ -15,14 +15,12 @@ OPTIONS: -o OPTS, --options OPTS forward options to compressor " +# Note: we ignore directories (entries with no CRC). # shellcheck disable=SC2016 declare -r AWK_HELPERS=' function print_entry(path, size, crc) { - sub("/$", "", path) if (crc != "") print path, size, crc - else - print path"/" } function reverse_entry() { $0 = $3" "$2" "$1; @@ -200,13 +198,9 @@ fi # Don't forget the archive's internal manifest, if requested. if [[ -n "${manifest}" ]]; then - manifest_path=("${manifest}") - while [[ "${manifest_path[0]}" = */*[^/] ]]; do - manifest_path=("${manifest_path[0]%/*}/" "${manifest_path[@]}") - done { cat "${tmpdir}/paths" - printf '%s\n' "${manifest_path[@]}" + printf '%s\n' "${manifest}" } | sort -u -o "${tmpdir}/paths_with_manifest" install --mode=0644 -D "${tmpdir}/paths_with_manifest" "${tmpdir}/contents/${manifest}" if [[ -n "${manifest_transform}" ]]; then @@ -261,7 +255,6 @@ fi # Make a copy of everything so we can later patch timestamps and # fix permissions to ensure reproducibility. -# Note: We want to keep "empty" (with ignored files) directories. "${TAR}" --create --dereference --hard-dereference --no-recursion \ --verbatim-files-from --files-from="${tmpdir}/paths" | "${TAR}" --extract --directory="${tmpdir}/contents"