APT Package Deltas

Allowing APT to upgrade from one version of a package to another version by downloading only deltas of the differences between the old and new versions may alleviate some of the bandwidth required for large packages. Dial-up users would appreciate this no doubt.

This feature also would allow users with bandwidth limits to participate in testing development versions of Ubuntu. Users with a monthly 5 GB limit for instance really cannot afford to test upcoming Ubuntu releases right now, due the high traffic volume caused by the frequent package updates during development phase.

To do this new functionality would be introduced into both Dpkg and Apt. A new Dpkg related file format: .debdelta would be introduced. A .debdelta file would be an archive containing some metadata and a binary diff of the control.tar.gz and data.tar.gz files located in the original .deb file. A .debdelta would be designed to take one version of a .deb file and produce another version.

To keep with the classic .deb design, a .debdelta file would be an 'ar' file with the following contents:

  1. debian-delta - contains the version of the delta format
  2. control.tar.gz - contains the control file for the .debdelta
  3. control.xdelta - the xdelta patch for the .deb's control.tar file
  4. data.xdelta - the xdelta patch for the .deb's data.tar file

The 'control.tar.gz' contains only 'control' at this point. This file is a simple control-formatted file listing the following information:

Package: {package name}
Original-Version: {original version}
Target-Version: {target version}
Architecture: {arch}

The 'control.xdelta' file is a xdelta patch for the 'control.tar.gz' of the original .deb file, while 'data.xdelta' is a xdelta patch for the 'data.tar.gz' file.

Dpkg would be modified to provide the proper APIs and command lines to take a .deb file and apply one or more .debdelta files, in the proper order, to it in order to create a resulting .deb file. Various other user based API's would be useful:

dpkg -i package_version_arch.debdelta

For discussion see APTPackageDeltas/talk

For a spec about this (or rather the general idea) see: SmallerUpdates

For an implementation, look into Debdelta;http://debdelta.debian.net

APTPackageDeltas (last edited 2011-05-03 17:22:20 by mennucc1)