Blog Tags: 

How to upgrade a Debian package to a newer upstream version

Duplicity issued a new stable version with a few bugfixes. I didn't want to wait for the Debian sid package to update so I updated it myself.

This was very simple as the Debian duplicity package uses dpatch to manage all the patches to the original source code. The patches go to debian/patches.

When the package is built debian/rules applies these patches:

dpatch apply-all

Creating a new dpatch is also automated::

# 1. create a new patch: invokes a new shell. Edit files and exit # when you're done dpatch-edit-patch <patch_name>

# 2. add <patch_name> to debian/patches/00list

Bottom line, the only thing different between duplicity the debian package and duplicity the upstream package is the debian/ directory.

This would be easy enough to move manually, but even better - there's a script called uupdate does this for you. It's in the devscripts package:

$ apt-get source foo
dpkg-source: info: extracting foo in foo-oldversion
dpkg-source: info: unpacking foo_oldversion.orig.tar.gz
dpkg-source: info: applying foo_oldversion-1.debian.tar.gz

$ ls -F
foo-oldversion/
foo_oldversion-1.debian.tar.gz
foo_oldversion-1.dsc
foo_oldversion.orig.tar.gz

$ wget http://example.org/foo/foo-newversion.tar.gz
$ cd foo-oldversion
$ uupdate ../foo-newversion.tar.gz

Just make sure that dpatch apply-all still works and we're done.

Add new comment