Binary diffs for deb files

James Hall rio at x5g.com
Tue May 2 02:50:12 BST 2006


Hi!

I've often wondered why it is necessary to download a whole package
again when there is often only a small change needed. I'd like to see
some sort of patching system. I've written two proof-of-concept scripts
available at: https://wiki.ubuntu.com/DiffDebScript

Here's the idea. Take an old version of a deb file (say Gimp for breezy)
and a new version (the dapper version) and make a binary diff. I think a
format of package_oldversion_newversion_arch.deb.patch looks pretty
reasonable. This file could sit somewhere on a repository and if the
user already has an older deb it could check to see if a patch between
this and the desired version has already been made. This could save alot
of bandwidth.

To make a patch:
diffdeb gimp_2.2.8-2ubuntu6_i386.deb gimp_2.2.11-1ubuntu1_i386.deb gimp_2.2.8-2ubuntu6_2.2.11-1ubuntu1_i386.deb.patch

(usage is: diffdeb olddeb newdeb diff)

This creates a patch file only ~590KB big. To apply the patch simply do:
patchdeb gimp_2.2.8-2ubuntu6_i386.deb gimp_2.2.11-1ubuntu1_i386.deb gimp_2.2.8-2ubuntu6_2.2.11-1ubuntu1_i386.deb.patch

(usage is: patchdeb olddeb newdeb diff)

The script I wrote is fairly hackish. Dpkg won't install plain old ar
files, so I needed to replace the /'s with spaces using sed.

Comments much appreciated. 

Regards,
James Hall
 



More information about the ubuntu-devel mailing list