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

Re: New data type for jigdo please!

Hi Steve,

(For all folks who haven't a clue what we're talking about, the .template
file format is described in doc/TechDetails.txt and the definitive list of
"type" values is near the start of src/mkimage.hh in the jigdo source

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...

> 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.

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.



  __   _
  |_) /|  Richard Atterer
  | \/¯|  http://atterer.net
  ¯ '` ¯

Reply to: