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

Bug#857028: debhelper: dh_gencontrol should discard Multi-Arch: no

Package: debhelper
Version: 10.2.5
Severity: wishlist

I have been working on fixing multiarch metadata a bit. Using very
simple checks I was able to generate some multiarch hints[1] that are
correct with a very high precision. Unfortunately, there are lots of
them. In practise every 5th package has a hint. Clearly adoption is not
going to speed up any time soon, so it looks like we have a tooling

Given that many of these Multi-Arch headers can be autogenerated with a
very small risk of false positives, it seems obvious to just let some
central piece of build infrastructure (i.e. debhelper) add them. If we
do that, there is a small risk of false markings (but much lower than
the current human marking approach). Thus we will need a way to override
these automatic headers. Overrides are simple enough: Just add the
header and debhelper shouldn't change it. There is one problem though:
If the override needs to say that there shouldn't be a Multi-Arch
header, then we currently cannot express that as "Multi-Arch: no" is
rejected by dak[2].

As a first step, Niels was proposing that debhelper's dh_gencontrol
discards 'Multi-Arch: no' given a high enough compatibility level. (Is
that compat check even necessary, given that such a header is currently
forbidden?) Thus we could start adding "Multi-Arch: no" to a few
selected packages soon and have them continue working once automatic
insertion of such headers surfaces.

Here is the patch for that. Hope you like it.


[1] https://wiki.debian.org/MultiArch/Hints
[2] I do not know why this is still the case. If anyone figures out,
    please tell.
diff --minimal -Nru debhelper-10.2.5/debian/changelog debhelper-10.2.5+nmu1/debian/changelog
--- debhelper-10.2.5/debian/changelog	2017-01-25 21:47:27.000000000 +0100
+++ debhelper-10.2.5+nmu1/debian/changelog	2017-03-07 07:56:52.000000000 +0100
@@ -1,3 +1,10 @@
+debhelper (10.2.5+nmu1) UNRELEASED; urgency=medium
+  * Non-maintainer upload.
+  * Remove explicit "Multi-Arch: no" stanzas in compat 11. (Closes: #-1)
+ -- Helmut Grohne <helmut@subdivi.de>  Tue, 07 Mar 2017 07:56:52 +0100
 debhelper (10.2.5) unstable; urgency=medium
   [ Translations ]
diff --minimal -Nru debhelper-10.2.5/dh_gencontrol debhelper-10.2.5+nmu1/dh_gencontrol
--- debhelper-10.2.5/dh_gencontrol	2016-12-07 19:46:58.000000000 +0100
+++ debhelper-10.2.5+nmu1/dh_gencontrol	2017-03-07 07:56:52.000000000 +0100
@@ -134,9 +134,15 @@
 		push(@debug_info_params, "-DBuild-Ids=${build_ids}");
+	my (@multiarch_params);
+	# Remove explicit "Multi-Arch: no" headers to avoid autorejects by dak.
+	push (@multiarch_params, '-UMulti-Arch')
+		if (!compat(10) and package_multiarch($package) eq 'no');
 	# Generate and install control file.
 	doit("dpkg-gencontrol", "-p$package", "-l$changelog", "-T$substvars",
-		"-P$tmp", @debug_info_params, @{$dh{U_PARAMS}});
+		"-P$tmp", @debug_info_params, @multiarch_params,
+		@{$dh{U_PARAMS}});
 	# This chmod is only necessary if the user sets the umask to
 	# something odd.

Reply to: