Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 135134 - Cannot unpack 7z archives
Summary: Cannot unpack 7z archives
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Portage team
URL: http://sourceforge.net/project/showfi...
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 115839
  Show dependency tree
 
Reported: 2006-06-01 03:54 UTC by Paul Bredbury
Modified: 2006-06-01 19:46 UTC (History)
0 users

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


Attachments
ebuild.sh.diff (ebuild.sh.diff,338 bytes, patch)
2006-06-01 03:55 UTC, Paul Bredbury
Details | Diff
ezquake-1517.ebuild (ezquake-1517.ebuild,368 bytes, text/plain)
2006-06-01 04:15 UTC, Paul Bredbury
Details
capture stdout and dump it to stderr if an error occurs (unpack_7z.patch,370 bytes, patch)
2006-06-01 05:31 UTC, Zac Medico
Details | Diff
ebuild.sh.diff (ebuild.sh.diff,472 bytes, patch)
2006-06-01 06:03 UTC, Paul Bredbury
Details | Diff
capture stdout and dump it to stderr if an error occurs (unpack_7z.patch,385 bytes, patch)
2006-06-01 06:17 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Bredbury 2006-06-01 03:54:10 UTC
Hi, here is a patch to add support for unpacking 7z archives in ebuilds. The normal command would of course be:

unpack myarchive.7z

File "ezquake_source_1517.7z" in the URL provided, is an example 7z archive.

Unfortunately, 7z doesn't have a "quiet" option, so it lists the files as it unpacks them.
Comment 1 Paul Bredbury 2006-06-01 03:55:03 UTC
Created attachment 88075 [details, diff]
ebuild.sh.diff
Comment 2 Paul Bredbury 2006-06-01 04:15:41 UTC
Created attachment 88078 [details]
ezquake-1517.ebuild

Here is an example ebuild to unpack a 7z file, using the above patch.

A failed request for a "quiet" option in 7z is at:
http://sourceforge.net/forum/forum.php?thread_id=1270756&forum_id=383044
Comment 3 Zac Medico gentoo-dev 2006-06-01 05:31:38 UTC
Created attachment 88083 [details, diff]
capture stdout and dump it to stderr if an error occurs

That silly 7z program outputs to stdout instead of stderr when it exits with an error!  Anyway, this patch should do the trick.

We will not add a p7zip dependency to portage itself so it's the ebuild maintainer's responsibility to add DEPEND="app-arch/p7zip" to any ebuild that needs to unpack a 7z file.

Are there any complaints about this patch or shall we commit it?
Comment 4 Paul Bredbury 2006-06-01 06:03:58 UTC
Created attachment 88089 [details, diff]
ebuild.sh.diff

The "my_output=" always returns zero, even when 7z returns 2 when I tested it on a deliberately-corrupted archive.

The enclosed patch makes the first run silent, and then runs it again visibly if there was an error. I suppose this is the best compromise.
Comment 5 Zac Medico gentoo-dev 2006-06-01 06:17:00 UTC
Created attachment 88091 [details, diff]
capture stdout and dump it to stderr if an error occurs

(In reply to comment #4)
> The "my_output=" always returns zero, even when 7z returns 2 when I tested it
> on a deliberately-corrupted archive.

Whoops.  Actually, it's the "local" builtin that always returns zero.  This updated patch fixes it by declaring the variable on a separate line.
Comment 6 Paul Bredbury 2006-06-01 06:27:49 UTC
Your patch works great - please commit.
Comment 7 Zac Medico gentoo-dev 2006-06-01 06:49:17 UTC
Thanks, this is in svn r3447.
Comment 8 Zac Medico gentoo-dev 2006-06-01 19:46:19 UTC
This has been released in 2.1_rc3-r5.