[SCM] Debian package checker branch, master, updated. 2.2.9-55-ged4a9ee
The following commit has been merged in the master branch:
commit d0c8647893637851358e9e11f6bfa05f7da90de3
Author: Raphael Geissert <atomo64@gmail.com>
Date: Wed Apr 1 16:31:42 2009 -0600
Move override file parsing to the Tags module
Move the overrides file parsing code from the frontend to the Tags
module.
diff --git a/frontend/lintian b/frontend/lintian
index f39463c..c9ebd93 100755
--- a/frontend/lintian
+++ b/frontend/lintian
@@ -1513,24 +1513,8 @@ foreach my $pkg_info ($schedule->get_all) {
if ($action eq 'check') { # read override file
unless ($no_override) {
- if (open(O, '<', "$base/override")) {
- while (<O>) {
- chomp;
- next if m,^\s*(\#|\z),o;
- s/^\s+//o;
- s/\s+$//o;
- s/\s+/ /go;
- my $override = $_;
- $override =~ s/^\Q$pkg\E( \Q$long_type\E)?: //;
- if ($override eq '' or $override !~ /^[\w.+-]+(\s.*)?$/) {
- tag ('malformed-override', $_);
- } else {
- my ($tag, $extra) = split(/ /, $override, 2);
- Tags::add_override($tag, $extra);
- }
- }
- close(O);
- }
+ Tags::add_overrides("$base/override", $pkg, $long_type)
+ if (-f "$base/override")
}
# perform checks
diff --git a/lib/Tags.pm b/lib/Tags.pm
index 72461df..0895221 100644
--- a/lib/Tags.pm
+++ b/lib/Tags.pm
@@ -202,6 +202,35 @@ sub get_tag_code {
return $codes{$tag_info->{severity}}{$tag_info->{certainty}};
}
+sub add_overrides {
+ my ($file, $pkg, $long_type) = @_;
+
+ if (!open(O, '<', $file)) {
+ warn "Could not open override file '$file' for reading";
+ return 0;
+ }
+
+ local $_;
+ while (<O>) {
+ chomp;
+ next if m,^\s*(\#|\z),o;
+ s/^\s+//o;
+ s/\s+$//o;
+ s/\s+/ /go;
+ my $override = $_;
+ $override =~ s/^\Q$pkg\E( \Q$long_type\E)?: //;
+ if ($override eq '' or $override !~ /^[\w.+-]+(\s.*)?$/) {
+ tag ('malformed-override', $_);
+ } else {
+ my ($tag, $extra) = split(/ /, $override, 2);
+ add_override($tag, $extra);
+ }
+ }
+ close(O);
+
+ return 1;
+}
+
# check if a certain tag has a override for the 'current' package
sub check_overrides {
my ( $tag_info, $information ) = @_;
--
Debian package checker
Reply to: