Enrico Weigelt schrieb:
> * Florian Philipp <[EMAIL PROTECTED]> wrote:
>
> Hi folks,
>
>   
>> On Sun, 2008-01-27 at 11:40 +0100, Justin wrote:
>>     
>>> Is there a way to use 7zip for decompression with emerge?
>>>       
>> I fear, no easy one. Of course, since emerge is just a python script,
>> you could rewrite it but 7z-syntax isn't compatible with bzip2 or
>> gnu-tar so it will be some work. I also tried to use star as a drop-in
>> replacement for gnu-tar, once. Didn't work well although their syntax is
>> nearly identical, but just nearly...
>>     
>
> Why not an universal wrapper script ?
>
> maybe something like:
>
>     magic-uncompress [-t <format>] [-c] [-o <output>] <input>
>     
> This script could try to find out the input format automatically
> (the optional -t parameter allows to explicitly specifiy the format)
>
> Once we have this script, ebuilds could be rewritten step by step
> and no one (else than magic-uncompress) has to care about the actual 
> commands behind. 
>
> Some could be done w/ tar and zip, etc.
>
>
> cu
>   

But than there is still the incompability problem with pbzip2 with bzip2
compressed files. The best solution at this point would be to compress
all official tarballs with pbzip2, because now and  especially in future
parallel processing is the solution and second there is no problem
decompressing parallel compressed tarballs in single mode.


For an temporary work around I figured out this hack:

in /usr/lib/portage/bin/ebuild.sh there is a function defined for each
type of compression algorithm. I changed following lines

--- ebuild.sh.orig      2008-01-27 19:16:22.000000000 +0100
+++ ebuild.sh   2008-01-27 19:15:36.000000000 +0100
@@ -479,7 +479,7 @@
                                ;;
                        bz2|bz)
                                if [ "${y}" == "tar" ]; then
-                                       7za x -so "${srcdir}${x}" | tar
xof - ${tar_opts}
+                                       bzip2 -dc "${srcdir}${x}" | tar
xof - ${tar_opts}
                                        assert "$myfail"
                                else
                                        bzip2 -dc "${srcdir}${x}" >
${x%.*} || die "$myfail"

ebuild.sh.orig:
real    0m16.962s
user    0m16.289s
sys     0m2.780s


ebuild.sh:
real    0m12.805s
user    0m13.209s
sys     0m2.666s

With this trick you can change every kind of decompression command.

In this example you can save 25% of the time.
-- 
gentoo-user@lists.gentoo.org mailing list

Reply via email to