tag 539724 patch quit Hi!
here's my uneducated, written-at-3AM patch. it seems to work, and I think that I didn't break anything. I'm sure that if applied, the name of the option will need to be changed :). Cheers, Ryan -- _________________________ Ryan Niebur [email protected]
diff --git a/uscan b/uscan
index edc9f7b..d8ffdb1 100755
--- a/uscan
+++ b/uscan
@@ -259,6 +259,7 @@ my ($opt_verbose, $opt_ignore, $opt_level, $opt_regex,
$opt_noconf);
my ($opt_package, $opt_uversion, $opt_watchfile, $opt_dehs, $opt_timeout);
my $opt_download_version;
my $opt_user_agent;
+my $opt_myversion;
GetOptions("help" => \$opt_h,
"version" => \$opt_v,
@@ -286,6 +287,7 @@ GetOptions("help" => \$opt_h,
"useragent=s" => \$opt_user_agent,
"noconf" => \$opt_noconf,
"no-conf" => \$opt_noconf,
+ "myversion" => \$opt_myversion,
)
or die "Usage: $progname [options] [directories]\nRun $progname --help for
more details\n";
@@ -817,6 +819,25 @@ sub process_watchline ($$$$$$)
$pattern = "(?:(?:$site)?" . quotemeta($basedir) . ")?$filepattern";
}
+ if (! $lastversion or $lastversion eq 'debian') {
+ if (defined $pkg_version) {
+ $lastversion=$pkg_version;
+ } else {
+ warn "$progname warning: Unable to determine current version\n in
$watchfile, skipping:\n $line\n";
+ return 1;
+ }
+ }
+ # And mangle it if requested
+ my $mangled_lastversion;
+ $mangled_lastversion = $lastversion;
+ foreach my $pat (@{$options{'dversionmangle'}}) {
+ eval "\$mangled_lastversion =~ $pat;";
+ }
+ if($opt_myversion) {
+ $download_version = $mangled_lastversion;
+ $force_download = 1;
+ }
+
# Check all's OK
if ($pattern !~ /\(.*\)/) {
warn "$progname warning: Filename pattern missing version delimiters
()\n in $watchfile, skipping:\n $line\n";
@@ -1055,20 +1076,7 @@ EOF
$newfile_base = "$pkg-$newversion.download";
}
}
- if (! $lastversion or $lastversion eq 'debian') {
- if (defined $pkg_version) {
- $lastversion=$pkg_version;
- } else {
- warn "$progname warning: Unable to determine current version\n in
$watchfile, skipping:\n $line\n";
- return 1;
- }
- }
- # And mangle it if requested
- my $mangled_lastversion = $lastversion;
- foreach my $pat (@{$options{'dversionmangle'}}) {
- eval "\$mangled_lastversion =~ $pat;";
- }
-
+
# So what have we got to report now?
my $upstream_url;
# Upstream URL? Copying code from below - ugh.
signature.asc
Description: Digital signature
