Receiving notification of new upstream software releases

Posted by Steve on Fri 13 Apr 2007 at 09:20

If you're responsible for creating the Debian packages of a piece of software which isn't in the Debian archives, or if you're a Debian-developer keen on keeping your package up to date you will need to be aware of any new software releases which should be packaged. Here we'll show a simple means of doing that.

Debian software is primarily installed via apt-get, or equivalent tools, as binary .deb files. These are built using the original source of the software, as released by whoever wrote it. In Debian-terms the original source of the software is known as "upstream".

Many larger projects have release announcement mailing lists - so by subscribing to them you can easily be notified of new releases. Similarly software directories such as Freshmeat also offer the ability to subscribe to project releases and receive announcement emails when new versions are released.

However there are many pieces of software which have no release-watching facilities; a new software release is just uploaded to a random website and no explicit notification is made. This article explains how you can be made aware of new upstream releases, allowing you to keep your Debian packages current.

The uscan tool, contained in the devscripts package is the tool you'll need to use to be notified of newer upstream releases.

To use the uscan tool you must create a file inside your Debian package, with the name debian/watch - This file will be used by uscan to specify where it should look for new releases.

Here is a sample file:

version=3
http://xen-tools.org/software/xen-tools/releases.html \
   xen-tools-([\d\.]+)\.tar\.gz

Here we have three things:

  • The version of uscan configuration file that we've written. (Currently 3).
  • The URL of the page containing the software downloads for the package.
  • A regular-expression which matches release archives.

Once you have such a file you should be able to test for updates by running uscan from the parent directory. The software can determine the version of your local package by examining debian/changelog and it can scan the web-page which is referenced in the debian/watch file to see if there is a newer version available.

As an example I've got an old version of xen-tools handy, so we can see what happens when we run things:

skx@mine:~/debian/xen-tools-2.9$ uscan
xen-tools: Newer version (3.2) available on remote site:
  http://xen-tools.org/software/xen-tools/xen-tools-3.2.tar.gz
  (local version is 2.9)
xen-tools: Successfully downloaded updated package xen-tools-3.2.tar.gz
    and symlinked xen-tools_3.2.orig.tar.gz to it

Here you see that the code has detected a newer version, and has actually downloaded that version for us.

Here's what it did:

skx@mine:~/debian/xen-tools-2.9$ ls ../ -1
xen-tools_3.2.orig.tar.gz
xen-tools-2.9
xen-tools-3.2.tar.gz

The script did several things, which become more explicit when running the tool verbosely:

skx@mine:~/debian/xen-tools-2.9$ uscan --verbose
-- Scanning for watchfiles in .
-- Found watchfile in ./debian
-- In debian/watch, processing watchfile line:
   http://xen-tools.org/software/xen-tools/releases.html    xen-tools-([\d\.]+)\.tar\.gz
-- Found the following matching hrefs:
     xen-tools-3.2.tar.gz
Newest version on remote site is 3.2, local version is 2.9
 => Newer version available from
    http://xen-tools.org/software/xen-tools/xen-tools-3.2.tar.gz
-- Downloading updated package xen-tools-3.2.tar.gz
-- Successfully downloaded updated package xen-tools-3.2.tar.gz
    and symlinked xen-tools_3.2.orig.tar.gz to it
-- Scan finished

The tool downloaded the named URL, then scanned that looking for links matching the pattern we defined "xen-tools-([\d\.]+)\.tar\.gz" when it found a match with the version number (3.2) greater than the local one (2.9) it informed us and downloaded the file.

To stop the automatic download you can edit the configuration file /etc/devscripts.conf:

# Should we download newer upstream files we come across?
USCAN_DOWNLOAD=no

After making that change the download no longer occurs:

skx@mine:~/debian/xen-tools-2.9$ uscan
Processing watchfile line for package xen-tools...
Newest version on remote site is 3.2, local version is 2.9
xen-tools: Newer version (3.2) available on remote site:
  http://xen-tools.org/software/xen-tools/xen-tools-3.2.tar.gz
  (local version is 2.9)

For more details of the kind of watch files you can create you can read the manpage via "man uscan".

Share/Save/Bookmark


Posted by Anonymous (84.227.xx.xx) on Fri 13 Apr 2007 at 10:01
Very intersting, thanks a lot for this article.

- michael

[ Parent | Reply to this comment ]

Posted by Anonymous (81.168.xx.xx) on Fri 13 Apr 2007 at 10:12
uscan --report ./repos/packagea ./repos/packageb ./src/packagec-1.1 ./src/packaged-0.2

[ Parent | Reply to this comment ]

Posted by yarikoptic (69.115.xx.xx) on Sat 14 Apr 2007 at 03:14
[ Send Message ]
Few comments to add: 1. debian/watch used by qa.debian.org to provide information on the new upstream within package entry. For instance let look at the package fail2ban http://qa.debian.org/developer.php?packages=fail2ban There is a column Watch which lists current upstream version. And you can look at all your packages in 1 table also. For instance, packages of our new DPL http://qa.debian.org/developer.php?login=sam+deb@zoy.org 2. Some times you need to package something which either doesn't come in a suitable tarball (ie it comes in .zip) or may be it needs some parts to get removed due to their license (ie to make package DFSG-free), then to automate that you can add dh_wraporig call into watch file. dh_wraporig is a script available from http://svn.debian.org/wsvn/pkg-exppsy/tools/dh_wraporig

[ Parent | Reply to this comment ]

User Login

Username:

Password:

[ Advanced Login ]

Register Account

Quick Site Search