diff options
author | V3n3RiX <venerix@koprulu.sector> | 2022-12-14 15:30:24 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2022-12-14 15:30:24 +0000 |
commit | 9b921f0a27acb73f29835bcf94b91bbdef87e9de (patch) | |
tree | a20561c628642e6e518ffac7df78980360a7ff8b /eclass/unpacker.eclass | |
parent | 05a3b7c2189f095dfc46fbb03d4b3e801d3dc13a (diff) |
gentoo auto-resync : 14:12:2022 - 15:30:24
Diffstat (limited to 'eclass/unpacker.eclass')
-rw-r--r-- | eclass/unpacker.eclass | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/eclass/unpacker.eclass b/eclass/unpacker.eclass index 3d8bf7a8452d..5ce681ebaa0d 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" ;; @@ -472,7 +487,7 @@ unpack_gpkg() { local dirname=${images[0]%/*} mkdir -p "${dirname}" || die tar -xOf "${gpkg}" "${images[0]}" | ${decomp:-cat} | - tar --no-same-owner -xC "${dirname}" + tar --no-same-owner -C "${dirname}" -xf - assert "Unpacking ${gpkg} failed" } @@ -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) |