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.
Created attachment 88075 [details, diff] ebuild.sh.diff
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
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?
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.
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.
Your patch works great - please commit.
Thanks, this is in svn r3447.
This has been released in 2.1_rc3-r5.