lintian: r780 - in trunk: debian frontend man
Author: rra
Date: 2006-11-11 11:18:35 +0100 (Sat, 11 Nov 2006)
New Revision: 780
Modified:
trunk/debian/changelog
trunk/frontend/lintian
trunk/man/lintian.1
Log:
* frontend/lintian:
+ [RA] Add --fail-on-warning option to exit with non-zero status if
any warnings were found. Thanks, Daniel Bonniot. (Closes: #189656)
* man/lintian.1:
+ [RA] Document --fail-on-warning.
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2006-11-11 10:03:59 UTC (rev 779)
+++ trunk/debian/changelog 2006-11-11 10:18:35 UTC (rev 780)
@@ -82,8 +82,15 @@
various subdirectories of its standard search path based on hardware
capabilities. Reported by Aurelien Jarno. (Closes: #396278)
- --
+ * frontend/lintian:
+ + [RA] Add --fail-on-warning option to exit with non-zero status if
+ any warnings were found. Thanks, Daniel Bonniot. (Closes: #189656)
+ * man/lintian.1:
+ + [RA] Document --fail-on-warning.
+
+ -- Russ Allbery <rra@debian.org> Sat, 11 Nov 2006 02:11:18 -0800
+
lintian (1.23.25) unstable; urgency=low
The "dependency and debconf" release
Modified: trunk/frontend/lintian
===================================================================
--- trunk/frontend/lintian 2006-11-11 10:03:59 UTC (rev 779)
+++ trunk/frontend/lintian 2006-11-11 10:18:35 UTC (rev 780)
@@ -51,9 +51,10 @@
our $display_infotags = 0; #flag for -I|--display-info switch
my $unpack_level = undef; #flag for -l|--unpack-level switch
our $no_override = 0; #flag for -o|--no-override switch
-our $show_overrides = 0; #flag for --show-overrides switch
+our $show_overrides = 0; #flag for --show-overrides switch
my $check_md5sums = 0; #flag for -m|--md5sums switch
my $allow_root = 0; #flag for --allow-root swtich
+my $fail_on_warnings = 0; #flag for --fail-on-warnings switch
my $packages_file = 0; #string for the -p option
my $OPT_LINTIAN_LAB = ""; #string for the --lab option
my $OPT_LINTIAN_ARCHIVEDIR = "";#string for the --archivedir option
@@ -145,6 +146,7 @@
-U X, --unpack-info X specify which info should be collected
-m, --md5sums check md5sums when processing a .changes file
--allow-root suppress lintian\'s warning when run as root
+ --fail-on-warnings return a non-zero exit status if warnings found
Configuration options:
--cfg CONFIGFILE read CONFIGFILE for configuration
--lab LABDIR use LABDIR as permanent laboratory
@@ -260,6 +262,7 @@
"unpack-info|U=s" => \&record_unpack_info,
"md5sums|m" => \$check_md5sums,
"allow-root" => \$allow_root,
+ "fail-on-warnings" => \$fail_on_warnings,
# Note: Ubuntu has (and other derivatives might gain) a
# -D/--debian option to make lintian behave like in Debian, that
# is, to revert distribution-specific changes
@@ -707,6 +710,8 @@
my $stats = Tags::get_stats( $arg );
if ($stats->{severity}{4}) {
$exit_code = 1;
+ } elsif ($fail_on_warnings && $stats->{severity}{2}) {
+ $exit_code = 1;
}
}
@@ -1317,6 +1322,8 @@
my $stats = Tags::get_stats( $file );
if ($stats->{severity}{4}) {
$exit_code = 1;
+ } elsif ($fail_on_warnings && $stats->{severity}{2}) {
+ $exit_code = 1;
}
}
Modified: trunk/man/lintian.1
===================================================================
--- trunk/man/lintian.1 2006-11-11 10:03:59 UTC (rev 779)
+++ trunk/man/lintian.1 2006-11-11 10:18:35 UTC (rev 780)
@@ -172,6 +172,13 @@
.BR lintian 's
warning when it is run with superuser privileges.
+.TP
+.BR \-\-fail\-on\-warnings
+By default,
+.B lintian
+exits with 0 status if only warnings were found. If this flag is given,
+exit with a status of 1 if either warnings or errors are found.
+
.PP
Configuration options:
Reply to: