From 10ec52b36c2cee277cac1c2cb84ca8bd66a9942e Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 24 Feb 2021 18:34:12 +0100 Subject: bin/build-packages: remove left-over *.pkg.tar.zst if compression failed --- bin/build-packages | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'bin') 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=$( -- cgit v1.2.3-70-g09d2