aports/main/abuild/add-multithreaded-compression.patch
2018-11-08 10:45:48 +00:00

34 lines
1.1 KiB
Diff

From 21b62c7675dc63d01b84eb7127227033389f35ae Mon Sep 17 00:00:00 2001
From: Tiago Ilieve <tiago.myhro@gmail.com>
Date: Sun, 28 Oct 2018 12:34:02 +0000
Subject: [PATCH] abuild.in: add multithreaded compression
The 'Compressing data' step takes a significant amount of time when
packaging software with huge binaries, like Kubernetes. This can
certainly be shortened using multithreaded compression, like 'pigz'.
---
abuild.in | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/abuild.in b/abuild.in
index 42382e5..ec57104 100644
--- a/abuild.in
+++ b/abuild.in
@@ -1451,6 +1451,7 @@ human_size() {
create_apks() {
local file= dir= name= ver= apk= datadir= size=
+ local gzip=$(command -v pigz || echo gzip)
getpkgver || return 1
if ! options_has "!tracedeps"; then
for file in "$pkgbasedir"/.control.*/.PKGINFO; do
@@ -1487,7 +1488,7 @@ create_apks() {
touch .dummy
set -- .dummy
fi
- tar --xattrs -f - -c "$@" | abuild-tar --hash | gzip -9 >"$dir"/data.tar.gz
+ tar --xattrs -f - -c "$@" | abuild-tar --hash | $gzip -9 >"$dir"/data.tar.gz
msg "Create checksum..."
# append the hash for data.tar.gz