Updating RPMs using binary deltas (demo)

M A Young m.a.young at durham.ac.uk
Tue Jan 27 00:16:38 UTC 2004


Leonard den Ottolander wrote:
>Hello Toshio, Michael,
>
>>                  binutils:   3.64% of original:  96.36% savings
>
>I seem to be unable to patch with just the .cpio.delta. I need the
>.delta to make this work. What is the saving here? And why do I need
>minigzip instead of gzip?

You need both files. The first delta transforms one cpio file to the
other. The second handles the header bits of the rpm such as signatures,
specs, etc. and is comparatively small.

The reason why you use minigzip rather than gzip is that minigzip uses the
zlib libraries like rpm does, and produces the same compressed image.
gzip creates a different compressed image, which is fine if you just want
a compressed image, but not if you want to reconstruct the second rpm
byte-for-byte so that the signatures work, as even slight changes in the
compression algorithm results in completely different compressed images.

Toshio wrote:
>I looked into python as an eventual language for this and found that it
>has rpm bindings and zlib bindings but no built in binary diff/xdelta
>support.  There is an add-on module
>http://freshmeat.net/projects/pysync/ for librsync, though, that may fit
>the bill.

I am now thinking that such a program could be written in C, rpm and zlib
both have library interfaces that could be easily used by using existing
rpm utilities as examples. Xdelta has a library as well, though from a
brief look it seems the interface is more complicated. Also I suspect the
rsync will produce larger diff files because it is designed to do
a slightly different task.

	Michael Young





More information about the fedora-devel-list mailing list