The following commit has been merged in the master branch:
commit 87084ad48d9c9b264dea63229c7db8ab940a67de
Author: James Vega <[email protected]>
Date:   Sat Mar 26 22:55:36 2011 -0400

    uscan: Fix warnings when processing certain version 1 watch files.
    
    Signed-off-by: James Vega <[email protected]>

diff --git a/debian/changelog b/debian/changelog
index a1bd1a4..2a85c93 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -17,6 +17,8 @@ devscripts (2.10.72) UNRELEASED; urgency=low
     + Parse responses from FTP sites on a line-by-line basis to help prevent
       overly greedy regular expressions in watch files returning bad results.
       (Closes: #597963)
+    + Fix "Use of uninitialized value" warnings when processing certain
+      version 1 watch files.
   * Remove use of lzma command in favor of xz. (Closes: #599641)
     + debian/control: Remove lzma from Recommends.
     + uscan: Use xz to repack lzma tarballs.
diff --git a/scripts/uscan.pl b/scripts/uscan.pl
index feb16b6..5814d3c 100755
--- a/scripts/uscan.pl
+++ b/scripts/uscan.pl
@@ -696,7 +696,7 @@ sub process_watchline ($$$$$$)
     %dehs_tags = ('package' => $pkg);
 
     if ($watch_version == 1) {
-       ($site, $dir, $pattern, $lastversion, $action) = split ' ', $line, 5;
+       ($site, $dir, $filepattern, $lastversion, $action) = split ' ', $line, 
5;
 
        if (! defined $lastversion or $site =~ /\(.*\)/ or $dir =~ /\(.*\)/) {
            warn "$progname warning: there appears to be a version 2 format 
line in\n  the version 1 watchfile $watchfile;\n  Have you forgotten a 
'version=2' line at the start, perhaps?\n  Skipping the line: $line\n";
@@ -704,15 +704,15 @@ sub process_watchline ($$$$$$)
        }
        if ($site !~ m%\w+://%) {
            $site = "ftp://$site";;
-           if ($pattern !~ /\(.*\)/) {
+           if ($filepattern !~ /\(.*\)/) {
                # watch_version=1 and old style watchfile;
                # pattern uses ? and * shell wildcards; everything from the
                # first to last of these metachars is the pattern to match on
-               $pattern =~ s/(\?|\*)/($1/;
-               $pattern =~ s/(\?|\*)([^\?\*]*)$/$1)$2/;
-               $pattern =~ s/\./\\./g;
-               $pattern =~ s/\?/./g;
-               $pattern =~ s/\*/.*/g;
+               $filepattern =~ s/(\?|\*)/($1/;
+               $filepattern =~ s/(\?|\*)([^\?\*]*)$/$1)$2/;
+               $filepattern =~ s/\./\\./g;
+               $filepattern =~ s/\?/./g;
+               $filepattern =~ s/\*/.*/g;
                $style='old';
                warn "$progname warning: Using very old style of filename 
pattern in $watchfile\n  (this might lead to incorrect results): $3\n";
            }
@@ -723,6 +723,7 @@ sub process_watchline ($$$$$$)
        $base =~ s%(?<!:)//%/%g;
        $base =~ m%^(\w+://[^/]+)%;
        $site = $1;
+       $pattern = $filepattern;
     } else {
        # version 2/3 watchfile
        if ($line =~ s/^opt(?:ion)?s=//) {

-- 
Git repository for devscripts


-- 
To unsubscribe, send mail to [email protected].

Reply via email to