The following commit has been merged in the master branch:
commit 28ec66273b554dedcc4cc5a1bf8716d3184f248c
Author: Niels Thykier <[email protected]>
Date:   Mon Jan 31 16:15:37 2011 +0100

    PerlCritic cleaned checks/{watch-file,version-substvars}

diff --git a/checks/version-substvars b/checks/version-substvars
index 1082183..195b6c7 100644
--- a/checks/version-substvars
+++ b/checks/version-substvars
@@ -34,6 +34,7 @@
 
 package Lintian::version_substvars;
 use strict;
+use warnings;
 
 use Util;
 use Lintian::Tags qw(tag);
@@ -57,11 +58,11 @@ foreach (keys %$binpkgs) {
        foreach my $field (@dep_fields) {
                next unless $info->binary_field($pkg1, $field);
                if ($info->binary_field($pkg1, $field) =~ 
m/\${Source-Version}/) {
-                       tag "substvar-source-version-is-deprecated", $pkg1;
+                       tag 'substvar-source-version-is-deprecated', $pkg1;
                }
        }
 
-       foreach (split(m/,/, $info->binary_field($pkg1, 'pre-depends').", ".
+       foreach (split(m/,/, $info->binary_field($pkg1, 'pre-depends').', '.
                       $info->binary_field($pkg1, 'depends'))) {
                next unless 
m/(\S+)\s*\(\s*=\s*\${((?:Source-|source:|binary:)Version)}/x;
 
@@ -72,7 +73,7 @@ foreach (keys %$binpkgs) {
                # formed via substvars expanded during the build.  Assume
                # those maintainers know what they're doing.
                if (not $info->binary_field($pkg2, 'architecture')) {
-                       tag "version-substvar-for-external-package", "$pkg1 -> 
$pkg2"
+                       tag 'version-substvar-for-external-package', "$pkg1 -> 
$pkg2"
                                unless ($pkg2 =~ /\$\{\S+\}/);
                        next;
                }
@@ -81,14 +82,14 @@ foreach (keys %$binpkgs) {
                if ($pkg1_is_any) {
                        if ($pkg2_is_any and $substvar_strips_binNMU) {
                                # (b1) any -> any (= ${source:Version})
-                               tag "not-binnmuable-any-depends-any", "$pkg1 -> 
$pkg2";
+                               tag 'not-binnmuable-any-depends-any', "$pkg1 -> 
$pkg2";
                        } elsif (not $pkg2_is_any and not 
$substvar_strips_binNMU) {
                                # (b2) any -> all (= ${Source-Version}) [or b:V]
-                               tag "not-binnmuable-any-depends-all", "$pkg1 -> 
$pkg2";
+                               tag 'not-binnmuable-any-depends-all', "$pkg1 -> 
$pkg2";
                        }
                } elsif ($pkg2_is_any) {
                        # (b3) all -> any (= ${either-of-them})
-                       tag "not-binnmuable-all-depends-any", "$pkg1 -> $pkg2";
+                       tag 'not-binnmuable-all-depends-any', "$pkg1 -> $pkg2";
                }
        }
 }
diff --git a/checks/watch-file b/checks/watch-file
index 338c7ff..70b421b 100644
--- a/checks/watch-file
+++ b/checks/watch-file
@@ -22,6 +22,7 @@
 
 package Lintian::watch_file;
 use strict;
+use warnings;
 
 use Lintian::Collect;
 use Lintian::Tags qw(tag);
@@ -34,7 +35,7 @@ my $info = shift;
 
 my $template = 0;
 
-if (! -f "debfiles/watch") {
+if (! -f 'debfiles/watch') {
     tag 'debian-watch-file-is-missing' unless ($info->native);
     return;
 }
@@ -74,7 +75,7 @@ while (<WATCH>) {
         goto CHOMP;
     }
 
-    if (/^version\s*=\s*(\d+)(\s|\Z)/) {
+    if (/^version\s*=\s*(\d+)(?:\s|\Z)/) {
         if (defined $watchver) {
             tag 'debian-watch-file-declares-multiple-versions', "line $.";
         }
@@ -97,10 +98,10 @@ while (<WATCH>) {
             @opts = split(',', $opts);
             if (defined $repack or defined $prerelease) {
                 for (@opts) {
-                    $repack_mangle = 1 if defined $repack and 
/^[ud]?versionmangle\s*=.*($repack)/;
-                    $repack_dmangle = 1 if defined $repack and 
/^dversionmangle\s*=.*($repack)/;
-                    $prerelease_mangle = 1 if defined $prerelease and 
/^[ud]?versionmangle\s*=.*($prerelease)/;
-                    $prerelease_umangle = 1 if defined $prerelease and 
/^uversionmangle\s*=.*($prerelease)/;
+                    $repack_mangle = 1 if defined $repack and 
/^[ud]?versionmangle\s*=.*$repack/;
+                    $repack_dmangle = 1 if defined $repack and 
/^dversionmangle\s*=.*$repack/;
+                    $prerelease_mangle = 1 if defined $prerelease and 
/^[ud]?versionmangle\s*=.*$prerelease/;
+                    $prerelease_umangle = 1 if defined $prerelease and 
/^uversionmangle\s*=.*$prerelease/;
                 }
             }
         }
@@ -109,9 +110,9 @@ while (<WATCH>) {
                 "line $.";
         }
 
-        if 
(m%(https?|ftp)://((.+\.)?dl|(pr)?downloads?|ftp\d?|upload)\.(sourceforge|sf)\.net%
-            or m%https?://(www\.)?(sourceforge|sf)\.net/project/showfiles\.php%
-            or m%https?://(www\.)?(sourceforge|sf)\.net/projects/.+/files%) {
+        if 
(m%(?:https?|ftp)://(?:(?:.+\.)?dl|(?:pr)?downloads?|ftp\d?|upload)\.(?:sourceforge|sf)\.net%
+            or 
m%https?://(?:www\.)?(?:sourceforge|sf)\.net/project/showfiles\.php%
+            or 
m%https?://(?:www\.)?(?:sourceforge|sf)\.net/projects/.+/files%) {
             tag 'debian-watch-file-should-use-sf-redirector', "line $.";
         }
 
@@ -145,7 +146,7 @@ while (<WATCH>) {
 }
 close WATCH;
 
-tag "debian-watch-contains-dh_make-template" if ($template);
+tag 'debian-watch-contains-dh_make-template' if ($template);
 
 my $changes = $info->changelog;
 if (defined $changes and %dversions) {

-- 
Debian package checker


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: http://lists.debian.org/[email protected]

Reply via email to