[Dehs-devel] SVN devscripts commit: r236 - in trunk: . debian
Julian Gilbey
jdg at costa.debian.org
Tue Aug 30 18:20:25 UTC 2005
Author: jdg
Date: 2005-08-30 18:20:24 +0000 (Tue, 30 Aug 2005)
New Revision: 236
Modified:
trunk/debian/changelog
trunk/uscan.1
trunk/uscan.pl
Log:
* uscan: provide --report-status option to distinguish from --report,
which is now quieter (Closes: #325097)
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2005-08-30 18:03:28 UTC (rev 235)
+++ trunk/debian/changelog 2005-08-30 18:20:24 UTC (rev 236)
@@ -6,6 +6,8 @@
* checkbashisms: correctly detect "function" keyword (Closes: #324599)
* uscan: report on package being scanned when --report is used (Closes:
#324102)
+ * uscan: provide --report-status option to distinguish from --report,
+ which is now quieter (Closes: #325097)
[ Filippo Giunchedi ]
* uscan: fixed some repeated tags when used with --dehs
Modified: trunk/uscan.1
===================================================================
--- trunk/uscan.1 2005-08-30 18:03:28 UTC (rev 235)
+++ trunk/uscan.1 2005-08-30 18:20:24 UTC (rev 236)
@@ -144,12 +144,13 @@
upstream version number will then be mangled using the dversionmangle
option if one is specified, as described below. If the newest version
available is newer than the current version, then it is downloaded
-into the parent directory, unless the \fB\-\-report\fR option has been
-used. Once the file has been downloaded, then a symlink to the file
-is made from \fI<package>_<version>.orig.tar.gz\fR if the file has a
-\fI.tar.gz\fR or a \fI.tgz\fR suffix and from
-\fI<package>_<version>.orig.tar.bz2\fR if the file has a \fI.tar.bz2\fR
-or a \fI.tbz\fR or \fI.tbz2\fR suffix.
+into the parent directory, unless the \fB\-\-report\fR or
+\fR\-\-report-status\fR option has been used. Once the file has been
+downloaded, then a symlink to the file is made from
+\fI<package>_<version>.orig.tar.gz\fR if the file has a \fI.tar.gz\fR
+or a \fI.tgz\fR suffix and from \fI<package>_<version>.orig.tar.bz2\fR
+if the file has a \fI.tar.bz2\fR or a \fI.tbz\fR or \fI.tbz2\fR
+suffix.
.PP
Finally, if a third parameter is given in the watchfile line, this is
taken as the name of a command, and the command
@@ -269,8 +270,12 @@
.SH OPTIONS
.TP
.B \-\-report, \-\-no\-download
-Only report about available versions but do not download anything.
+Only report about available newer versions but do not download anything.
.TP
+.B \-\-report\-status
+Report on the status of all packages, even those which are up-to-date,
+but do not download anything.
+.TP
.B \-\-download
Report and download. (This is the default behaviour.)
.TP
Modified: trunk/uscan.pl
===================================================================
--- trunk/uscan.pl 2005-08-30 18:03:28 UTC (rev 235)
+++ trunk/uscan.pl 2005-08-30 18:20:24 UTC (rev 236)
@@ -67,8 +67,9 @@
Process watchfiles in all .../debian/ subdirs of those listed (or the
current directory if none listed) to check for upstream releases.
Options:
- --report, --no-download
- Only report on newer or absent versions, do not download
+ --report Only report on newer or absent versions, do not download
+ --report-status
+ Report status of packages, but do not download
--debug Dump the downloaded web pages to stdout for debugging
your watch file.
--download Report on newer and absent versions, and download (default)
@@ -134,14 +135,16 @@
# The next stuff is boilerplate
my $download = 1;
+my $report = 0; # report even on up-to-date packages?
my $symlink = 'symlink';
my $verbose = 0;
my $check_dirname_level = 1;
my $check_dirname_regex = 'PACKAGE(-.*)?';
my $dehs = 0;
my %dehs_tags;
-my $dehs_end_output=0;
-my $dehs_start_output=0;
+my $dehs_end_output = 0;
+my $dehs_start_output = 0;
+my $pkg_report_header = '';
if (@ARGV and $ARGV[0] =~ /^--no-?conf$/) {
$modified_conf_msg = " (no configuration files read)";
@@ -208,7 +211,7 @@
# Now read the command line arguments
my $debug = 0;
-my ($opt_h, $opt_v, $opt_download, $opt_passive, $opt_symlink);
+my ($opt_h, $opt_v, $opt_download, $opt_report, $opt_passive, $opt_symlink);
my ($opt_verbose, $opt_ignore, $opt_level, $opt_regex, $opt_noconf);
my ($opt_package, $opt_uversion, $opt_watchfile, $opt_dehs);
@@ -216,6 +219,7 @@
"version" => \$opt_v,
"download!" => \$opt_download,
"report" => sub { $opt_download = 0; },
+ "report-status" => sub { $opt_download = 0; $opt_report = 1; },
"passive|pasv!" => \$opt_passive,
"symlink!" => sub { $opt_symlink = $_[1] ? 'symlink' : 'no'; },
"rename" => sub { $opt_symlink = 'rename'; },
@@ -242,6 +246,7 @@
# Now we can set the other variables according to the command line options
$download = $opt_download if defined $opt_download;
+$report = $opt_report if defined $opt_report;
$passive = $opt_passive if defined $opt_passive;
$symlink = $opt_symlink if defined $opt_symlink;
$verbose = $opt_verbose if defined $opt_verbose;
@@ -274,6 +279,12 @@
die "$progname: Can't use --verbose if you're using --dehs!\n"
if $verbose and $dehs;
+die "$progname: Can't use --report-status if you're using --dehs!\n"
+ if $verbose and $report;
+
+die "$progname: Can't use --report-status if you're using --download!\n"
+ if $download and $report;
+
warn "$progname: You're going to get strange (non-XML) output using --debug and --dehs together!\n"
if $debug and $dehs;
@@ -851,19 +862,28 @@
$dehs_tags{'upstream-version'} = $newversion;
$dehs_tags{'upstream-url'} = $upstream_url;
- print "Newest version on remote site is $newversion, local version is $lastversion\n" .
- ($mangled_lastversion eq $lastversion ? "" : " (mangled local version number $mangled_lastversion)\n")
- if $verbose or ($download == 0 and ! $dehs);
-
# Can't just use $lastversion eq $newversion, as then 0.01 and 0.1
# compare different, whereas they are treated as equal by dpkg
if (system("dpkg --compare-versions '$mangled_lastversion' eq '$newversion'") == 0) {
- print " => Package is up to date\n"
- if $verbose or ($download == 0 and ! $dehs);
+ if ($verbose or ($download == 0 and $report and ! $dehs)) {
+ print $pkg_report_header;
+ $pkg_report_header = '';
+ print "Newest version on remote site is $newversion, local version is $lastversion\n" .
+ ($mangled_lastversion eq $lastversion ? "" : " (mangled local version number $mangled_lastversion)\n");
+ print " => Package is up to date\n";
+ }
$dehs_tags{'status'} = "up to date";
return 0;
}
+ # In all other cases, we'll want to report information even with --report
+ if ($verbose or ($download == 0 and ! $dehs)) {
+ print $pkg_report_header;
+ $pkg_report_header = '';
+ print "Newest version on remote site is $newversion, local version is $lastversion\n" .
+ ($mangled_lastversion eq $lastversion ? "" : " (mangled local version number $mangled_lastversion)\n");
+ }
+
# We use dpkg's rules to determine whether our current version
# is newer or older than the remote version.
if (system("dpkg --compare-versions '$mangled_lastversion' gt '$newversion'") == 0) {
@@ -1239,9 +1259,9 @@
# Handle shell \\ -> \
s/\\\\/\\/g if $watch_version==1;
if ($verbose) {
- print "-- In $watchfile, processing watchfile line:\n $_\n" if $verbose;
+ print "-- In $watchfile, processing watchfile line:\n $_\n";
} elsif ($download == 0 and ! $dehs) {
- print "Processing watchfile line for package $package...\n";
+ $pkg_report_header = "Processing watchfile line for package $package...\n";
}
$status +=
More information about the Dehs-devel
mailing list