lintian: r1010 - trunk/checks
Author: he
Date: 2007-12-01 10:30:00 +0100 (Sat, 01 Dec 2007)
New Revision: 1010
Modified:
trunk/checks/rules
Log:
Make debian/rules parsing more correct
Modified: trunk/checks/rules
===================================================================
--- trunk/checks/rules 2007-12-01 07:25:10 UTC (rev 1009)
+++ trunk/checks/rules 2007-12-01 09:30:00 UTC (rev 1010)
@@ -66,7 +66,7 @@
my %seen;
local $_;
my @current_targets;
-my ($has_binary_indep_rules, $has_binary_arch_rules) = (0,0);
+my %rules_per_target;
while (<RULES>) {
next if /^\s*\#/;
$includes = 1 if /^ *[s-]?include\s+/;
@@ -102,14 +102,11 @@
$seen{$_}++ if $required{$_};
}
} else {
- #if we have non-empty, non-comment lines, check if one of the
- #"interesting" targets contains them:
+ #if we have non-empty, non-comment lines, store them for all current targets:
if (m/^\s+[^#]/) {
- if (grep { $_ eq "binary-arch" } @current_targets) {
- $has_binary_arch_rules = 1;
- } #not elsif, think of the children and 'binary-arch binary-indep:' (ewww)
- if (grep { $_ eq "binary-indep" } @current_targets) {
- $has_binary_indep_rules = 1;
+ foreach my $target (@current_targets) {
+ $rules_per_target{$target} ||= [];
+ push @{$rules_per_target{$target}}, $_;
}
}
}
@@ -125,7 +122,7 @@
}
# Make sure we have no content for binary-arch if we are arch-indep:
-if ($architecture eq "all" && $has_binary_arch_rules) {
+if ($architecture eq "all" && scalar @{$rules_per_target{'binary-arch'}}) {
tag "binary-arch-rules-but-pkg-is-arch-indep";
}
}
Reply to: