[SCM] Debian package checker branch, master, updated. 2.5.2-108-gd981e1f
The following commit has been merged in the master branch:
commit d981e1ffe993b03368c7a8856a0a0287a34642c4
Author: Niels Thykier <niels@thykier.net>
Date: Wed Sep 7 10:13:17 2011 +0200
Improve the behaviour of --quiet and --debug/--verbose
If --quiet is used to --debug, --quiet is silently ignored and
--verbose is unconditionally enabled. If --quiet and --verbose are
both present (and --debug is not used), the last of the two options
will take effect.
The frontend now accepts --quiet in the lintianrc via the new "quiet"
variable. The lintianrc.example has been updated to include an
example.
The manpage has also been updated to describe this behaviour. It also
clarifies that --verbose can be used in the lintianrc file. The
frontend accepted this in 2.5.2, but the manpage did not mention this.
In Lintian::Output "verbose" and "quiet" has been replaced by
"verbosity_level". The old "quiet" is a verbosity_level of -1 and
"verbose" has become a verbosity_level of 1.
diff --git a/debian/changelog b/debian/changelog
index 63c87b2..4771446 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -151,6 +151,8 @@ lintian (2.5.3) UNRELEASED; urgency=low
+ [NT] Removed duplicate "allowed to" in same sentence.
+ [NT] Added a paragraph on some of the constrains in design
of Lintian.
+ * doc/lintianrc.example:
+ + [NT] Add an example on how to enable "--quiet" via lintianrc.
* doc/README.developers:
+ [NT] New file. Thanks to Jeremiah C. Foster for the initial
contribution.
@@ -169,6 +171,11 @@ lintian (2.5.3) UNRELEASED; urgency=low
passed.
+ [JW,NT] Fixed a regression where --check-part ignored display
settings (such as --display-info). (Closes: #640694)
+ + [NT] If both --verbose and --quiet is used together, then use
+ the last of them to appear rather than "both at the same time".
+ (Closes: #643066)
+ + [NT] Accept --quiet in lintianrc as "quiet". This option may
+ not be used together with "verbose" in the config file.
* lib/Util.pm:
+ [JW] Use LC_ALL rather than LANG, since LC_ALL overrules
@@ -184,6 +191,8 @@ lintian (2.5.3) UNRELEASED; urgency=low
+ [NT] Fixed "index" method for source packages.
* lib/Lintian/Collect/Package.pm:
+ [JW,NT] Replace use of fail with croak. (Closes: #637741)
+ * lib/Lintian/Output.pm:
+ + [NT] Merged "quiet" and "verbose" into "verbosity_level".
* lib/Lintian/Profile.pm:
+ [NT] Reject profiles containing an unknown field.
* lib/Lintian/Tag/Info.pm:
@@ -209,6 +218,11 @@ lintian (2.5.3) UNRELEASED; urgency=low
+ [JW] Fixed some stray POD markup. (Closes: #640705)
+ [JW,NT] Clarified that --tags and --tags-from-file ignores
display settings.
+ + [NT] Documented how lintian behaves if --quiet is used together
+ with --verbose or --debug.
+ + [NT] Documented how --verbose and --quiet can be enabled via
+ the config file. Only one of "verbose" and "quiet" may
+ appear in the config file.
* profiles/debian/ftp-master-auto-reject.profile:
+ [NT] Refreshed to include udeb-uses-non-gzip-data-tarball.
diff --git a/doc/lintianrc.example b/doc/lintianrc.example
index f1af6eb..918e9f7 100644
--- a/doc/lintianrc.example
+++ b/doc/lintianrc.example
@@ -34,6 +34,9 @@
# Verbose output by default (--verbose)
#verbose = yes
+# Quiet by default (--quiet)
+#quiet = yes
+
# Specify a laboratory--a directory where Lintian should store some info
# about packages being checked.
#LINTIAN_LAB="/var/spool/lintian"
diff --git a/frontend/lintian b/frontend/lintian
index a7fcb2e..eb58674 100755
--- a/frontend/lintian
+++ b/frontend/lintian
@@ -93,7 +93,6 @@ my $BANNER = "Lintian v$LINTIAN_VERSION"; #Version Banner - text form
# they were set via commandline or environment variables
my $pkg_mode = 'a'; # auto -- automatically search for
# binary and source pkgs
-my $quiet = 0; #flag for -q|--quiet switch
my $debug = 0;
my $check_everything = 0; #flag for -a|--all switch
my $lintian_info = 0; #flag for -i|--info switch
@@ -397,6 +396,11 @@ sub record_display_source {
$display_source{$_[1]} = 1;
}
+# Process -q|--quite flag
+sub record_quiet {
+ $opt{'verbose'} = -1;
+}
+
# Process deprecated flags
sub deprecated{
print STDERR "warning: $_[0] is deprecated and may be removed\n";
@@ -431,6 +435,29 @@ sub cfg_display_level {
}
+# Processes quiet and verbose options in cfg files.
+# - dies if quiet and verbose are used together
+# - sets the verbosity level ($opt{'verbose'}) unless
+# already set.
+sub cfg_verbosity {
+ my ($var, $val) = @_;
+ if (($var eq 'verbose' && exists $conf_opt{'quiet'}) ||
+ ($var eq 'quiet' && exists $conf_opt{'verbose'})) {
+ die "verbose and quiet may not both appear in the config file.\n";
+ }
+ # quiet = no or verbose = no => no change
+ return unless $val;
+ # Do not change the value if set by command line.
+ return if defined $opt{'verbose'};
+ # quiet = yes => verbosity_level = -1
+ #
+ # technically this allows you to enable verbose by using "quiet =
+ # -1" (etc.), but most people will probably not use this
+ # "feature".
+ $val = -$val if $var eq 'quiet';
+ $opt{'verbose'} = $val;
+}
+
# Hash used to process commandline options
my %opthash = ( # ------------------ actions
'setup-lab|S' => \&record_action,
@@ -451,7 +478,7 @@ my %opthash = ( # ------------------ actions
'verbose|v' => \$opt{'verbose'},
'debug|d+' => \$debug, # Count the -d flags
- 'quiet|q' => \$quiet,
+ 'quiet|q' => \&record_quiet, # sets $opt{'verbose'} to -1
# ------------------ behaviour options
'info|i' => \$opt{'info'},
@@ -504,9 +531,10 @@ my %cfghash = (
'fail-on-warnings' => \$opt{'fail-on-warnings'},
'info' => \$opt{'info'},
'pedantic' => \$opt{'pedantic'},
+ 'quiet' => \&cfg_verbosity,
'no-override' => \$opt{'no-override'},
'show-overrides' => \$opt{'show-overrides'},
- 'verbose' => \$opt{'verbose'},
+ 'verbose' => \&cfg_verbosity,
);
# init commandline parser
@@ -689,8 +717,13 @@ if ($ENV{'LINTIAN_INTERNAL_TESTSUITE'}){
@prof_inc = ();
}
-$opt{'verbose'} = 1 if $debug;
-$ENV{'LINTIAN_DEBUG'} = $debug;
+if ($debug) {
+ $opt{'verbose'} = 1;
+ $ENV{'LINTIAN_DEBUG'} = $debug;
+} else {
+ # Ensure verbose has a defined value
+ $opt{'verbose'} = 0 unless defined $opt{'verbose'};
+}
# Use our custom-generated locale for programs we call, if it's available. We
# first look in the Lintian root and then in /var/lib/lintian, which is the
@@ -752,9 +785,8 @@ if (defined $experimental_output_opts) {
}
-$Lintian::Output::GLOBAL->verbose($opt{'verbose'});
+$Lintian::Output::GLOBAL->verbosity_level($opt{'verbose'});
$Lintian::Output::GLOBAL->debug($debug);
-$Lintian::Output::GLOBAL->quiet($quiet);
$Lintian::Output::GLOBAL->color($opt{'color'});
$Lintian::Output::GLOBAL->showdescription($opt{'info'});
diff --git a/lib/Lintian/Output.pm b/lib/Lintian/Output.pm
index 103ee8a..44fda1f 100644
--- a/lib/Lintian/Output.pm
+++ b/lib/Lintian/Output.pm
@@ -46,7 +46,7 @@ Lintian::Output - Lintian messaging handling
# non-OO
use Lintian::Output qw(:messages);
- $Lintian::Output::GLOBAL->verbose(1);
+ $Lintian::Output::GLOBAL->verbosity_level(1);
msg("Something interesting");
v_msg("Something less interesting");
@@ -57,7 +57,7 @@ Lintian::Output - Lintian messaging handling
my $out = new Lintian::Output;
- $out->quiet(1);
+ $out->verbosity_level(-1);
$out->msg("Something interesting");
$out->v_msg("Something less interesting");
$out->debug_msg(3, "Something very specfific");
@@ -85,13 +85,11 @@ The following fields define the behaviours of Lintian::Output.
=over 4
-=item quiet
+=item verbosity_level
-If true, will suppress all messages except for warnings.
-
-=item verbose
-
-If true, will enable messages issued with v_msg.
+Determine how verbose the output should be. "0" is the default value
+(tags and msg only), "-1" is quiet (tags only) and "1" is verbose
+(tags, msg and v_msg).
=item debug
@@ -129,7 +127,7 @@ Hash containing the names of tags which have been issued.
=cut
-Lintian::Output->mk_accessors(qw(verbose debug quiet color colors stdout
+Lintian::Output->mk_accessors(qw(verbosity_level debug color colors stdout
stderr showdescription issuedtags));
# for the non-OO interface
@@ -162,12 +160,12 @@ is given, they will fall back to the $Lintian::Output::GLOBAL object.
=item C<msg(@args)>
Will output the strings given in @args, one per line, each line prefixed
-with 'N: '. Will do nothing if quiet is true.
+with 'N: '. Will do nothing if verbosity_level is less than 0.
=item C<v_msg(@args)>
Will output the strings given in @args, one per line, each line prefixed
-with 'N: '. Will do nothing unless verbose is true.
+with 'N: '. Will do nothing unless verbosity_level is greater than 0.
=item C<debug_msg($level, @args)>
@@ -182,14 +180,14 @@ with 'N: '. Will do nothing unless debug is set to a positive integer
sub msg {
my ($self, @args) = _global_or_object(@_);
- return if $self->quiet;
+ return if $self->verbosity_level < 0;
$self->_message(@args);
}
sub v_msg {
my ($self, @args) = _global_or_object(@_);
- return unless $self->verbose;
+ return unless $self->verbosity_level > 0;
$self->_message(@args);
}
@@ -211,7 +209,7 @@ prefixed with 'warning: '.
sub warning {
my ($self, @args) = _global_or_object(@_);
- return if $self->quiet;
+ return if $self->verbosity_level < 0;
$self->_warning(@args);
}
@@ -362,7 +360,7 @@ The following methods are only intended for subclassing and are
only available as instance methods. The methods mentioned in
L<CLASS/INSTANCE METHODS>
usually only check whether they should do anything at all (according
-to the values of quiet, verbose, and debug) and then call one of
+to the values of verbosity_level and debug) and then call one of
the following methods to do the actual printing. Allmost all of them
finally call _print() to do that. This convoluted scheme is necessary
to be able to use the methods above as class methods and still make
diff --git a/man/lintian.pod.in b/man/lintian.pod.in
index 4bdd64a..3ed8af3 100644
--- a/man/lintian.pod.in
+++ b/man/lintian.pod.in
@@ -138,7 +138,13 @@ General options:
=item B<-d>, B<--debug>
-Display debugging messages. (Implies B<-v>).
+Display debugging messages. (Implies B<-v> and overrules any B<-q>).
+
+Can be used multiple times to increase the debug information.
+
+This option cannot be specified in the config file. If used on the
+command line it will override the B<verbose> and the B<quiet> options
+in the config file.
=item B<-h>, B<--help>
@@ -146,14 +152,31 @@ Display usage information and exit.
=item B<-q>, B<--quiet>
-Suppress all informational messages. Currently, the only message this
-suppresses is the message at the end of the run giving the total count
-of overrides.
+Suppress all informational messages including override comments
+(nornally shown wiht B<--show-overrides>).
+
+This option is silently ignored if B<--debug> is given. Otherwise, if
+both B<--verbose> and B<--quiet> is used, the last of these two options
+take effect.
+
+This option overrides the B<verbose> and the B<quiet> variable in the
+configuration file. In the configuration file, this option is enabled
+by using B<quiet> variable. The B<verbose> and B<quiet> variables may
+not both appear in the config file.
=item B<-v>, B<--verbose>
Display verbose messages.
+If B<--debug> is used this option is always enabled. Otherwise, if
+both B<--verbose> and B<--quiet> is used (and B<--debug> is not used),
+the last of these two options take effect.
+
+This option overrides the B<quiet> variable in the configuration file.
+In the configuration file, this option is enabled by using B<verbose>
+variable. The B<verbose> and B<quiet> variables may not both appear
+in the config file.
+
=item B<-V>, B<--version>
Display lintian version number and exit.
--
Debian package checker
Reply to: