This site is now 100% read-only, and retired.

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".

 

 


Re: Receiving notification of new upstream software releases
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 ]

Re: Receiving notification of new upstream software releases
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 ]