This allows using faster multicore compression tools like pixz Signed-off-by: Maxim Baz <archlinux@maximbaz.com> --- archbuild.in | 2 +- makechrootpkg.in | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/archbuild.in b/archbuild.in index bd5706d..e3d53ec 100644 --- a/archbuild.in +++ b/archbuild.in @@ -39,7 +39,7 @@ while getopts 'hcr:' arg; do esac done -check_root SOURCE_DATE_EPOCH,SRCDEST,SRCPKGDEST,PKGDEST,LOGDEST,MAKEFLAGS,PACKAGER,GNUPGHOME +check_root SOURCE_DATE_EPOCH,SRCDEST,SRCPKGDEST,PKGDEST,LOGDEST,MAKEFLAGS,PACKAGER,GNUPGHOME,COMPRESSGZ,COMPRESSXZ,COMPRESSLRZ,COMPRESSZ,COMPRESSBZ2,COMPRESSLZO # Pass all arguments after -- right to makepkg makechrootpkg_args+=("${@:$OPTIND}") diff --git a/makechrootpkg.in b/makechrootpkg.in index 4b72a36..e4b7ca3 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -29,9 +29,9 @@ usage() { echo 'command:' echo ' mkarchroot <chrootdir>/root base-devel' echo '' - echo 'This script reads {SRC,SRCPKG,PKG,LOG}DEST, MAKEFLAGS and PACKAGER' - echo 'from makepkg.conf(5), if those variables are not part of the' - echo 'environment.' + echo 'This script reads {SRC,SRCPKG,PKG,LOG}DEST, MAKEFLAGS, PACKAGER' + echo 'and COMPRESS{{G,X,LR,}Z,BZ2,LZO} from makepkg.conf(5),' + echo 'if those variables are not part of the environment.' echo '' echo "Default makepkg args: ${default_makepkg_args[*]}" echo '' @@ -63,12 +63,18 @@ usage() { # - LOGDEST # - MAKEFLAGS # - PACKAGER +# - COMPRESSGZ +# - COMPRESSXZ +# - COMPRESSLRZ +# - COMPRESSZ +# - COMPRESSBZ2 +# - COMPRESSLZO load_vars() { local makepkg_conf="$1" var [[ -f $makepkg_conf ]] || return 1 - for var in {SRC,SRCPKG,PKG,LOG}DEST MAKEFLAGS PACKAGER; do + for var in {SRC,SRCPKG,PKG,LOG}DEST MAKEFLAGS PACKAGER COMPRESS{{G,X,LR,}Z,BZ2,LZO}; do [[ -z ${!var:-} ]] && eval "$(grep -a "^${var}=" "$makepkg_conf")" done @@ -185,7 +191,9 @@ prepare_chroot() { sed -e '/^MAKEFLAGS=/d' -e '/^PACKAGER=/d' -i "$copydir/etc/makepkg.conf" for x in BUILDDIR=/build PKGDEST=/pkgdest SRCPKGDEST=/srcpkgdest SRCDEST=/srcdest LOGDEST=/logdest \ - "MAKEFLAGS='${MAKEFLAGS:-}'" "PACKAGER='${PACKAGER:-}'" + "MAKEFLAGS='${MAKEFLAGS:-}'" "PACKAGER='${PACKAGER:-}'" "COMPRESSGZ=(${COMPRESSGZ[*]:-})" \ + "COMPRESSXZ=(${COMPRESSXZ[*]:-})" "COMPRESSLRZ=(${COMPRESSLRZ[*]:-})" "COMPRESSZ=(${COMPRESSZ[*]:-})" \ + "COMPRESSBZ2=(${COMPRESSBZ2[*]:-})" "COMPRESSLZO=(${COMPRESSLZO[*]:-})" do grep -q "^$x" "$copydir/etc/makepkg.conf" && continue echo "$x" >>"$copydir/etc/makepkg.conf" -- 2.21.0