[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.2.6-17-gae9fa2e



The following commit has been merged in the master branch:
commit b29076bb74ac992cb1d593ccd639d75bdf379e85
Author: Raphael Geissert <atomo64@gmail.com>
Date:   Sat Feb 14 01:34:39 2009 -0600

    Avoid capturing patterns where not needed

diff --git a/checks/binaries b/checks/binaries
index ddd9bf0..d718dcc 100644
--- a/checks/binaries
+++ b/checks/binaries
@@ -118,10 +118,10 @@ foreach my $file (sort keys %{$info->objdump_info}) {
 sub lib_soname_path {
     my (@paths) = @_;
     foreach my $path (@paths) {
-	next if $path =~ m%^(\.?/)?lib/libnss_[^.]+\.so(\.[0-9]+)$%;
-	return 1 if $path =~ m%^(\.?/)?lib/[^/]+$%;
-	return 1 if $path =~ m%^(\.?/)?usr/lib/[^/]+$%;
-	return 1 if $path =~ m%^(\.?/)?usr/X11R6/lib/[^/]+$%;
+	next if $path =~ m%^(?:\.?/)?lib/libnss_[^.]+\.so(?:\.[0-9]+)$%;
+	return 1 if $path =~ m%^(?:\.?/)?lib/[^/]+$%;
+	return 1 if $path =~ m%^(?:\.?/)?usr/lib/[^/]+$%;
+	return 1 if $path =~ m%^(?:\.?/)?usr/X11R6/lib/[^/]+$%;
     }
     return 0;
 }
@@ -139,7 +139,7 @@ $base_pkg =~ s/^lib64/lib/o;
 my $match_found = 0;
 foreach my $expected_name (@sonames) {
     $expected_name =~ s/([0-9])\.so\./$1-/;
-    $expected_name =~ s/\.so(\.|\z)//;
+    $expected_name =~ s/\.so(?:\.|\z)//;
     $expected_name =~ s/_/-/g;
 
     if ((lc($expected_name) eq $pkg)
@@ -237,7 +237,7 @@ foreach my $file (sort keys %{$info->file_info}) {
     # rpath is disallowed, except in private directories
     if (exists $objdump->{RPATH}) {
 	foreach my $rpath (map {File::Spec->canonpath($_)} keys %{$objdump->{RPATH}}) {
-	    next if $rpath =~ m,^/usr/lib/(games/)?\Q$pkg\E(?:/|\z),;
+	    next if $rpath =~ m,^/usr/lib/(?:games/)?\Q$pkg\E(?:/|\z),;
 	    next if $rpath =~ m,^\$ORIGIN$,;
 	    next if $directories{$rpath};
 	    tag "binary-or-shlib-defines-rpath", "$file $rpath";
@@ -262,7 +262,7 @@ foreach my $file (sort keys %{$info->file_info}) {
     }
 
     # Something other than detached debugging symbols in /usr/lib/debug paths.
-    if ($file =~ m,^\./usr/lib/debug/(lib\d*|s?bin|usr|opt|dev|emul)/,) {
+    if ($file =~ m,^\./usr/lib/debug/(?:lib\d*|s?bin|usr|opt|dev|emul)/,) {
 	if (exists($objdump->{NEEDED})) {
 	    tag "debug-file-should-use-detached-symbols", $file;
 	}
@@ -284,7 +284,7 @@ foreach my $file (sort keys %{$info->file_info}) {
 	    next if ($objdump->{KLIBC});
 	    # Location of debugging symbols:
 	    next if ($file =~ m%^./usr/lib/debug/%);
-	    next if ($file =~ /(\.|-)static$/);
+	    next if ($file =~ /(?:\.|-)static$/);
 	    next if ($pkg =~ /-static$/);
 	    tag "statically-linked-binary", "$file";
 	}
@@ -323,7 +323,7 @@ $depends =~ s/\n/ /g;
 
 # Check for a libc dependency.
 if ($needs_depends_line) {
-    if ($depends && $needs_libc && $pkg !~ /^libc[\d.]+(-|\z)/) {
+    if ($depends && $needs_libc && $pkg !~ /^libc[\d.]+(?:-|\z)/) {
         # Match libcXX or libcXX-*, but not libc3p0.
         my $re = qr/(?:^|,)\s*\Q$needs_libc\E\b/;
         if ($depends !~ /$re/) {
diff --git a/checks/changelog-file b/checks/changelog-file
index f785a2d..f02895a 100644
--- a/checks/changelog-file
+++ b/checks/changelog-file
@@ -94,7 +94,7 @@ foreach (sort keys %{$info->index}) {
 	push(@doc_files, $file);
 
 	# Check a few things about the NEWS.Debian file.
-	if ($file =~ /^NEWS.Debian(\.gz)?$/i) {
+	if ($file =~ /^NEWS.Debian(?:\.gz)?$/i) {
 	    if (not $file =~ /\.gz$/) {
 		tag "debian-news-file-not-compressed", "$file1";
 	    } elsif ($file ne 'NEWS.Debian.gz') {
@@ -106,7 +106,7 @@ foreach (sort keys %{$info->index}) {
 	# an open question here what we should do with a file named ChangeLog.
 	# If there's also a changelog file, it might be a duplicate, or the
 	# packager may have installed NEWS as changelog intentionally.
-	next unless $file =~ m/^changelog(\.html)?(\.gz)?$|changelog.Debian(\.gz)?$/;
+	next unless $file =~ m/^changelog(?:\.html)?(?:\.gz)?$|changelog.Debian(?:\.gz)?$/;
 
 	if (not $file =~ m/\.gz$/) {
 	    tag "changelog-file-not-compressed", "$file";
@@ -124,10 +124,10 @@ foreach (sort keys %{$info->index}) {
 	    }
 	}
 
-	if ($file =~ m/^changelog\.html(\.gz)?$/ ) {
+	if ($file =~ m/^changelog\.html(?:\.gz)?$/ ) {
 	    $found_html = 1;
 	}
-	if ($file =~ m/^changelog(\.gz)?$/ ) {
+	if ($file =~ m/^changelog(?:\.gz)?$/ ) {
 	    $found_text = 1;
 	}
     }
@@ -186,9 +186,9 @@ $foreign_pkg = (!$native_pkg and $version !~ m/-0\./);
 if ($native_pkg) {
     my @foo;
     # native Debian package
-    if (grep m/^changelog(\.gz)?$/,@doc_files) {
+    if (grep m/^changelog(?:\.gz)?$/,@doc_files) {
 	# everything is fine
-    } elsif (@foo = grep m/^changelog\.debian(\.gz)$/i,@doc_files) {
+    } elsif (@foo = grep m/^changelog\.debian(?:\.gz)$/i,@doc_files) {
 	tag "wrong-name-for-changelog-of-native-package", "usr/share/doc/$pkg/$foo[0]";
     } else {
 	tag "changelog-file-missing-in-native-package", "";
@@ -198,7 +198,7 @@ if ($native_pkg) {
 
     # 1. check for upstream changelog
     my $found_upstream_text_changelog = 0;
-    if (grep m/^changelog(\.html)?(\.gz)?$/,@doc_files) {
+    if (grep m/^changelog(\.html)?(?:\.gz)?$/,@doc_files) {
 	$found_upstream_text_changelog = 1 unless $1;
 	# everything is fine
     } else {
@@ -217,7 +217,7 @@ if ($native_pkg) {
     }
 
     # 2. check for Debian changelog
-    if (grep m/^changelog\.Debian(\.gz)?$/,@doc_files) {
+    if (grep m/^changelog\.Debian(?:\.gz)?$/,@doc_files) {
 	# everything is fine
     } elsif (my @foo = grep m/^changelog\.debian(\.gz)?$/i,@doc_files) {
 	tag "wrong-name-for-debian-changelog-file", "usr/share/doc/$pkg/$foo[0]";
@@ -329,10 +329,10 @@ if (@entries) {
         ($version) = (split('-', $entry->Version))[-1];
     }
     unless (not $info->native and $version =~ /\./) {
-        if ($info->native and $version =~ /testing|(un)?stable/i) {
+        if ($info->native and $version =~ /testing|(?:un)?stable/i) {
             tag 'version-refers-to-distribution', $entry->Version;
         } elsif ($version =~ /woody|sarge|etch|lenny|squeeze/) {
-            if ($entry->Distribution =~ /^(unstable|experimental)$/) {
+            if ($entry->Distribution =~ /^(?:unstable|experimental)$/) {
                 tag 'version-refers-to-distribution', $entry->Version;
             }
         }
diff --git a/checks/files b/checks/files
index 690fbb3..096515a 100644
--- a/checks/files
+++ b/checks/files
@@ -194,7 +194,7 @@ foreach my $file (sort keys %{$info->index}) {
     # /usr/share/gtk-doc/html.  We therefore look for any links in one of
     # those directories to another directory.  The presence of such a link
     # blesses any file below that other directory.
-    if (defined $link and $file =~ m,usr/share/(devhelp/books|gtk-doc/html)/,) {
+    if (defined $link and $file =~ m,usr/share/(?:devhelp/books|gtk-doc/html)/,) {
 	my $blessed = $link;
 	if ($blessed !~ m,^/,) {
 	    my $base = $file;
@@ -213,7 +213,7 @@ foreach my $file (sort keys %{$info->index}) {
 	    tag "package-uses-obsolete-file", "$file";
 	}
 	# ---------------- /etc/cron.daily, etc.
-	elsif ($file =~ m,^etc/cron\.(daily|hourly|monthly|weekly)/[^\.].*\., ) {
+	elsif ($file =~ m,^etc/cron\.(?:daily|hourly|monthly|weekly)/[^\.].*\., ) {
 	    tag "run-parts-cron-filename-contains-full-stop", "$file";
 	}
 	# ---------------- /etc/cron.d
@@ -231,7 +231,7 @@ foreach my $file (sort keys %{$info->index}) {
 	}
 	# ---------------- /etc/init.d
 	elsif ($file =~ m,^etc/init\.d/\S,
-	       and $file !~ m,^etc/init\.d/(README|skeleton)$,
+	       and $file !~ m,^etc/init\.d/(?:README|skeleton)$,
 	       and $operm != 0755
 	       and $index_info->{type} =~ m,^[-h],) {
 	    tag "non-standard-file-permissions-for-etc-init.d-script",
@@ -242,11 +242,11 @@ foreach my $file (sort keys %{$info->index}) {
 	    tag "config-file-reserved", "$file by libpam-runtime";
 	}
 	# ---------------- /etc/rc.d
-	elsif ($type ne 'udeb' and $file =~ m,^etc/rc\.d/\S, and $pkg !~ /^(sysvinit|file-rc)$/) {
+	elsif ($type ne 'udeb' and $file =~ m,^etc/rc\.d/\S, and $pkg !~ /^(?:sysvinit|file-rc)$/) {
 	    tag "package-installs-into-etc-rc.d", "$file";
 	}
 	# ---------------- /etc/rc?.d
-	elsif ($type ne 'udeb' and $file =~ m,^etc/rc(\d|S)\.d/\S, and $pkg !~ /^(sysvinit|file-rc)$/) {
+	elsif ($type ne 'udeb' and $file =~ m,^etc/rc(?:\d|S)\.d/\S, and $pkg !~ /^(?:sysvinit|file-rc)$/) {
 	    tag "package-installs-into-etc-rc.d", "$file";
 	}
 	# ---------------- /etc/rc.boot
@@ -273,7 +273,7 @@ foreach my $file (sort keys %{$info->index}) {
 
 		# executable in /usr/share/doc ?
 		if ($index_info->{type} =~ m/^[-h]/ and
-		    $file !~ m,^usr/share/doc/([^/]+/)?examples/, and
+		    $file !~ m,^usr/share/doc/(?:[^/]+/)?examples/, and
 		    ($operm & 01 or $operm & 010 or $operm & 0100)) {
 		    if ($script{$file}) {
 			tag "script-in-usr-share-doc", "$file";
@@ -287,9 +287,9 @@ foreach my $file (sort keys %{$info->index}) {
 		    # Exceptions: examples may contain empty files for various
 		    # reasons, Doxygen generates empty *.map files, and Python
 		    # uses __init__.py to mark module directories.
-		    unless ($file =~ m,^usr/share/doc/([^/]+/)?examples/,
-			    or $file =~ m,^usr/share/doc/(.+/)?html/.*\.map$,
-			    or $file =~ m,^usr/share/doc/(.+/)?__init__\.py$,) {
+		    unless ($file =~ m,^usr/share/doc/(?:[^/]+/)?examples/,
+			    or $file =~ m,^usr/share/doc/(?:.+/)?html/.*\.map$,
+			    or $file =~ m,^usr/share/doc/(?:.+/)?__init__\.py$,) {
 			tag "zero-byte-file-in-doc-directory", "$file";
 		    }
 		}
@@ -308,10 +308,10 @@ foreach my $file (sort keys %{$info->index}) {
 		}
 
 		# contains a README for another distribution/platform?
-		if ($file =~ m,^usr/share/doc/$tmp/readme\.(apple|aix|atari|be|beos|bsd|bsdi|
+		if ($file =~ m,^usr/share/doc/$tmp/readme\.(?:apple|aix|atari|be|beos|bsd|bsdi|
 		                cygwin|darwin|irix|gentoo|freebsd|mac|macos|macosx|netbsd|
 				openbsd|osf|redhat|sco|sgi|solaris|suse|sun|vms|win32|win9x|
-				windows)(\.txt)?(\.gz)?$,xi){
+				windows)(?:\.txt)?(?:\.gz)?$,xi){
 		    tag "package-contains-readme-for-other-platform-or-distro", "$file";
 		}
 	    }
@@ -378,15 +378,15 @@ foreach my $file (sort keys %{$info->index}) {
 	elsif ($file =~ m,^usr/lib/perl.*/.packlist$,) {
 	    tag "package-installs-packlist", "$file";
 	}
-	elsif ($file =~ m,^usr/lib/perl5/.*\.(pl|pm)$,) {
+	elsif ($file =~ m,^usr/lib/perl5/.*\.(?:pl|pm)$,) {
 	    push @nonbinary_perl_files_in_lib, $file;
 	}
-	elsif ($file =~ m,^usr/lib/perl5/.*\.(bs|so)$,) {
+	elsif ($file =~ m,^usr/lib/perl5/.*\.(?:bs|so)$,) {
 	    $has_binary_perl_file = 1;
 	}
 	# ---------------- /usr/lib -- needs to go after the other usr/lib/*
 	elsif ($file =~ m,^usr/lib/,) {
-	    if ($type ne 'udeb' and $file =~ m,\.(gif|jpeg|jpg|png|tiff|xpm|xbm)$, and not defined $link) {
+	    if ($type ne 'udeb' and $file =~ m,\.(?:gif|jpeg|jpg|png|tiff|xpm|xbm)$, and not defined $link) {
 		tag "image-file-in-usr-lib", "$file"
 	    }
 	}
@@ -405,7 +405,7 @@ foreach my $file (sort keys %{$info->index}) {
 	    }
 	    if ($index_info->{type} =~ m/^d/) {
 		tag "stray-directory-in-manpage-directory", "$file"
-		    if ($file !~ m,^usr/(X11R6|share)/man/(?:[^/]+/)?(man\d/)?$,);
+		    if ($file !~ m,^usr/(?:X11R6|share)/man/(?:[^/]+/)?(?:man\d/)?$,);
 	    } elsif ($index_info->{type} =~ m,^[-h], and
 		($operm & 01 or $operm & 010 or $operm & 0100)) {
 		tag "executable-manpage", "$file";
@@ -429,17 +429,17 @@ foreach my $file (sort keys %{$info->index}) {
 	}
         # ---------------- /usr/bin
 	elsif ($file =~ m,^usr/bin/,) {
-	    if ($index_info->{type} =~ m/^d/ and $file =~ m,^usr/bin/., and $file !~ m,^usr/bin/(X11|mh)/,) {
+	    if ($index_info->{type} =~ m/^d/ and $file =~ m,^usr/bin/., and $file !~ m,^usr/bin/(?:X11|mh)/,) {
 		tag "subdir-in-usr-bin", "$file";
 	    }
 	}
 	# ---------------- /usr subdirs
 	elsif ($type ne 'udeb' and $file =~ m,^usr/[^/]+/$,) { # FSSTND dirs
-	    if ( $file =~ m,^usr/(dict|doc|etc|info|man|adm|preserve)/,) {
+	    if ( $file =~ m,^usr/(?:dict|doc|etc|info|man|adm|preserve)/,) {
 		tag "FSSTND-dir-in-usr", "$file";
 	    }
 	    # FHS dirs
-	    elsif ($file !~ m,^usr/(X11R6|X386|
+	    elsif ($file !~ m,^usr/(?:X11R6|X386|
 				    bin|games|include|
 				    lib|lib32|lib64|
 				    local|sbin|share|
@@ -479,11 +479,11 @@ foreach my $file (sort keys %{$info->index}) {
     }
     # ---------------- /var subdirs
     elsif ($type ne 'udeb' and $file =~ m,^var/[^/]+/$,) { # FSSTND dirs
-	if ( $file =~ m,^var/(adm|catman|named|nis|preserve)/, ) {
+	if ( $file =~ m,^var/(?:adm|catman|named|nis|preserve)/, ) {
 	    tag "FSSTND-dir-in-var", "$file";
 	}
 	# FHS dirs with exception in Debian policy
-	elsif ( $file !~ m,^var/(account|lib|cache|crash|games|lock|log|opt|run|spool|state|tmp|www|yp)/,) {
+	elsif ( $file !~ m,^var/(?:account|lib|cache|crash|games|lock|log|opt|run|spool|state|tmp|www|yp)/,) {
 	    tag "non-standard-dir-in-var", "$file";
 	}
     }
@@ -507,7 +507,7 @@ foreach my $file (sort keys %{$info->index}) {
 	next;
     }
     # ---------------- /tmp, /var/tmp, /usr/tmp
-    elsif ($file =~ m,^tmp/., or $file =~ m,^(var|usr)/tmp/.,) {
+    elsif ($file =~ m,^tmp/., or $file =~ m,^(?:var|usr)/tmp/.,) {
 	tag "dir-or-file-in-tmp", "$file";
     }
     # ---------------- /mnt
@@ -526,7 +526,7 @@ foreach my $file (sort keys %{$info->index}) {
     }
     # ---------------- FHS directory?
     elsif ($file =~ m,^[^/]+/$, and $file ne './' and
-	   $file !~ m,^(bin|boot|dev|etc|home|lib(64|32)?|mnt|opt|root|sbin|srv|tmp|usr|var)/,) {
+	   $file !~ m,^(?:bin|boot|dev|etc|home|lib(?:64|32)?|mnt|opt|root|sbin|srv|tmp|usr|var)/,) {
 	# Make an exception for the base-files package here and other similar
 	# packages because they install a slew of top-level directories for
 	# setting up the base system.  (Specifically, /cdrom, /floppy,
@@ -537,13 +537,13 @@ foreach my $file (sort keys %{$info->index}) {
 	tag "non-standard-toplevel-dir", "$file"
 	    unless $pkg eq 'base-files'
 		or $pkg eq 'hurd'
-		or $pkg =~ /^rootskel(-bootfloppy)?/
+		or $pkg =~ /^rootskel(?:-bootfloppy)?/
 		or $file =~ m,^emul/,;
     }
 
     # ---------------- compatibility symlinks should not be used
-    if ($file =~ m,^usr/(spool|tmp)/, or
-	$file =~ m,^usr/(doc|bin)/X11/, or
+    if ($file =~ m,^usr/(?:spool|tmp)/, or
+	$file =~ m,^usr/(?:doc|bin)/X11/, or
 	$file =~ m,^var/adm/,) {
 	tag "use-of-compat-symlink", "$file";
     }
@@ -556,18 +556,18 @@ foreach my $file (sort keys %{$info->index}) {
     # ---------------- any files
     if ($index_info->{type} !~ m/^d/) {
 	unless ($type eq 'udeb'
-		or $file =~ m,^usr/(bin|dict|doc|games|
-				    include|info|lib(32|64)?|
+		or $file =~ m,^usr/(?:bin|dict|doc|games|
+				    include|info|lib(?:32|64)?|
 				    man|sbin|share|src|X11R6)/,x
-		or $file =~ m,^lib(32|64)?/(modules/|libc5-compat/)?,
-		or $file =~ m,^var/(games|lib|www|named)/,
-		or $file =~ m,^(bin|boot|dev|etc|sbin)/,
+		or $file =~ m,^lib(?:32|64)?/(?:modules/|libc5-compat/)?,
+		or $file =~ m,^var/(?:games|lib|www|named)/,
+		or $file =~ m,^(?:bin|boot|dev|etc|sbin)/,
 		# non-FHS, but still usual
 		or $file =~ m,^usr/[^/]+-linux[^/]*/,
 		or $file =~ m,^usr/iraf/,
-		or $file =~ m,^emul/ia32-linux/(lib|usr/lib)/,
+		or $file =~ m,^emul/ia32-linux/(?:lib|usr/lib)/,
 		# not allowed, but tested indivudually
-		or $file =~ m,^(mnt|opt|srv|((usr|var)/)?tmp)|var/www/,) {
+		or $file =~ m,^(?:mnt|opt|srv|(?:(?:usr|var)/)?tmp)|var/www/,) {
 	    tag "file-in-unusual-dir", "$file";
 	}
     }
@@ -589,21 +589,21 @@ foreach my $file (sort keys %{$info->index}) {
 	unless (defined $is_python) {
 	    $is_python = 0;
 	    if (defined $info->field('source')) {
-		$_ = $info->field('source');
-		$is_python = 1 if /^python(\d\.\d)?($|\s)/;
+		local $_ = $info->field('source');
+		$is_python = 1 if /^python(?:\d\.\d)?(?:$|\s)/;
 	    }
 	}
 	tag "third-party-package-in-python-dir", "$file"
 	    unless $is_python;
     }
     # ---------------- perl modules
-    if ($file =~ m,^usr/(share|lib)/perl/\S,) {
+    if ($file =~ m,^usr/(?:share|lib)/perl/\S,) {
        # check if it's the "perl" package itself
        unless (defined $is_perl) {
            $is_perl = 0;
 	   if (defined $info->field('source')) {
-               $_ = $info->field('source');;
-               $is_perl = 1 if /^perl($|\s)/;
+               local $_ = $info->field('source');;
+               $is_perl = 1 if /^perl(?:$|\s)/;
            }
        }
        tag "perl-module-in-core-directory", "$file"
@@ -611,7 +611,7 @@ foreach my $file (sort keys %{$info->index}) {
     }
 
     # ---------------- license files
-    if ($file =~ m,(copying|licen[cs]e)(\.[^/]+)?$,i
+    if ($file =~ m,(?:copying|licen[cs]e)(?:\.[^/]+)?$,i
 	# Ignore some common extensions; there was at least one file named
 	# "license.el".  These are probably license-displaying code, not
 	# license files.  Also ignore binaries in /usr/bin and friends.
@@ -628,20 +628,20 @@ foreach my $file (sort keys %{$info->index}) {
 	#
 	# Ignore extra license files in examples, since various package
 	# building software includes example packages with licenses.
-	and not $file =~ m/\.(el|c|h|py|cc|pl|pm|html|php|rb|xpm|png|jpe?g|gif|svg|dtd)$/
-	and not $file =~ m,^usr/share/zope/Products/.*\.(dtml|pt|cpt)$,
+	and not $file =~ m/\.(?:el|c|h|py|cc|pl|pm|html|php|rb|xpm|png|jpe?g|gif|svg|dtd)$/
+	and not $file =~ m,^usr/share/zope/Products/.*\.(?:dtml|pt|cpt)$,
 	and not $file =~ m,/under\S+License\.docbook$,
-	and not $file =~ m,^(usr/)?s?bin/,
+	and not $file =~ m,^(?:usr/)?s?bin/,
 	and not $file =~ m,^usr/share/doc/[^/]+/examples/,
 	and not defined $link) {
 	tag "extra-license-file", "$file";
     }
 
     # ---------------- .devhelp2? files
-    if ($file =~ m,\.devhelp2?(\.gz)?$,
+    if ($file =~ m,\.devhelp2?(?:\.gz)?$,
 	# If the file is located in a directory not searched by devhelp, we
 	# check later to see if it's in a symlinked directory.
-	and not $file =~ m,^usr/share/(devhelp/books|gtk-doc/html)/,
+	and not $file =~ m,^usr/share/(?:devhelp/books|gtk-doc/html)/,
 	and not $file =~ m,^usr/share/doc/[^/]+/examples/,) {
 	push (@devhelp, $file);
     }
@@ -653,7 +653,7 @@ foreach my $file (sort keys %{$info->index}) {
 
     # ---------------- misplaced lintian overrides
     my $tmp = quotemeta($pkg);
-    if ($file =~ m,^usr/share/doc/$tmp/override\.[lL]intian(\.gz)?$, or
+    if ($file =~ m,^usr/share/doc/$tmp/override\.[lL]intian(?:\.gz)?$, or
 	$file =~ m,^usr/share/lintian/overrides/$tmp/.+,) {
 	tag "override-file-in-wrong-location", "$file";
     }
@@ -670,7 +670,7 @@ foreach my $file (sort keys %{$info->index}) {
 	}
 
 	# ---------------- vcs control files
-	if ($file =~ m/\.((cvs|git|hg)ignore|arch-inventory|hgtags|hg_archival\.txt)$/) {
+	if ($file =~ m/\.(?:(?:cvs|git|hg)ignore|arch-inventory|hgtags|hg_archival\.txt)$/) {
 	    tag "package-contains-vcs-control-file", "$file";
 	}
 
@@ -683,21 +683,21 @@ foreach my $file (sort keys %{$info->index}) {
 	}
 
 	# ---------------- executables with language extensions
-	if ($file =~ m,^(usr/)?(s?bin|games)/[^/]+\.(pl|sh|py|php|rb|tcl|bsh|csh|tcl)$,) {
+	if ($file =~ m,^(?:usr/)?(?:s?bin|games)/[^/]+\.(?:pl|sh|py|php|rb|tcl|bsh|csh|tcl)$,) {
 	    tag "script-with-language-extension", "$file";
 	}
 
 	# ---------------- Devel files for Windows
-	if ($file =~ m,/.+\.(vcproj|sln|dsp|dsw)(\.gz)?$,
+	if ($file =~ m,/.+\.(?:vcproj|sln|dsp|dsw)(?:\.gz)?$,
 	    and $file !~ m,^usr/share/doc/,) {
 	    tag "windows-devel-file-in-package", "$file";
 	}
 
 	# ---------------- Autogenerated databases from other OSes
-	if ($file =~ m,/Thumbs\.db(\.gz)?$,i) {
+	if ($file =~ m,/Thumbs\.db(?:\.gz)?$,i) {
 	    tag "windows-thumbnail-database-in-package", "$file";
 	}
-	if ($file =~ m,/\.DS_Store(\.gz)?$,) {
+	if ($file =~ m,/\.DS_Store(?:\.gz)?$,) {
 	    tag "macos-ds-store-file-in-package", "$file";
 	}
 	if ($file =~ m,/\._[^_/][^/]*$, and $file !~ m/\.swp$/) {
@@ -842,7 +842,7 @@ foreach my $file (sort keys %{$info->index}) {
     elsif ($index_info->{type} =~ m/^d/) {
 	# special cases first:
         # game directory with setgid bit
-	if ($file =~ m,var/(lib/)?games/\S+, and $operm == 02775
+	if ($file =~ m,var/(?:lib/)?games/\S+, and $operm == 02775
             and $owner =~ m,root/games,) {
             # do nothing, this is allowed, but not mandatory
         }
@@ -854,14 +854,14 @@ foreach my $file (sort keys %{$info->index}) {
 	if ($file =~ m,/CVS/?$,) {
 	    tag "package-contains-vcs-control-dir", "$file";
 	}
-	if ($file =~ m,/\.(svn|bzr|git|hg)/?$,) {
+	if ($file =~ m,/\.(?:svn|bzr|git|hg)/?$,) {
 	    tag "package-contains-vcs-control-dir", "$file";
 	}
 	if (($file =~ m,/\.arch-ids/?$,)
 	    || ($file =~ m,/\{arch\}/?$,)) {
 	    tag "package-contains-vcs-control-dir", "$file";
 	}
-	if ($file =~ m,/\.(be|ditrack)/?$,) {
+	if ($file =~ m,/\.(?:be|ditrack)/?$,) {
 	    tag "package-contains-bts-control-dir", "$file";
 	}
 	if ($file =~ m,/.xvpics/?$,) {

-- 
Debian package checker


Reply to: