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

[SCM] Debian package checker branch, master, updated. 2.5.2-39-g45b90f1



The following commit has been merged in the master branch:
commit 45b90f13d3a5017bd4ddac950a2c351fa288b204
Author: Niels Thykier <niels@thykier.net>
Date:   Thu Aug 18 17:18:57 2011 +0200

    Inform the user if overrides have been ignored
    
    Lintian will now print an informal message if it sees an override
    for a tag that was marked non-overridable.  This message can be
    silenced with "--quiet" and extended with "--verbose".

diff --git a/debian/changelog b/debian/changelog
index aaa308e..0174e89 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -34,6 +34,12 @@ lintian (2.5.3) UNRELEASED; urgency=low
     + [NT] New file.  Thanks to Jeremiah C. Foster for the initial
       contribution.
 
+  * frontend/lintian:
+    + [NT] Lintian now mentions if overrides may have been ignored.
+      This happens if a package contains an override for a tag
+      that has been marked "non-overridable" by the current vendor
+      profile.
+
   * lib/Util.pm:
     + [JW] Use LC_ALL rather than LANG, since LC_ALL overrules
       LANG.
@@ -43,6 +49,8 @@ lintian (2.5.3) UNRELEASED; urgency=low
     + [JW,NT] Replace use of fail with croak.  (Closes: #637741)
   * lib/Lintian/Profile.pm:
     + [NT] Reject profiles containing an unknown field.
+  * lib/Lintian/Tags.pm:
+    + [NT] Track which tags had overrides that have been dropped.
 
   * private/*:
     + [JW] Use LC_ALL rather than LANG, since LC_ALL overrules
diff --git a/doc/lintian.xml b/doc/lintian.xml
index c3c37aa..1c6ced4 100644
--- a/doc/lintian.xml
+++ b/doc/lintian.xml
@@ -740,8 +740,10 @@ foo source: configure-generated-file-in-source config.cache
               <listitem>
 		<para>
 		  Either "Yes" or "No", which decides whether these
-                  tags can be overriden.  Overrides for these tags
-                  will silently be ignored.
+                  tags can be overriden.  Lintian will print an
+                  informal message if it sees an override for a tag
+                  marked as non-overridable (except if --quiet is
+                  passed).
 		</para>
               </listitem>
             </varlistentry>
diff --git a/frontend/lintian b/frontend/lintian
index 9f867c1..595539c 100755
--- a/frontend/lintian
+++ b/frontend/lintian
@@ -1266,6 +1266,19 @@ if ($action eq 'check' and not $opt{'no-override'} and not $opt{'show-overrides'
     }
 }
 
+my $ign_over = $TAGS->ignored_overrides;
+if (keys %$ign_over) {
+    msg('Some overrides were ignored, since the tags were marked "non-overridable".');
+    if ($opt{'verbose'}) {
+	v_msg('The following tags were "non-overridable" and had at least one override');
+	foreach my $tag (sort keys %$ign_over) {
+	    v_msg("  - $tag");
+	}
+    } else {
+	msg('Use --verbose for more information.');
+    }
+}
+
 # }}}
 
 
diff --git a/lib/Lintian/Tags.pm b/lib/Lintian/Tags.pm
index 78e47a6..57e3184 100644
--- a/lib/Lintian/Tags.pm
+++ b/lib/Lintian/Tags.pm
@@ -154,6 +154,7 @@ sub new {
         display_source       => {},
         files                => {},
         non_overridable_tags => {},
+        ignored_overrides    => {},
         only_issue           => {},
         respect_display      => 1,
         show_experimental    => 0,
@@ -537,7 +538,7 @@ file cannot be opened.
 
 sub file_overrides {
     my ($self, $overrides) = @_;
-    my $ignored = $self->{non_overridable_tags};
+    my $noover = $self->{non_overridable_tags};
     unless (defined $self->{current}) {
         die 'no current file when adding overrides';
     }
@@ -582,7 +583,10 @@ sub file_overrides {
                 }
                 next unless $found;
             }
-            next if $ignored->{$tag};
+            if ( $noover->{$tag} ) {
+                $self->{ignored_overrides}{$tag}++;
+                next;
+            }
             $extra = '' unless defined $extra;
             $info->{overrides}{$tag}{$extra} = 0;
         } else {
@@ -746,13 +750,26 @@ Marks all tags (given as arguments) for non-overridable.
 
 sub non_overridable_tags {
     my ($self, @tags) = @_;
-    my $ignored = $self->{non_overridable_tags};
+    my $noover = $self->{non_overridable_tags};
     foreach my $tag (@tags){
-        $ignored->{$tag} = 1;
+        $noover->{$tag} = 1;
     }
     return 1;
 }
 
+=item ignored_overrides()
+
+Returns a hash of tags, for which overrides have been ignored.  The
+keys are tag names and the value is the number of overrides that has
+been ignored.
+
+=cut
+
+sub ignored_overrides {
+    my ($self) = @_;
+    return $self->{ignored_overrides};
+}
+
 =item respect_display_level([BOOL])
 
 Whether or not the display level should be considered for

-- 
Debian package checker


Reply to: