Skip to content

Commit

Permalink
make-srpm.sh: use the pxz compressor if available
Browse files Browse the repository at this point in the history
... to speed up creation of .tar.xz on a multicore machine.  After the
recent extension of the test-suite, compression of the distribution
tarball started to take too much time.  This change makes it reasonably
fast again in my development environment.

Closes: #175
  • Loading branch information
kdudka committed May 21, 2024
1 parent a8f67f1 commit 43ae09a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion make-srpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,13 @@ if [[ "$1" != "--generate-spec" ]]; then
git archive --prefix="$NV/" --format="tar" HEAD -- . > "$SRC_TAR" \
|| die "failed to export sources"

xz -c "$SRC_TAR" > "$SRC" || die "failed to compress sources"
# use pxz (threaded xz) if available to speed up the compression
if pxz --version | grep '^Parallel PXZ' > /dev/null; then
XZ=pxz
else
XZ=xz
fi
$XZ -c "$SRC_TAR" > "$SRC" || die "failed to compress sources with ${XZ}"
fi

SPEC="./$PKG.spec"
Expand Down

0 comments on commit 43ae09a

Please sign in to comment.