summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-02-19 10:05:40 +0100
committerErich Eckner <git@eckner.net>2020-02-19 10:05:40 +0100
commita360f504d93623280f9a2e01a04b45833ec20fec (patch)
tree34be5d0437d49917b07096a255853093e5699b69 /bin
parentdd41f5ad7b0ed6ab0356b67a279d60f9d3fb1200 (diff)
downloadbuilder-a360f504d93623280f9a2e01a04b45833ec20fec.tar.xz
bin/build-packages: compress the package in a separate stage - this can even be offloaded to a different machine later
Diffstat (limited to 'bin')
-rwxr-xr-xbin/build-packages14
1 files changed, 12 insertions, 2 deletions
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
{