summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/build-packages7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/build-packages b/bin/build-packages
index 512c684..eebf8c8 100755
--- a/bin/build-packages
+++ b/bin/build-packages
@@ -682,10 +682,15 @@ while [ "${count}" -ne 0 ] && \
# silently fall back to lower compression levels if the higher
# level fails.
+ # beware: We must remove *.pkg.tar.zst after failed
+ # compression attempts, otherwise future compression attempts
+ # will refuse to overwrite them.
+
# shellcheck disable=SC2086
for options in '-T0 --ultra -20' '--ultra -20' {-19..-3}; do
find . -maxdepth 1 -type f -name '*.pkg.tar' \
- -execdir zstd --rm ${options} '{}' -o '{}.zst' \;
+ -not -execdir zstd --rm ${options} '{}' -o '{}.zst' \; \
+ -exec rm -f '{}.zst' \;
done
# package files, that still exist, threw an error upon compression
errors=$(