From a360f504d93623280f9a2e01a04b45833ec20fec Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 19 Feb 2020 10:05:40 +0100 Subject: bin/build-packages: compress the package in a separate stage - this can even be offloaded to a different machine later --- bin/build-packages | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/build-packages b/bin/build-packages index 3689fa7..ea9098e 100755 --- a/bin/build-packages +++ b/bin/build-packages @@ -493,6 +493,7 @@ while [ "${count}" -ne 0 ] && \ -o -name '*.pkg.tar.xz.sig' \ -o -name '*.pkg.tar.zst' \ -o -name '*.pkg.tar.zst.sig' \ + -o -name '*.pkg.tar' \ \) \ -exec rm {} \; @@ -629,7 +630,7 @@ while [ "${count}" -ne 0 ] && \ # by piping the log, we don't see anything in the terminal, # but all ways to duplicate the logs seem pretty elaborate # shellcheck disable=SC2024,SC2086 - if ! "${build_command}" ${outerParameters} -- ${middleParameters} -- ${innerParameters} > \ + if ! PKGEXT='.pkg.tar' "${build_command}" ${outerParameters} -- ${middleParameters} -- ${innerParameters} > \ "${log_file}" 2>&1; then success=false build_dir="/var/lib/archbuild/${build_command%-build}/$(whoami)" @@ -660,13 +661,22 @@ while [ "${count}" -ne 0 ] && \ if ${success}; then # build successful + echo 'compressing' > "${tmp_dir}/.ping-build-master" + >&2 printf ' ok, compressing package(s) ...' + # We requested to build uncompressed packages - those will be + # compressed now (which can be offloaded to a different + # machine, if need arises in the future). Note, that it is no + # 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' \; + echo 'post-build' > "${tmp_dir}/.ping-build-master" >&2 printf ' ok.\n' if [ "${build_command}" = 'makepkg' ]; then find . -maxdepth 1 -type f -name '*.pkg.tar.zst' \ -exec sh -c 'namcap "$1" > "$1-namcap.log"' '_' '{}' \; fi tar_content_dir=$(mktemp -d "${tmp_dir}/tar-content.XXXXXX") - echo 'post-build' > "${tmp_dir}/.ping-build-master" # remove unexpected packages if [ -n "${expected_packages}" ]; then { -- cgit v1.2.3-54-g00ecf