Package: devscripts
Version: 2.23.4
Severity: normal

Dear Maintainer,

the script copy Build-Depends into Depends. But those are not the same fields. Build-Depends parsed differently by apt then Depends. For most cases it is the same. But when you specify Build-Depends as for example python3-mako apt will install python3-mako:all arch. But when this build dependency moved into Depends with out arch specification, apt will try to install python3-mako:i386. and since here is no python3-mako:i386 install will failed.

Following should work on amd64:

apt build-dep mangohud
apt build-dep mangohud:i386
mk-build-deps mangohud
mk-build-deps -a i386 mangohud

This patch / hack fixing the behaviour:

diff --git a/scripts/mk-build-deps.pl b/scripts/mk-build-deps.pl
index 8b35e7e..f09ae9b 100755
--- a/scripts/mk-build-deps.pl
+++ b/scripts/mk-build-deps.pl
@@ -425,7 +425,7 @@ if ($opt_install) {
my (@pkg_names, @deb_files, @buildinfo_files, @changes_files, %uniq);
for my $package (@packages) {
if ($uniq{ $package->{deb_file} }++ == 0) {
- push @pkg_names, $package->{package};
+ push @pkg_names, $package->{package}.":".$package->{arch};
push @deb_files, $package->{deb_file};
push @buildinfo_files, $package->{buildinfo_file};
push @changes_files, $package->{changes_file};
@@ -514,16 +514,6 @@ sub build_equiv {
$hostarch = $opt_hostarch;
}

- if ($packagearch eq "all") {
- if ($buildarch ne $hostarch) {
- die
-"build architecture \"$buildarch\" is unequal host architecture \"$hostarch\" in which case the package architecture must not be \"all\" (but \"$hostarch\" instead)\n";
- }
- } elsif ($packagearch ne $hostarch) {
- die
-"The package architecture must be equal to the host architecture except if the package architecture is \"all\"\n";
- }
-
my $build_profiles = [split /\s+/, ($ENV{'DEB_BUILD_PROFILES'} // "")];
if (defined $opt_buildprofiles) {
$build_profiles = [split /,/, $opt_buildprofiles];
@@ -560,6 +550,10 @@ sub build_equiv {
$dep->{archqual} = $buildarch;
}
}
+ my $str = `apt-cache showsrc "$dep" | grep-dctrl --show-field Package-List - | awk '\$1 == "$dep" && /arch=all/{print \$1}'`;
+ if ($str ne "") {
+ $dep->{archqual} = "all";
+ }
return 1;
};
deps_iterate($positive, $handle_native_archqual);
@@ -574,6 +568,14 @@ sub build_equiv {
$buildess .= ", crossbuild-essential-$hostarch:$buildarch";
}

+ use File::Temp ();
+ my $temp = File::Temp->new();
+ print $temp
+"
+$pkgname ($opts->{version}) unstable; urgency=low
+
+ * First version
+";
my $readme = '/usr/share/devscripts/templates/README.mk-build-deps';
open EQUIVS, "| equivs-build $args-"
or die "$progname: Failed to execute equivs-build: $!\n";
@@ -581,7 +583,9 @@ sub build_equiv {
. "Priority: optional\n"
. "Standards-Version: 3.7.3\n\n"
. "Package: $pkgname\n"
- . "Architecture: $packagearch\n"
+ . "Architecture: any\n"
+ . "Multi-Arch: same\n"
+ . "Changelog: $temp\n"
. "Depends: $buildess, $positive\n";

print EQUIVS "Conflicts: $negative\n" if $negative;
@@ -603,10 +607,17 @@ sub build_equiv {
my $v = Dpkg::Version->new($version);
# The version in the .deb filename will not contain the epoch
$version = $v->as_string(omit_epoch => 1);
- my $deb_file = "${pkgname}_${version}_${packagearch}.deb";
+ my $debarch;
+ if ($packagearch eq "all") {
+ $debarch = "$buildarch";
+ } else {
+ $debarch = "$packagearch";
+ }
+ my $deb_file = "${pkgname}_${version}_${debarch}.deb";
my $buildinfo_file = "${pkgname}_${version}_${hostarch}.buildinfo";
my $changes_file = "${pkgname}_${version}_${hostarch}.changes";
return {
+ arch => $debarch,
package => $pkgname,
deb_file => $deb_file,
buildinfo_file => $buildinfo_file,



-- Package-specific info:

--- /etc/devscripts.conf ---
Empty.

--- ~/.devscripts ---
DEBEMAIL=a...@me.com
DEBFULLNAME="Alexey Kuznetsov"

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

Kernel: Linux 6.1.0-10-amd64 (SMP w/12 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages devscripts depends on:
ii dpkg-dev 1.21.22
ii fakeroot 1.31-1.2
ii file 1:5.44-3
ii gnupg 2.2.40-1.1
ii gpgv 2.2.40-1.1
ii libc6 2.36-9+deb12u1
ii libfile-dirlist-perl 0.05-3
ii libfile-homedir-perl 1.006-2
ii libfile-touch-perl 0.12-2
ii libfile-which-perl 1.27-2
ii libipc-run-perl 20220807.0-1
ii libmoo-perl 2.005005-1
ii libwww-perl 6.68-1
ii patchutils 0.4.2-1
ii perl 5.36.0-7
ii python3 3.11.2-1+b1
ii sensible-utils 0.0.17+nmu1
ii wdiff 1.2.2-5

Versions of packages devscripts recommends:
ii apt 2.6.1
ii curl 7.88.1-10
ii dctrl-tools 2.24-3+b1
ii debian-keyring 2022.12.24
ii dput 1.1.3
ii equivs 2.3.1
ii libdistro-info-perl 1.5
ii libdpkg-perl 1.21.22
ii libencode-locale-perl 1.05-3
ii libgit-wrapper-perl 0.048-2
ii libgitlab-api-v4-perl 0.26-3
ii liblist-compare-perl 0.55-2
ii liblwp-protocol-https-perl 6.10-1
ii libsoap-lite-perl 1.27-3
ii libstring-shellquote-perl 1.04-3
ii libtry-tiny-perl 0.31-2
ii liburi-perl 5.17-1
ii licensecheck 3.3.5-1
ii lintian 2.116.3
it man-db 2.11.2-2
ii patch 2.7.6-7
ii pristine-tar 1.50
ii python3-apt 2.6.0
ii python3-debian 0.1.49
ii python3-magic 2:0.4.26-3
ii python3-requests 2.28.1+dfsg-1
ii python3-unidiff 0.7.3-1
ii python3-xdg 0.28-2
ii strace 6.1-0.1
ii unzip 6.0-28
ii wget 1.21.3-1+b2
ii xz-utils 5.4.1-0.2

Versions of packages devscripts suggests:
pn adequate <none>
ii at 3.2.5-1+b1
pn autopkgtest <none>
pn bls-standalone <none>
ii bsd-mailx [mailx] 8.1.2-0.20220412cvs-1
ii build-essential 12.9
pn check-all-the-things <none>
pn cvs-buildpackage <none>
ii debhelper 13.11.4
pn diffoscope <none>
pn disorderfs <none>
pn dose-extra <none>
pn duck <none>
pn elpa-devscripts <none>
ii faketime 0.9.10-2.1
pn gnuplot <none>
pn how-can-i-help <none>
ii libauthen-sasl-perl 2.1600-3
pn libdbd-pg-perl <none>
ii libfile-desktopentry-perl 0.22-3
pn libterm-size-perl <none>
ii libtimedate-perl 2.3300-2
pn libyaml-syck-perl <none>
pn mmdebstrap <none>
ii mozilla-devscripts 0.54.2+nmu1
pn mutt <none>
ii openssh-client [ssh-client] 1:9.2p1-2
pn piuparts <none>
pn postgresql-client <none>
pn pristine-lfs <none>
pn quilt <none>
pn ratt <none>
pn reprotest <none>
pn svn-buildpackage <none>
ii w3m 0.5.3+git20230121-2

-- no debconf information

Reply via email to