#!/usr/bin/perl # -*- tab-width: 8; indent-tabs-mode: t; cperl-indent-level: 4 -*- # vim: set ai shiftwidth=4 tabstop=4 expandtab: # uscan: This program looks for watch files and checks upstream ftp sites # for later versions of the software. # # Originally written by Christoph Lameter (I believe) # Modified by Julian Gilbey # HTTP support added by Piotr Roszatycki # Rewritten in Perl, Copyright 2002-2006, Julian Gilbey # Rewritten in Object Oriented Perl, copyright 2018, Xavier Guimard # # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . ####################################################################### # {{{ code 0: POD for manpage ####################################################################### =pod =head1 NAME uscan - scan/watch upstream sources for new releases of software =head1 SYNOPSIS B [I] [I] =head1 DESCRIPTION For basic usage, B is executed without any arguments from the root of the Debianized source tree where you see the F directory, or a directory containing multiple source trees. Unless --watchfile is given, B looks recursively for valid source trees starting from the current directory (see the below section L for details). For each valid source tree found, typically the following happens: =over =item * B reads the first entry in F to determine the source package name I<< >> and the last upstream version. =item * B process the watch lines F from the top to the bottom in a single pass. =over =item * B downloads a web page from the specified I in F. =item * B extracts hrefs pointing to the upstream tarball(s) from the web page using the specified I in F. =item * B downloads the upstream tarball with the highest version newer than the last upstream version. =item * B saves the downloaded tarball to the parent B<../> directory: I<< ../-.tar.gz >> =item * B invokes B to create the source tarball: I<< ../_.orig.tar.gz >> =over =item * For a multiple upstream tarball (MUT) package, the secondary upstream tarball will instead be named I<< ../_.orig-.tar.gz >>. =back =item * Repeat until all lines in F are processed. =back =item * B invokes B to create the Debianized source tree: I<< ../-/* >> =back Please note the following. =over =item * For simplicity, the compression method used in examples is B with B<.gz> suffix. Other methods such as B, B, and B with corresponding B, B and B suffixes may also be used. =item * The new B enables handling of multiple upstream tarball (MUT) packages but this is a rare case for Debian packaging. For a single upstream tarball package, there is only one watch line and no I<< ../_.orig-.tar.gz >> . =item * B with the B<--verbose> option produces a human readable report of B's execution. =item * B with the B<--debug> option produces a human readable report of B's execution including internal variable states. =item * B with the B<--extra-debug> option produces a human readable report of B's execution including internal variable states and remote content during "search" step. =item * B with the B<--dehs> option produces an upstream package status report in XML format for other programs such as the Debian External Health System. =item * The primary objective of B is to help identify if the latest version upstream tarball is used or not; and to download the latest upstream tarball. The ordering of versions is decided by B. =item * B with the B<--safe> option limits the functionality of B to its primary objective. Both the repacking of downloaded files and updating of the source tree are skipped to avoid running unsafe scripts. This also changes the default to B<--no-download> and B<--skip-signature>. =back =head1 FORMAT OF THE WATCH FILE The current version 4 format of F can be summarized as follows: =over =item * Leading spaces and tabs are dropped. =item * Empty lines are dropped. =item * A line started by B<#> (hash) is a comment line and dropped. =item * A single B<\> (back slash) at the end of a line is dropped and the next line is concatenated after removing leading spaces and tabs. The concatenated line is parsed as a single line. (The existence or non-existence of the space before the tailing single B<\> is significant.) =item * The first non-comment line is: =over =item B =back This is a required line and the recommended version number. If you use "B" instead here, some features may not work as documented here. See L. =item * The following non-comment lines (watch lines) specify the rules for the selection of the candidate upstream tarball URLs and are in one of the following three formats: =over =item * B I<...> B<"> BI I [I [I