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

[SCM] Debian package checker branch, master, updated. 2.2.6-82-g8478b06



The following commit has been merged in the master branch:
commit 919eda71f107dbf5f87f390910696c6d553b2951
Author: Russ Allbery <rra@debian.org>
Date:   Sun Mar 8 20:49:20 2009 -0700

    Revert "Be robust against whitespace in fields"
    
    This reverts commit 9cddb282922e2282cc078b2980aff6832188a343 but keeps
    some of the cleanups.  The code that reads control files now strips
    leading and trailing whitespace from fields, so each check doesn't
    need to deal with this.
    
    Conflicts:
    
    	checks/version-substvars
    	debian/changelog

diff --git a/checks/binaries b/checks/binaries
index d48ba66..5b391b6 100644
--- a/checks/binaries
+++ b/checks/binaries
@@ -75,8 +75,6 @@ my $has_perl_lib = 0;
 my %SONAME;
 
 $arch = $info->field('architecture');
-$arch =~ s/^\s+//;
-$arch =~ s/\s+$//;
 
 foreach my $file (sort keys %{$info->objdump_info}) {
     my $objdump = $info->objdump_info->{$file};
diff --git a/checks/cruft b/checks/cruft
index a7f2dbe..209e22d 100644
--- a/checks/cruft
+++ b/checks/cruft
@@ -101,7 +101,7 @@ if ($info->native) {
 my $arch;
 if (defined $info->field('architecture')) {
     my $arch = $info->field('architecture');
-    if ($pkg =~ /-docs?$/ && $arch !~ /^\s*all\s*$/) {
+    if ($pkg =~ /-docs?$/ && $arch ne 'all') {
         tag 'documentation-package-not-architecture-independent';
     }
 }
diff --git a/checks/fields b/checks/fields
index b7903a2..d49d01d 100644
--- a/checks/fields
+++ b/checks/fields
@@ -674,7 +674,7 @@ if ($type eq "source") {
 	my $arch_dep_packages = 0;
 	foreach my $binpkg (keys %$binpkgs) {
 		my $arch = $info->binary_field($binpkg, 'architecture');
-		if ($arch =~ /^\s*all\s*$/) {
+		if ($arch eq 'all') {
 			$arch_indep_packages++;
 		} else {
 			$arch_dep_packages++;
@@ -903,7 +903,7 @@ if ($type eq "source") {
 	foreach my $binpkg (keys %$binpkgs) {
 		if ($binpkg =~ m/-dbg$/) {
 			push @dbg_pkgs, $binpkg;
-		} elsif ($info->binary_field($binpkg, 'architecture') !~ /^\s*all\s*$/) {
+		} elsif ($info->binary_field($binpkg, 'architecture') ne 'all') {
 			push @arch_dep_pkgs, $binpkg;
 		}
 	}
@@ -923,7 +923,7 @@ if (defined $info->field('origin')) {
 
 	unfold('origin', \$origin);
 
-	tag "redundant-origin-field" if lc($origin) eq 'debian';
+	tag "redundant-origin-field", "" if lc($origin) eq 'debian';
 }
 
 #----- Bugs
@@ -1060,8 +1060,6 @@ sub unfold {
 	if ($$line =~ s/\n//g) {
 		tag "multiline-field", "$field";
 	}
-	$$line =~ s/^\s+//;
-	$$line =~ s/\s+$//;
 }
 
 1;
diff --git a/checks/huge-usr-share b/checks/huge-usr-share
index 85638d3..9e3b96f 100644
--- a/checks/huge-usr-share
+++ b/checks/huge-usr-share
@@ -34,9 +34,11 @@ my $pkg = shift;
 my $type = shift;
 my $info = shift;
 
+my $arch;
+
 # Skip architecture-dependent packages.
 my $arch = $info->field('architecture') || '';
-return 0 if $arch =~ /^\s*all\s*$/;
+return 0 if $arch eq 'all';
 
 # usr/share missing. other checks will moan about it
 # so just ignore this package
diff --git a/checks/nmu b/checks/nmu
index 995ac7c..51fc6f6 100644
--- a/checks/nmu
+++ b/checks/nmu
@@ -73,7 +73,6 @@ if ($firstline) {
 }
 
 my $version = $info->field("version");
-$version =~ s/\s*$//;
 my $maintainer = canonicalize($info->field("maintainer"));
 my $uploaders = $info->field("uploaders");
 
diff --git a/checks/rules b/checks/rules
index 37e2e2e..a598f64 100644
--- a/checks/rules
+++ b/checks/rules
@@ -52,7 +52,7 @@ unless (-d "fields") {
     fail("directory in lintian laboratory for $type package $pkg missing: fields");
 }
 
-my $architecture = $info->field('architecture') || "";
+my $architecture = $info->field('architecture') || '';
 
 open(RULES, '<', 'debfiles/rules') or fail("Failed opening rules: $!");
 
@@ -162,7 +162,7 @@ unless ($includes) {
 
 # Make sure we have no content for binary-arch if we are arch-indep:
 $rules_per_target{'binary-arch'} ||= [];
-if ($architecture =~ /^\s*all\s*$/ && scalar @{$rules_per_target{'binary-arch'}}) {
+if ($architecture eq "all" && scalar @{$rules_per_target{'binary-arch'}}) {
     my $nonempty = 0;
     foreach (@{$rules_per_target{'binary-arch'}}) {
         # dh binary-arch is actually a no-op if there is no
diff --git a/checks/shared-libs b/checks/shared-libs
index 972455e..486992b 100644
--- a/checks/shared-libs
+++ b/checks/shared-libs
@@ -146,8 +146,6 @@ for my $cur_file (sort keys %{$info->index}) {
 	    if (not defined $objdump->{$cur_file}->{STACK}) {
 		if (defined $info->field('architecture')) {
 		    my $arch = $info->field('architecture');
-		    $arch =~ s/^\s+//;
-		    $arch =~ s/\s+$//;
 		    tag "shlib-without-PT_GNU_STACK-section", $cur_file
 			if $stack_arches{$arch};
 		}
diff --git a/checks/version-substvars b/checks/version-substvars
index b1841b1..d1d0c69 100644
--- a/checks/version-substvars
+++ b/checks/version-substvars
@@ -52,7 +52,7 @@ foreach (keys %$binpkgs) {
 	my ($pkg1, $pkg1_is_any, $pkg2, $pkg2_is_any, $substvar_strips_binNMU);
 
 	$pkg1 = $_;
-	$pkg1_is_any = ($info->binary_field($pkg1, 'architecture') !~ /^\s*all\s*$/);
+	$pkg1_is_any = ($info->binary_field($pkg1, 'architecture') ne 'all');
 
 	foreach my $field (@dep_fields) {
 		next unless $info->binary_field($pkg1, $field);
@@ -76,7 +76,7 @@ foreach (keys %$binpkgs) {
 				unless ($pkg2 =~ /\$\{\S+\}/);
 			next;
 		}
-		$pkg2_is_any = ($info->binary_field($pkg2, 'architecture') !~ m/^\s*all\s*$/);
+		$pkg2_is_any = ($info->binary_field($pkg2, 'architecture') !~ m/^all$/);
 
 		if ($pkg1_is_any) {
 			if ($pkg2_is_any and $substvar_strips_binNMU) {
diff --git a/debian/changelog b/debian/changelog
index 0c1c130..ede9849 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -23,7 +23,6 @@ lintian (2.2.7) UNRELEASED; urgency=low
       Geissert.  (Closes: #318104)
     + [RA] Avoid capturing parentheses in regexes due to their minor
       performance penalty.  Patch from Raphael Geissert.
-    + [RA] Be robust against whitespace in the Architecture field.
     + [RA] Report apparently truncated ELF binaries separately from
       apparently corrupted ones.  The current binutils now distinguishes.
       Patch from Raphael Geissert.  (Closes: #517778)
@@ -51,8 +50,6 @@ lintian (2.2.7) UNRELEASED; urgency=low
       Jarno.  (Closes: #516687)
     + [RA] Don't warn about versionless GPL references if the word version
       appears nowhere in the copyright file.
-  * checks/cruft:
-    + [RA] Be robust against whitespace in the Architecture field.
   * checks/debconf:
     + [ADB] Use Lintian::Relation rather than Dep.
   * checks/debhelper:
@@ -66,8 +63,6 @@ lintian (2.2.7) UNRELEASED; urgency=low
       Geissert.
     + [RA] Load Lintian::Data objects only once.  Patch from Raphael
       Geissert.  Also use all caps for global variables.
-    + [RA] Strip leading and trailing whitespace from fields and simplify
-      other logic to assume that.  Thanks, Gonéri Le Bouder.
     * [RA] Move data from common_data.pm to here and use Lintian::Data to
       get the list of known architectures.  Patch from Raphael Geissert.
   * checks/files{,.desc}:
@@ -82,9 +77,8 @@ lintian (2.2.7) UNRELEASED; urgency=low
       Jorge Vieira (metal).  (Closes: #518684)
     + [RA] Diagnose files ending in *.gz that aren't compressed with
       gzip.  Patch from Raphael Geissert.  (Closes: #518873)
-  * checks/huge-usr-share:
-    + [RA] Simplify architecture checking code and be robust against
-      whitespace in the field.
+    + [RA] Simplify some checks now that we're guaranteed leading and
+      trailing whitespace will be stripped from field values.
   * checks/manpages:
     + [CW] Run man with '-E UTF-8' to avoid producing bogus warnings on
       localised manual pages due to attempting to recode through ASCII.
@@ -105,11 +99,9 @@ lintian (2.2.7) UNRELEASED; urgency=low
       registration is done with triggers.  (Closes: #518801)
   * checks/nmu:
     + [RA] Calculate the regex for Ubuntu distributions only once.
-    + [RA] Be robust against whitespace in the Architecture field.
   * checks/patch-systems:
     + [ADB] Use Lintian::Relation instead of Dep.
   * checks/rules:
-    + [RA] Be robust against whitespace in the Architecture field.
     + [ADB] Remove some obsolete code and therefore stop use-ing Dep.
   * checks/scripts:
     + [ADB] Use Lintian::Relation rather than Dep.
@@ -125,7 +117,6 @@ lintian (2.2.7) UNRELEASED; urgency=low
       alternative dependency templates used meta-information.
     + [ADB] Extend the parsing of dependency templates in symbols files to
       handle ORed dependencies.
-    + [RA] Be robust against whitespace in the Architecture field.
     + [ADB] Use Lintian::Relation rather than Dep.
     + [ADB] Avoid capturing parentheses in regexes due to their minor
       performance penalty.

-- 
Debian package checker


Reply to: