[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: New data type for jigdo please!



On Wed, Sep 01, 2004 at 10:43:56PM +0200, Richard Atterer wrote:
>On Wed, Sep 01, 2004 at 08:31:13PM +0100, Steve McIntyre wrote:
>> I've used a new data type (8) in JTE/mkimage to describe
>> bzip2-compressed data chunks rather than 2 for gzip. I'm _not_
>> releasing this code just yet (at least until after sarge), but I think
>> it will be worth it for the ~15% extra compression for template files.
>
>That's nice - I admit I just assumed that since the template data is
>binary, gzip would do better than bzip2, but never actually checked whether
>that is the case...

Hey, I wasn't sure myself so I just tried it. :-)

>> Please reserve 8 for this use; I'll work on a patch for jigdo-file
>> shortly.
>
>Hmm, I don't think that a new type code is necessary for this. It would
>make more sense to add a new type of section, say "BZIP" for bzipped,
>leaving "DATA" for gzipped.
>
>Imagine the (admittedly rather theoretical) case that a .template contains
>both gzipped and bzipped data - since each DATA/BZIP section can either be
>bzipped OR gzipped, and one such section can hold the data for /several/ 
>"unmatched data" (type==2) entries, those entries are obviously the wrong 
>place to make the bzip vs. gzip distinction.

Actually, yes.

>I just checked whether it would be possible to keep "DATA" for both types 
>of sections and look at the zlib/bzip2 stream to distinguish them, but this 
>would probably be difficult: zlib streams (!= .gz files) start with 2 flag 
>bytes which can have several different values.
>
>If you can wait for a month or two, I might get around to adding this
>myself. The cleanest solution in my eyes is to reorganize zstream.hh and
>friends, adding an abstract base class so that zstream objects and
>instances of the to-be-written bzstream classes can be used
>interchangeably. The resulting C++ might be a bit too hairy for your taste.
>:-)

Hmmm. :-) I've written a proof of concept using type 8, but I agree
that that's the wrong way to do it. Using a new BZIP section would be
better. I'll change my code to do that shortly.

-- 
Steve McIntyre, Cambridge, UK.                                steve@einval.com
"Further comment on how I feel about IBM will appear once I've worked out
 whether they're being malicious or incompetent. Capital letters are forecast."
 Matthew Garrett, http://www.livejournal.com/users/mjg59/30675.html

Attachment: signature.asc
Description: Digital signature


Reply to: