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

[SCM] Debian package checker branch, master, updated. 2.5.4-79-gf85b0cf



The following commit has been merged in the master branch:
commit f85b0cfe5e02b247c0dad994720940187d891d5c
Author: Niels Thykier <niels@thykier.net>
Date:   Fri Dec 23 21:21:03 2011 +0100

    Support architecture wildcards in arch specific overrides
    
    Also sanity architectures used in architecture specific overrides.
    Reject overrides for unknown architectures and for "arch:all"
    packages.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/debian/changelog b/debian/changelog
index f7db5db..97569a8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -160,6 +160,10 @@ lintian (2.5.5) UNRELEASED; urgency=low
   * lib/Lintian/Tag/Info.pm:
     + [NT] Accepted patch from Evan Broder to always output effective
       severity in tag descriptions.
+  * lib/Lintian/Tags.pm:
+    + [NT] Support architecture wildcards in overrides.
+    + [NT] Emit "malformed-override" for architecture specific tags for
+      unknown architectures and for "arch:all" packages.
 
   * reporting/harness:
     + [NT] Removed useless "TODO" message from the log output.
diff --git a/lib/Lintian/Tags.pm b/lib/Lintian/Tags.pm
index 87c4265..dad5e3e 100644
--- a/lib/Lintian/Tags.pm
+++ b/lib/Lintian/Tags.pm
@@ -22,6 +22,7 @@ package Lintian::Tags;
 use strict;
 use warnings;
 
+use Lintian::Architecture qw(:all);
 use Lintian::Output;
 use Lintian::Tag::Info;
 use Lintian::Tag::Override;
@@ -536,6 +537,7 @@ sub file_overrides {
     open(my $file, '<', $overrides)
         or fail("cannot open override file $overrides: $!");
     local $_;
+  OVERRIDE:
     while (<$file>) {
         s/^\s+//;
         s/\s+$//;
@@ -568,6 +570,10 @@ sub file_overrides {
             my $tagover;
             my $com;
             my $data;
+            if ($info->{arch} eq 'all' && $archlist) {
+                tag 'malformed-override', $_, 'Architecture list for arch:all package';
+                next;
+            }
             if ($archlist) {
                 # parse and figure
                 my (@archs) = split(m/\s++/o, $archlist);
@@ -575,7 +581,14 @@ sub file_overrides {
                 my $found = 0;
                 foreach my $a (@archs){
                     $negated++ if $a =~ s/^!//o;
-                    $found = 1 if $a eq $info->{arch};
+                    if (is_arch_wildcard ($a)) {
+                        $found = 1 if wildcard_includes_arch ($a, $info->{arch});
+                    } elsif (is_arch ($a)) {
+                        $found = 1 if $a eq $info->{arch};
+                    } else {
+                        tag 'malformed-override', $_, "Unknown architecture \"$a\"";
+                        next OVERRIDE;
+                    }
                 }
                 if ($negated > 0 && scalar @archs != $negated){
                     # missing a ! somewhere
diff --git a/t/tests/overrides-shown/debian/debian/overrides-shown.lintian-overrides b/t/tests/overrides-shown/debian/debian/overrides-shown.lintian-overrides
index 06165a4..f8df12f 100644
--- a/t/tests/overrides-shown/debian/debian/overrides-shown.lintian-overrides
+++ b/t/tests/overrides-shown/debian/debian/overrides-shown.lintian-overrides
@@ -4,9 +4,8 @@
 
 # override without extra information
 manpage-has-bad-whatis-entry
-# Architecture specific override - which is retarded considering
-# it is an arch: all package we are testing >.>
-[i386]: hyphen-used-as-minus-sign usr/share/man/man1/foo.1.gz:12
+# Architecture specific override
+[i386]: hyphen-used-as-minus-sign usr/share/man/man1/foo.1.gz:6
 [!i386]: hyphen-used-as-minus-sign usr/share/man/man1/foo.1.gz:6
 # exact extra information
 hyphen-used-as-minus-sign usr/share/man/man1/foo.1.gz:4
diff --git a/t/tests/overrides-shown/desc b/t/tests/overrides-shown/desc
index aa73544..3becd5f 100644
--- a/t/tests/overrides-shown/desc
+++ b/t/tests/overrides-shown/desc
@@ -3,4 +3,5 @@ Sequence: 1500
 Version: 1.0
 Options: --show-overrides -I -E
 Sort: no
+Architecture: any
 Description: Test override handling
diff --git a/t/tests/overrides-shown/tags b/t/tests/overrides-shown/tags
index 6cf70c0..2981ef3 100644
--- a/t/tests/overrides-shown/tags
+++ b/t/tests/overrides-shown/tags
@@ -4,8 +4,7 @@ N: exact extra information
 O: overrides-shown: hyphen-used-as-minus-sign usr/share/man/man1/foo.1.gz:4
 N: These are wildcard overrides
 O: overrides-shown: hyphen-used-as-minus-sign usr/share/man/man1/foo.1.gz:5
-N: Architecture specific override - which is retarded considering
-N: it is an arch: all package we are testing >.>
+N: Architecture specific override
 O: overrides-shown: hyphen-used-as-minus-sign usr/share/man/man1/foo.1.gz:6
 I: overrides-shown: hyphen-used-as-minus-sign usr/share/man/man1/foo.1.gz:12
 I: overrides-shown: hyphen-used-as-minus-sign usr/share/man/man1/foo.1.gz:13
diff --git a/t/tests/overrides/debian/debian/overrides.lintian-overrides b/t/tests/overrides/debian/debian/overrides.lintian-overrides
index 854c581..eff3986 100644
--- a/t/tests/overrides/debian/debian/overrides.lintian-overrides
+++ b/t/tests/overrides/debian/debian/overrides.lintian-overrides
@@ -1,8 +1,7 @@
 # override without extra information
 manpage-has-bad-whatis-entry
-# Architecture specific override - which is retarded considering
-# it is an arch: all package we are testing >.>
-[i386]: hyphen-used-as-minus-sign usr/share/man/man1/foo.1.gz:12
+# Architecture specific override
+[i386]: hyphen-used-as-minus-sign usr/share/man/man1/foo.1.gz:6
 [!i386]: hyphen-used-as-minus-sign usr/share/man/man1/foo.1.gz:6
 # exact extra information
 hyphen-used-as-minus-sign usr/share/man/man1/foo.1.gz:4
diff --git a/t/tests/overrides/desc b/t/tests/overrides/desc
index 3699736..e27a624 100644
--- a/t/tests/overrides/desc
+++ b/t/tests/overrides/desc
@@ -2,3 +2,4 @@ Testname: overrides
 Sequence: 1500
 Version: 1.0
 Description: Test override handling
+Architecture: any

-- 
Debian package checker


Reply to: