>=app-arch/xz-utils-5.4.0 supports lzip decompression (not compression).
Add support for unpacker.eclass to handle it for .lz files. Note that xz-utils is part of @system (and PMS requires that .xz is unpackable), while most users do not have lzip and friends installed. (Note that xz does not (currently, but does not plan on either) implement parallel decompression for .lz, but most .lz distfiles are small, so this isn't an issue.) Historically, we've often repacked .lz distfiles for important packages to avoid users needing to install app-arch/lzip for a single distfile, so this avoids the need for that (although I've not done it out of principle for things like sys-apps/ed). Bug: https://bugs.gentoo.org/249059 Bug: https://bugs.gentoo.org/485462 Bug: https://bugs.gentoo.org/501912 Bug: https://bugs.gentoo.org/502990 Bug: https://bugs.gentoo.org/545344 Signed-off-by: Sam James <s...@gentoo.org> --- eclass/unpacker.eclass | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/eclass/unpacker.eclass b/eclass/unpacker.eclass index 3d8bf7a8452d0..11f04fde72260 100644 --- a/eclass/unpacker.eclass +++ b/eclass/unpacker.eclass @@ -30,7 +30,7 @@ inherit multiprocessing toolchain-funcs # @DEFAULT_UNSET # @DESCRIPTION: # Utility to use to decompress bzip2 files. Will dynamically pick between -# `lbzip2`, `pbzip2` and `bzip2`. Make sure your choice accepts the "-dc" +# `lbzip2`, `pbzip2`, and `bzip2`. Make sure your choice accepts the "-dc" # options. # Note: this is meant for users to set, not ebuilds. @@ -39,7 +39,7 @@ inherit multiprocessing toolchain-funcs # @DEFAULT_UNSET # @DESCRIPTION: # Utility to use to decompress lzip files. Will dynamically pick between -# `plzip`, `pdlzip` and `lzip`. Make sure your choice accepts the "-dc" options. +# `xz`, `plzip`, `pdlzip`, and `lzip`. Make sure your choice accepts the "-dc" options. # Note: this is meant for users to set, not ebuilds. # for internal use only (unpack_pdv and unpack_makeself) @@ -429,7 +429,22 @@ _unpacker_get_decompressor() { *.lzma|*.xz|*.txz) echo "xz -T$(makeopts_jobs) -dc" ;; *.lz) - : ${UNPACKER_LZIP:=$(type -P plzip || type -P pdlzip || type -P lzip)} + find_lz_unpacker() { + local has_version_arg="-b" + + [[ ${EAPI} == 6 ]] && has_version_arg="--host-root" + if has_version "${has_version_arg}" ">=app-arch/xz-utils-5.4.0" ; then + echo xz + return + fi + + local x + for x in plzip pdlzip lzip ; do + type -P ${x} && break + done + } + + : ${UNPACKER_LZIP:=$(find_lz_unpacker)} echo "${UNPACKER_LZIP} -dc" ;; *.zst) echo "zstd -dc" ;; @@ -604,7 +619,15 @@ unpacker_src_uri_depends() { *.zip) d="app-arch/unzip" ;; *.lz) - d="|| ( app-arch/plzip app-arch/pdlzip app-arch/lzip )" ;; + d=" + || ( + >=app-arch/xz-utils-5.4.0 + app-arch/plzip + app-arch/pdlzip + app-arch/lzip + ) + " + ;; *.zst) d="app-arch/zstd" ;; *.lha|*.lzh) -- 2.39.0