Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 213971 - Support alternative tools for archive unpacking
Summary: Support alternative tools for archive unpacking
Status: RESOLVED OBSOLETE
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: PMS/EAPI
URL:
Whiteboard:
Keywords: SOCIDEAS
Depends on:
Blocks:
 
Reported: 2008-03-20 00:04 UTC by Diego Elio Pettenò (RETIRED)
Modified: 2014-07-07 16:55 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Elio Pettenò (RETIRED) gentoo-dev 2008-03-20 00:04:14 UTC
The unpack function right now hardcodes the tools and the syntax used to unpack particular kind of archives, basing itself on the extension of the file.

We actually have in portage multiple choices of tools that can unpack a given archive format, for instance:

tar(.bz2/.gz): tar, star, bsdtar
zip: unzip, bsdtar
cpio: (GNU) cpio, bsdcpio

and so on.

For instance a Gentoo/FreeBSD system will have libarchive installed by default, one can avoid installing cpio and unzip with that installed. In the future more formats could be added to that too.

Not only the tool might differ, but its syntax too: while unpacking a tar.gz with GNU tar will perform better doing a zcat piped through a tar command, libarchive will handle decompression and unpacking in a single process, so the pipe makes little sense when using that.

It should be possible to leave the user with the choice of which tool to use to extract a given filetype by creating a series of virtual packages, like for instance virtual/portage-unpack-zip and virtual/portage-unpack-cpio. An exception to this might be the tarball format as that is supposed to be always unpackable (although having a virtual/portage-unpack-tar{gz,bz2} as a portage dependency would be nice to get rid of tar from system, for instance).
Comment 1 Marius Mauch (RETIRED) gentoo-dev 2008-03-20 01:03:35 UTC
Am I missing something, or would this just be some updated deps and a series of

if type tar && type bzcat; then
    bzcat foo.tar.bz2 | tar x
elif has_version libarchive; then
    # do whatever is needed here
elif ...

Maybe wrapped a bit nicer. If that's all then I don't think this is suitable as a full SoC project.
Comment 2 Diego Elio Pettenò (RETIRED) gentoo-dev 2008-03-20 01:09:34 UTC
Well, probably not really, unless you still want to hardcode everything, which is quite a bit. The optimal way would be to have a way either for packages to describe their capabilities or to "outsource" the script for unpacking on the virtual package itself.
Comment 3 David Leverton 2008-03-20 01:16:04 UTC
Assuming we want to make the package manager's unpack function support it, this is an EAPI bump.  Feel free to remove if you want to do it in a way that doesn't require package manager changes, although that would force the complexity into the ebuilds instead....
Comment 4 Marius Mauch (RETIRED) gentoo-dev 2008-03-20 02:29:20 UTC
(In reply to comment #3)
> Assuming we want to make the package manager's unpack function support it, this
> is an EAPI bump.
It isn't unless the interface changes, and I don't see any reference to that. Don't confuse this with adding additional formats like in bug #207193, such things might be made easier with this project, but are a separate issue.
Comment 5 Marius Mauch (RETIRED) gentoo-dev 2008-03-20 02:35:57 UTC
(In reply to comment #2)
> Well, probably not really, unless you still want to hardcode everything, which
> is quite a bit.

As I said: wrapped a bit nicer. But no need for overengineering, IMO this still belongs in the manager, not the packages. For each format there are only a couple of tools to consider, that can be managed in the PM.
Comment 6 David Leverton 2008-03-20 02:52:57 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > Assuming we want to make the package manager's unpack function support it, this
> > is an EAPI bump.
> It isn't unless the interface changes, and I don't see any reference to that.

If an ebuild depends on, say, virtual/portage-unpack-zip and not app-arch/unzip, but the package manager hardcodes unzip, then the ebuild will fail on systems that have libarchive but not unzip installed.
Comment 7 Marius Mauch (RETIRED) gentoo-dev 2008-03-20 03:52:23 UTC
(In reply to comment #6)
> (In reply to comment #4)
> > (In reply to comment #3)
> > > Assuming we want to make the package manager's unpack function support it, this
> > > is an EAPI bump.
> > It isn't unless the interface changes, and I don't see any reference to that.
> 
> If an ebuild depends on, say, virtual/portage-unpack-zip and not
> app-arch/unzip, but the package manager hardcodes unzip, then the ebuild will
> fail on systems that have libarchive but not unzip installed.

That's why the package manager depends on the virtual, not the indivdual ebuilds. Moving the deps into the ebuilds would be a separate step.

Comment 8 Ciaran McCreesh 2008-03-20 07:26:29 UTC
So you'd make the package manager dep upon virtual/portage-$obscure-unpacker?
Comment 9 SpanKY gentoo-dev 2008-03-20 13:33:15 UTC
unpack() is really just a special case.  the thread in Bug 207193 covers this in the general case.
Comment 10 Marius Mauch (RETIRED) gentoo-dev 2008-03-20 17:49:32 UTC
(In reply to comment #8)
> So you'd make the package manager dep upon virtual/portage-$obscure-unpacker?

Please don't comment if you don't get what this bug is about. File your own bug if you want to make PMS look important.
Comment 11 Ciaran McCreesh 2008-03-20 17:50:41 UTC
(In reply to comment #10)
> (In reply to comment #8)
> > So you'd make the package manager dep upon virtual/portage-$obscure-unpacker?
> 
> Please don't comment if you don't get what this bug is about. File your own bug
> if you want to make PMS look important.

Please don't comment until you understand the implications of the change and why it has to be an EAPI issue.

Comment 12 Marius Mauch (RETIRED) gentoo-dev 2008-03-20 18:20:08 UTC
(In reply to comment #11)
> Please don't comment until you understand the implications of the change and
> why it has to be an EAPI issue.

Changing the exact command inside unpack() without changing the IO behavior has the implication of changed deps of the package manager and doesn't affect EAPI, unless unpack is moved into the tree.
Thanks for wasting everyones time.
Comment 13 Ciaran McCreesh 2008-03-20 18:23:16 UTC
(In reply to comment #12)
> Changing the exact command inside unpack() without changing the IO behavior has
> the implication of changed deps of the package manager and doesn't affect EAPI,
> unless unpack is moved into the tree.
> Thanks for wasting everyones time.

The package manager doesn't dep upon the unpacker. Individual ebuilds do. It thus affects EAPI.

Really, this isn't difficult. Think about it before you mess with the Cc: list again.
Comment 14 Zac Medico gentoo-dev 2008-03-21 20:08:25 UTC
(In reply to comment #9)
> unpack() is really just a special case.  the thread in Bug 207193 covers this
> in the general case.

Right. Perhaps a good SOC project would be to split the unpack() and other functions into a separate library package that package managers could pull in as a dependency. We started discussing this in bug 207193, comment #15.
Comment 15 Zac Medico gentoo-dev 2008-05-23 19:46:38 UTC
Seeing how this bug is similar to bug 33544 in some ways, maybe unpack() should be part of something like the eapi-2.eclass idea mentioned in bug 33544, comment #16.
Comment 16 Ulrich Müller gentoo-dev 2014-07-07 16:55:56 UTC
This is mostly superseded by unpacker.eclass.
Reopen (with a tangible proposal) if you still need support in PMS.