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

Binary patching .deb files



I've created a few scripts to do binary patching between two different
versions of the same package. These scripts use either bsdiff or xdelta
to create the patch and apply it.

The binary diffs can't be made directly between the two debs because
these programs work poorly with gzip encoded data, even if the encoding
was done with --rsyncable.

To work around this I transform the .deb's into what I call .deb.ungz
which are debs that have control and data as uncompressed tar files.

The binary patching and diffing is done between files in this format.

The process works fine. I've tried this with two versions of xserver-
xfree86 and this is the result:

5625672 xserver-xfree86_4.3.0.dfsg.1-4_i386.deb
5627728 xserver-xfree86_4.3.0.dfsg.1-6_i386.deb
195855  xserver.bsdiff
419393  xserver.xdelta


Bsdiff generates much smaller diff's but it's also slower and uses more
memory.

The only problem with this process is that after the patching the script
doesn't generate the exact same file. This appears to be because when I
gzip the control.tar and data.tar files I'm not using the same
options/gzip version that was used initially. If anyone has any way
around this I'd be glad to hear it.

All the code is attached. Please CC any responses to me since I'm not a
subscriber to the list.

Pedro. 


Attachment: ungzip_funcs.sh
Description: application/shellscript

Attachment: patch-deb
Description: application/shellscript

Attachment: diff-deb
Description: application/shellscript

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: