Package: debhelper
Version: 10.2.5
Severity: minor
Tags: patch

Dear Maintainer,

On Multi-Arch i386+amd64 system, when I have foo:amd64 (Multi-Arch:
foreign), I can install useless foo-dbgsym:i386 (and reverse).

I think (at least, 'Multi-arch: foreign' *and* 'Architecture' != all)
packages should have explicit parent package arch dependency
  Depend: foo:${Arch} (=${binary:Version})
instead of
  Depend: foo (=${binary:Version})
Untested patch against debhelper 11.3.5 attached (please review carefully, I'm neither M-A nor debhelper expert).

References:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=678896
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=676653

-- System Information:
Debian Release: 9.4
  APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable-debug'), (500, 'proposed-updates-debug'), (500, 'proposed-updates'), (500, 'stable')
Architecture: i386 (x86_64)
Foreign Architectures: amd64

Kernel: Linux 4.9.0-6-amd64 (SMP w/2 CPU cores)
Locale: LANG=ru_RU.KOI8-R, LC_CTYPE=ru_RU.KOI8-R (charmap=KOI8-R), LANGUAGE=ru_RU.KOI8-R (charmap=KOI8-R)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages debhelper depends on:
ii  autotools-dev            20161112.1
ii  binutils                 2.28-5
ii  dh-autoreconf            14
ii  dh-strip-nondeterminism  0.034-1
ii  dpkg                     1.18.25
ii  dpkg-dev                 1.18.25
ii  file                     1:5.30-1+deb9u2
ii  libdpkg-perl             1.18.25
ii  man-db                   2.7.6.1-2
ii  perl                     5.24.1-3+deb9u4
ii  po-debconf               1.0.20

debhelper recommends no packages.

Versions of packages debhelper suggests:
ii  dh-make  2.201608

-- no debconf information

--- debhelper/dh_gencontrol.org 2018-06-30 14:01:59.000000000 +0300
+++ debhelper/dh_gencontrol     2018-07-07 11:19:18.556510173 +0300
@@ -110,6 +110,10 @@
                if ( -d $dbgsym_tmp) {
                        my $multiarch = package_multiarch($package);
                        my $section = package_section($package);
+                       my $package_arch = $package;
+                       if ($multiarch eq 'foreign' and package_arch($package) 
ne 'all') {
+                               $package_arch .= ':${Arch}';
+                       }
                        my $replaces = read_dbgsym_migration($dbgsym_info_dir);
                        my $component = '';
                        if ($section =~ m{^(.*)/[^/]+$}) {
@@ -126,7 +130,7 @@
                                                
-DAuto-Built-Package=debug-symbols
                                        ),
                                "-DPackage=${package}-dbgsym",
-                               "-DDepends=${package} (= \${binary:Version})",
+                               "-DDepends=${package_arch} (= 
\${binary:Version})",
                                "-DDescription=debug symbols for ${package}",
                                "-DBuild-Ids=${build_ids}",
                                "-DSection=${component}debug",

Reply via email to