[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH/RFC] Ignore dh for sake of binary-arch-rules-but-pkg-is-arch-indep



Hi.

After a discussion in the Debian Perl Group that we want to unify our
debian/rules files as much as possible with the help of dh I tried to
come up with a minimal version. My current proposal can be seen at
http://people.debian.org/~djpig/rules.dh7+quilt.xs+noxs

It has one problem, though. It will cause
binary-arch-rules-but-pkg-is-arch-indep warnings in Arch:all packages.

I think that it should not fact do that because dh binary-arch is really
for all intents and purposes a no-op if called for an Arch:all package
(and the examples in dh(1) suggest that the author thinks similar).

Here is a patch to remove this warning for this case, but I wanted to
ask for any objections before pushing it into the repository:
--- a/checks/rules
+++ b/checks/rules
@@ -177,8 +177,17 @@ unless ($includes) {
 }
 
 # Make sure we have no content for binary-arch if we are arch-indep:
-if ($architecture eq "all" && scalar @{$rules_per_target{'binary-arch'} || []}) {
-    tag "binary-arch-rules-but-pkg-is-arch-indep";
+$rules_per_target{'binary-arch'} ||= [];
+if ($architecture eq "all" && scalar @{$rules_per_target{'binary-arch'}}) {
+    my $nonempty = 0;
+    foreach (@{$rules_per_target{'binary-arch'}}) {
+       # dh binary-arch is actually a no-op if there is no
+       # Architecture: any package in the control file
+       unless (m/^\s*dh\s+(?:binary-arch|\$\@)/) {
+           $nonempty = 1;
+       }
+    }
+    tag "binary-arch-rules-but-pkg-is-arch-indep" if $nonempty;
 }
 }
 1;

Gruesse,
-- 
Frank Lichtenheld <djpig@debian.org>
www: http://www.djpig.de/


Reply to: