abuild-sign: use pigz if available

This is similar to what we do in abuild. It improves performance on
multicore machines.
This commit is contained in:
Natanael Copa 2019-11-07 13:21:45 +00:00
parent 5b34b696d4
commit b80a27b86a
1 changed files with 3 additions and 1 deletions

View File

@ -15,6 +15,8 @@ if ! [ -f "$sharedir/functions.sh" ]; then
fi
. "$sharedir/functions.sh"
gzip=$(command -v pigz || echo gzip)
do_sign() {
local f i keyname repo
local openssl=$(command -v openssl || echo libressl)
@ -37,7 +39,7 @@ do_sign() {
fi
tmptargz=$(mktemp)
tar -f - -c "$sig" | abuild-tar --cut | gzip -9 > "$tmptargz"
tar -f - -c "$sig" | abuild-tar --cut | $gzip -9 > "$tmptargz"
tmpsigned=$(mktemp)
cat "$tmptargz" "$i" > "$tmpsigned"
rm -f "$tmptargz" "$sig"