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

[SCM] Debian package checker branch, master, updated. 2.5.4-154-gdde19e4



The following commit has been merged in the master branch:
commit dde19e49c5a40dbbe31ad5c166ec147fccd1f4f8
Author: Niels Thykier <niels@thykier.net>
Date:   Wed Feb 8 10:56:58 2012 +0100

    Treat pedantic the same as all other severities
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/debian/changelog b/debian/changelog
index 2635e34..75de66e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -190,6 +190,10 @@ lintian (2.5.5) UNRELEASED; urgency=low
       Lintian::Profile.
     + [NT] Always load a profile.
     + [NT] Allow TMPDIR in the configuration file.
+    + [NT] Treat "pendantic" as a normal severity.  In previous
+      release, pedantic tags were not affected by --display-level.
+      A side-effect of this is that "pedantic" can no longer be
+      used with "display-level" in the configuration file.
   * frontend/lintian-info:
     + [NT] Support new lintian.log format.
     + [NT] Support new override file format with -a.
@@ -252,6 +256,7 @@ lintian (2.5.5) UNRELEASED; urgency=low
     + [NT] Emit "malformed-override" for architecture specific tags for
       unknown architectures and for "arch:all" packages.
     + [NT] Use a Profile to determine if a tag is suppressed or not.
+    + [NT] Handle "pedantic" like the other severities.
 
   * man/lintian.pod.in:
     + [NT] Removed the notes that some options disable loading of a
diff --git a/frontend/lintian b/frontend/lintian
index 14f6997..348350d 100755
--- a/frontend/lintian
+++ b/frontend/lintian
@@ -380,6 +380,11 @@ sub display_infotags {
     push(@display_level, [ '+', '>=', 'wishlist' ]);
 }
 
+# Process --pedantic flag
+sub display_pedantictags {
+    push(@display_level, [ '+', '=', 'pedantic' ]);
+}
+
 # Process --display-source flag
 sub record_display_source {
     $display_source{$_[1]} = 1;
@@ -404,15 +409,28 @@ sub deprecated{
 #    --display-level/--display-info
 sub cfg_display_level {
     my ($var, $val) = @_;
-    if ($var eq 'display-info'){
-        die "display-info and display-level may not both appear in the config file.\n"
+    if ($var eq 'display-info' or $var eq 'pedantic'){
+        die "$var and display-level may not both appear in the config file.\n"
             if $conf_opt{'display-level'};
 
-        return unless $val; # case "display-info=no"
-        push @display_level, [ '+', '>=', 'wishlist' ] unless @display_level;
+        return unless $val; # case "display-info=no" (or "pedantic=no")
+
+        # We are only supposed to modify @display_level if it was not
+        # set by a command-line option.  However, both display-info
+        # and pedantic comes here so we cannot determine this solely
+        # by checking if @display_level is empty.  We use
+        # "__conf-display-opts" to determine if @display_level was set
+        # by a conf option or not.
+        return if @display_level && !$conf_opt{'__conf-display-opts'};
+
+        $conf_opt{'__conf-display-opts'} = 1;
+        display_infotags() if $var eq 'display-info';
+        display_pedantictags() if $var eq 'pedantic';
     } elsif ($var eq 'display-level'){
-        die "display-info and display-level may not both appear in the config file.\n"
-            if $conf_opt{'display-info'};
+        foreach my $other (qw(pedantic display-info)) {
+            die "$other and display-level may not both appear in the config file.\n"
+                if $conf_opt{$other};
+        }
 
         return if @display_level;
         $val =~ s/^\s++//;
@@ -473,7 +491,7 @@ my %opthash = (                 # ------------------ actions
                'info|i' => \$opt{'info'},
                'display-info|I' => \&display_infotags,
                'display-experimental|E' => \$opt{'display-experimental'},
-               'pedantic' => \$opt{'pedantic'},
+               'pedantic' => \&display_pedantictags,
                'display-level|L=s' => \&record_display_level,
                'display-source=s' => \&record_display_source,
                'suppress-tags=s' => \&record_suppress_tags,
@@ -519,7 +537,7 @@ my %cfghash = (
                'display-level'        => \&cfg_display_level,
                'fail-on-warnings'     => \$opt{'fail-on-warnings'},
                'info'                 => \$opt{'info'},
-               'pedantic'             => \$opt{'pedantic'},
+               'pedantic'             => \&cfg_display_level,
                'quiet'                => \&cfg_verbosity,
                'no-override'          => \$opt{'no-override'},
                'show-overrides'       => \$opt{'show-overrides'},
@@ -786,7 +804,6 @@ debug_msg(1,
 my $PROFILE;
 our $TAGS = Lintian::Tags->new;
 $TAGS->show_experimental($opt{'display-experimental'});
-$TAGS->show_pedantic($opt{'pedantic'});
 $TAGS->show_overrides($opt{'show-overrides'});
 $TAGS->sources(keys %display_source) if %display_source;
 
@@ -1653,11 +1670,11 @@ sub _update_profile {
         $profile->disable_tags ($profile->tags);
         if ($check_tags) {
             $TAGS->show_experimental(1);
-            $TAGS->show_pedantic(1);
             # discard whatever is in @display_level and request
             # everything
             @display_level = ();
             display_infotags();
+            display_pedantictags();
             $profile->enable_tags (split /,/, $check_tags);
         } else {
             for my $c (split /,/, $checks) {
diff --git a/lib/Lintian/Tags.pm b/lib/Lintian/Tags.pm
index dd91d68..9908c05 100644
--- a/lib/Lintian/Tags.pm
+++ b/lib/Lintian/Tags.pm
@@ -38,7 +38,7 @@ BEGIN {
 our $GLOBAL;
 
 # Ordered lists of severities and certainties, used for display level parsing.
-our @SEVERITIES  = qw(wishlist minor normal important serious);
+our @SEVERITIES  = qw(pedantic wishlist minor normal important serious);
 our @CERTAINTIES = qw(wild-guess possible certain);
 
 =head1 NAME
@@ -125,9 +125,6 @@ created object.
 # show_overrides:
 #     True if overridden tags should be displayed.  False by default.
 #
-# show_pedantic:
-#     True if pedantic tags should be displayed.  False by default.
-#
 # statistics:
 #     Statistics per file.  Key is the filename, value another hash with
 #     the following keys:
@@ -155,7 +152,6 @@ sub new {
         profile              => undef,
         show_experimental    => 0,
         show_overrides       => 0,
-        show_pedantic        => 0,
         statistics           => {},
     };
     bless($self, $class);
@@ -400,18 +396,6 @@ sub show_overrides {
     $self->{show_overrides} = $bool ? 1 : 0;
 }
 
-=item show_pedantic(BOOL)
-
-If BOOL is true, configure pedantic tags to be shown.  If BOOL is false,
-configure pedantic tags to not be shown.
-
-=cut
-
-sub show_pedantic {
-    my ($self, $bool) = @_;
-    $self->{show_pedantic} = $bool ? 1 : 0;
-}
-
 =item sources([SOURCE [, ...]])
 
 Limits the displayed tags to only those from the listed sources.  One or
@@ -704,18 +688,7 @@ sub displayed {
     my $severity = $info->severity;
     my $certainty = $info->certainty;
 
-    # Pedantic is determined separately by the show_pedantic setting rather
-    # than by the normal display levels.  This is probably a mistake; this
-    # should probably be consistent.
-    #
-    # Severity and certainty should always be available, but avoid Perl
-    # warnings if the tag data is corrupt for some reason.
-    my $display;
-    if ($severity eq 'pedantic') {
-        $display = $self->{show_pedantic} ? 1 : 0;
-    } else {
-        $display = $self->{display_level}{$severity}{$certainty};
-    }
+    my $display = $self->{display_level}{$severity}{$certainty};
 
     # If display_source is set, we need to check whether any of the references
     # of this tag occur in display_source.
diff --git a/man/lintian.pod.in b/man/lintian.pod.in
index 0be29da..ff138ae 100644
--- a/man/lintian.pod.in
+++ b/man/lintian.pod.in
@@ -260,18 +260,18 @@ the automatic clean up of some collections.
 
 Fine-grained selection of tags to be displayed. It is possible to add,
 remove or set the levels to display, specifying a severity (S:
-serious, important, normal, minor, wishlist), a certainty (C: certain,
-possible, wild-guess), or both (S/C).  The default settings are
-equivalent to B<-L> ">=important" B<-L> "+>=normal/possible" B<-L>
-+minor/certain).
+serious, important, normal, minor, wishlist, pedantic), a certainty
+(C: certain, possible, wild-guess), or both (S/C).  The default
+settings are equivalent to B<-L> ">=important" B<-L>
+"+>=normal/possible" B<-L> +minor/certain).
 
 This option overrides the B<display-level> variable in the
 configuration file.  The value of the B<display-level> in
 configuration file should be space separated entries in the same
 format as passed via command-line.
 
-Note: B<display-level> and B<display-info> may not both appear in the
-configuration file.
+Note: B<display-level> may not be used with B<display-info> or B<pedantic>
+in the configuration file.
 
 =item B<-m>, B<--md5sums>, B<--checksums>
 
@@ -301,6 +301,9 @@ tags is probably not worth the effort.
 This option overrides the B<pedantic> variable in the configuration
 file.
 
+Note: B<pedantic> and B<display-info> may not both appear in the
+configuration file.
+
 =item B<--profile> vendor[/prof]
 
 Use the profile from vendor (or the profile with that name).  If the
diff --git a/t/tests/lintian-display-level/desc b/t/tests/lintian-display-level/desc
index 4f0374f..0681926 100644
--- a/t/tests/lintian-display-level/desc
+++ b/t/tests/lintian-display-level/desc
@@ -18,7 +18,6 @@ Test-For:
  maintainer-upload-has-incorrect-version-number
  new-essential-package
  no-homepage-field
- no-upstream-changelog
  possible-gpl-code-linked-with-openssl
 Test-Against:
  binary-control-field-duplicates-source
diff --git a/t/tests/lintian-display-level/tags b/t/tests/lintian-display-level/tags
index db3043a..38622a7 100644
--- a/t/tests/lintian-display-level/tags
+++ b/t/tests/lintian-display-level/tags
@@ -10,7 +10,6 @@ P: lintian-display-level source: debian-control-has-unusual-field-spacing line 1
 P: lintian-display-level source: direct-changes-in-diff-but-no-patch-system Changes
 P: lintian-display-level: example-unusual-interpreter usr/share/doc/lintian-display-level/examples/example #!/usr/bin/foo
 P: lintian-display-level: no-homepage-field
-P: lintian-display-level: no-upstream-changelog
 W: lintian-display-level source: dfsg-version-misspelled 1.0+dsfg-1.1
 W: lintian-display-level source: maintainer-upload-has-incorrect-version-number 1.0+dsfg-1.1
 W: lintian-display-level: binary-without-manpage usr/bin/script

-- 
Debian package checker


Reply to: