* [gentoo-dev] [PATCH] unpacker.eclass: support >=app-arch/xz-utils-5.4.0 for lzip decompression
@ 2022-12-14 8:22 Sam James
2022-12-14 11:40 ` Ulrich Mueller
0 siblings, 1 reply; 4+ messages in thread
From: Sam James @ 2022-12-14 8:22 UTC (permalink / raw
To: gentoo-dev; +Cc: base-system, Sam James
>=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 <sam@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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [gentoo-dev] [PATCH] unpacker.eclass: support >=app-arch/xz-utils-5.4.0 for lzip decompression
2022-12-14 8:22 [gentoo-dev] [PATCH] unpacker.eclass: support >=app-arch/xz-utils-5.4.0 for lzip decompression Sam James
@ 2022-12-14 11:40 ` Ulrich Mueller
2022-12-14 22:05 ` Mike Gilbert
2022-12-14 23:49 ` Sam James
0 siblings, 2 replies; 4+ messages in thread
From: Ulrich Mueller @ 2022-12-14 11:40 UTC (permalink / raw
To: Sam James; +Cc: gentoo-dev, base-system
[-- Attachment #1: Type: text/plain, Size: 413 bytes --]
>>>>> On Wed, 14 Dec 2022, Sam James wrote:
> *.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
> + )
> + "
> + ;;
Shouldn't all consumers with a dependency on lzip be revbumped?
Otherwise emerge --depclean (in the default configuration) won't drop
lzip.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 507 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-dev] [PATCH] unpacker.eclass: support >=app-arch/xz-utils-5.4.0 for lzip decompression
2022-12-14 11:40 ` Ulrich Mueller
@ 2022-12-14 22:05 ` Mike Gilbert
2022-12-14 23:49 ` Sam James
1 sibling, 0 replies; 4+ messages in thread
From: Mike Gilbert @ 2022-12-14 22:05 UTC (permalink / raw
To: gentoo-dev; +Cc: Sam James, base-system
On Wed, Dec 14, 2022 at 6:40 AM Ulrich Mueller <ulm@gentoo.org> wrote:
>
> >>>>> On Wed, 14 Dec 2022, Sam James wrote:
>
> > *.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
> > + )
> > + "
> > + ;;
>
> Shouldn't all consumers with a dependency on lzip be revbumped?
> Otherwise emerge --depclean (in the default configuration) won't drop
> lzip.
That seems like an extreme solution to a problem nobody really cares about.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-dev] [PATCH] unpacker.eclass: support >=app-arch/xz-utils-5.4.0 for lzip decompression
2022-12-14 11:40 ` Ulrich Mueller
2022-12-14 22:05 ` Mike Gilbert
@ 2022-12-14 23:49 ` Sam James
1 sibling, 0 replies; 4+ messages in thread
From: Sam James @ 2022-12-14 23:49 UTC (permalink / raw
To: gentoo-dev; +Cc: base-system
[-- Attachment #1: Type: text/plain, Size: 556 bytes --]
> On 14 Dec 2022, at 11:40, Ulrich Mueller <ulm@gentoo.org> wrote:
>
>>>>>> On Wed, 14 Dec 2022, Sam James wrote:
>
>> *.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
>> + )
>> + "
>> + ;;
>
> Shouldn't all consumers with a dependency on lzip be revbumped?
> Otherwise emerge --depclean (in the default configuration) won't drop
> lzip.
We can do that once xz-utils-5.4.x is stable to avoid doing it twice,
I suppose.
[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 358 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-12-14 23:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-14 8:22 [gentoo-dev] [PATCH] unpacker.eclass: support >=app-arch/xz-utils-5.4.0 for lzip decompression Sam James
2022-12-14 11:40 ` Ulrich Mueller
2022-12-14 22:05 ` Mike Gilbert
2022-12-14 23:49 ` Sam James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox