File 'watch' in the debian folder is used to check if newer version of upstream is available and to download it if needed. The download itself will be performed with the uscan(1) program of the ?devscripts package. It takes the path to the debian folder that includes the watch file as an argument or searches the dirs underneath the current working directory.
Basically a watch file will have this format:
To allow the version to remain unspecified, it is expressed as a wildcard using regular expression in Perl format:
The uscan program will then execute a "dir" command and check all the files in that directory for the highest version number.
uscan also supports ftp protocol. Unfortunately, when working with http, HTML pages do not always contain directory listing with files. The complete (or relative) path of the .tar.gz file to be downloaded will appear as a hyperlink within the web page. We hence need two types of information, the path to the page announcing the file and a regular expression to grep for the right link:
version=3 http://somesite.com/path link_from_href-1.0.tar.gz
"http://somesite.com/path" is the site from where you are downloading the source and "link_from_href.1.0.tar.gz" is obtained from the HTML source code (from the "<a href=" tags).
If http://somesite.com/path HTML code has "<a href=foo/program-1.0.tar.gz>" inside it, for example, you will use
Watch files with errors are generally wrong on this second part.
For FTP sites it changes a little, but it's basically the same thing (man uscan will help you more then me on this).
But the nice part is to test it:
If it's not working as expected, you can use debug to see what it's fetching and what it's (not) matching:
uscan --report-status --debug
Files hosted on various big project hosting sites can be specified with a special "redirector" URL (see more details in 'man uscan'). This allows the upstream URLs to change without the need to adapt watch files of affected packages.
# qa.debian.org runs a redirector which allows a simpler form of URL # for SourceForge based projects. The format below will automatically # be rewritten to use the redirector. http://sf.net/audacity/audacity-src-(.+)\.tar\.gz
The github redirector is no longer needed since the github tags package can simply be used instead:
# githubredir.debian.net is a redirector for GitHub projects # It can be used as following: http://githubredir.debian.net/github/<user>/<project> (.+).tar.gz
See also: http://githubredir.debian.net/
# Use /p/<project> to retrieve available downloads for <project>. # Append ?current to the resulting URL to retrieve only current downloads, not all. http://googlecode.debian.net/p/name/something_(\d+.*)\.tar\.gz
See also: http://googlecode.debian.net/