Bug#647227: lintian: create separate tag for packages that could benefit from "build-arch"/"build-indep"
Package: lintian
Severity: wishlist
Tags: patch
Hi,
As I suggested in #629385, lintian could be used to detect packages
that could benefit from having the recommended build-arch and
build-indep packages.
The technical details are in the attached patch; though the tag
info (and possibly the name) could use some attention.
Also I am not sure it makes sense to make this an "important/possible"
tag. For the purpose of finding the relevant packages to update/NMU
any severity would do.
~Niels
diff --git a/checks/rules b/checks/rules
index 0c88104..decdae0 100644
--- a/checks/rules
+++ b/checks/rules
@@ -110,6 +110,8 @@ sub run {
my $pkg = shift;
my $type = shift;
my $info = shift;
+my $proc = shift;
+my $group = shift;
my $rules = $info->debfiles('rules');
@@ -359,14 +361,28 @@ while (<RULES>) {
close RULES;
unless ($includes) {
+ my $rec = 0;
# Make sure all the required rules were seen.
for my $target (sort keys %required) {
tag 'debian-rules-missing-required-target', $target
unless $seen{$target};
}
for my $target (sort keys %recommended) {
- tag 'debian-rules-missing-recommended-target', $target
- unless $seen{$target};
+ unless ($seen{$target}) {
+ tag 'debian-rules-missing-recommended-target', $target;
+ $rec++;
+ }
+ }
+
+ if ($rec) {
+ my $all = 0;
+ my $notall = 0;
+ foreach my $p ($group->get_processables) {
+ next if $p->pkg_type eq 'source' or $p->pkg_type eq 'changes';
+ $all++ if $p->pkg_arch eq 'all';
+ $notall++ if $p->pkg_arch ne 'all';
+ }
+ tag 'package-would-benefit-from-build-arch-targets' if $all && $notall;
}
}
diff --git a/checks/rules.desc b/checks/rules.desc
index 99f73de..291cb62 100644
--- a/checks/rules.desc
+++ b/checks/rules.desc
@@ -212,3 +212,9 @@ Info: The rules files appear to be reading or modifying a variable not
can be used by users, who wants to re-compile debian packages with
special (or non-standard) build flags.
+Tag: package-would-benefit-from-build-arch-targets
+Severity: important
+Certainty: possible
+Ref: #629385, https://wiki.debian.org/ReleaseGoals/BuildArchTarget
+Info: Please add a build-arch and build-indep target.
+
Reply to: