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

[SCM] Debian package checker branch, vendor-profile, updated. 2.5.0-33-g1a35a45



The following commit has been merged in the vendor-profile branch:
commit 1a35a4558af31f1efafb7d6b5c3209199d039aa4
Author: Niels Thykier <niels@thykier.net>
Date:   Thu Jun 2 12:00:40 2011 +0200

    Profiles now respect display level

diff --git a/frontend/lintian b/frontend/lintian
index 343714a..5ee076d 100755
--- a/frontend/lintian
+++ b/frontend/lintian
@@ -650,7 +650,10 @@ $TAGS->suppress(keys %suppress_tags) if %suppress_tags;
 
 if (defined $check_tags || %suppress_tags) {
     # No profile if we have been given explicit list
-    $LINTIAN_PROFILE = ''
+    $LINTIAN_PROFILE = '';
+    # If we are given explicit list, we use that regardless
+    # of show_pedantic/display.
+    $TAGS->respect_display_level(0);
 } else {
     unless ($LINTIAN_PROFILE){
 	# Time to ask dpkg-vendor for a vendor name
diff --git a/lib/Lintian/Tags.pm b/lib/Lintian/Tags.pm
index 3b9bc38..655f92d 100644
--- a/lib/Lintian/Tags.pm
+++ b/lib/Lintian/Tags.pm
@@ -153,13 +153,14 @@ sub new {
         },
         display_source    => {},
         files             => {},
+        ignored_overrides => {},
         only_issue        => {},
+        respect_display   => 1,
         show_experimental => 0,
         show_overrides    => 0,
         show_pedantic     => 0,
         statistics        => {},
         suppress          => {},
-        ignored_overrides => {},
     };
     bless($self, $class);
     $GLOBAL = $self unless $GLOBAL;
@@ -682,10 +683,11 @@ sub displayed {
     return 0 if ($info->experimental and not $self->{show_experimental});
     my $only = $self->{only_issue};
     if (%$only) {
-        return 1 if $only->{$tag};
-        return 0;
+        return 0 unless $only->{$tag};
+        return 1 unless $self->{respect_display};
+    } else {
+        return 0 if $self->suppressed($tag);
     }
-    return 0 if $self->suppressed($tag);
     my $severity = $info->severity;
     my $certainty = $info->certainty;
 
@@ -751,6 +753,30 @@ sub ignore_overrides {
     return 1;
 }
 
+=item respect_display_level([BOOL])
+
+Whether or not the display level should be considered for
+tags that can be emitted.
+
+Calling this with a defined non-truth value and calling
+only(TAG) will emit all of the tags passed to only(),
+regardless of what is passed to show_pedantic() and
+display() etc.
+
+Returns the old value.
+
+Note: This does not effect suppressed tags, which will
+always be suppressed regardless.
+
+=cut
+
+sub respect_display_level{
+    my ($self, $val) = @_;
+    my $old = $self->{respect_display};
+    $self->{respect_display} = $val if defined $val;
+    return $old;
+}
+
 =back
 
 =head1 AUTHOR

-- 
Debian package checker


Reply to: