From fa17bbf63438645741e5fe19b862d1012ff7089a Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 29 Jun 2020 10:22:07 +0200 Subject: bin/build-packages: exit early, if compressing the package fails --- bin/build-packages | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'bin/build-packages') diff --git a/bin/build-packages b/bin/build-packages index d03600e..46c1ef1 100755 --- a/bin/build-packages +++ b/bin/build-packages @@ -678,7 +678,23 @@ while [ "${count}" -ne 0 ] && \ # error, if the above build command already produced a # compressed package. find . -maxdepth 1 -type f -name '*.pkg.tar' \ - -execdir zstd -T0 --ultra -20 '{}' -o '{}.zst' \; + -execdir zstd --rm -T0 --ultra -20 '{}' -o '{}.zst' \; + # package files, that still exist, threw an error upon compression + errors=$( + find . -maxdepth 1 -type f -name '*.pkg.tar' + ) + if [ -n "${errors}" ]; then + success=false + { + printf 'Building (and packaging) was successfull, but compressing the following packages failed:\n' + printf '%s\n' "${errors}" + } \ + | tee -a "${log_file}" + fi + fi + + if ${success}; then + # compressing successful echo 'post-build' > "${tmp_dir}/.ping-build-master" >&2 printf ' ok.\n' if [ "${build_command}" = 'makepkg' ]; then -- cgit v1.2.3-70-g09d2