From 5d32e500b7dc70ec831540ee00b1316336379060 Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Mon, 17 Jun 2024 20:08:49 +0000 Subject: Packaging: fix build-depends on multiarch debian systems It's possible to have two versions of the same package installed on debian-based multiarch systems - e.g. i386 alongside amd64. This means that when getting the package status through dpkg-query we'd get a duplicated string: % dpkg-query -f '$${db:Status-Status}' -W libssl-dev $installed$installed % dpkg -l | grep libssl-dev ii libssl-dev:amd64 3.0.11-1~deb12u2 amd64 Secure Sockets Layer toolkit - development files ii libssl-dev:i386 3.0.11-1~deb12u2 i386 Secure Sockets Layer toolkit - development files The fix is to explicitely check for the main architecture and, in case for noarch (or rather all-arch in debian terms) packages, check for special :all architecture as well. --- pkg/deb/Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'pkg') diff --git a/pkg/deb/Makefile b/pkg/deb/Makefile index a930b9fd..fadc96a8 100644 --- a/pkg/deb/Makefile +++ b/pkg/deb/Makefile @@ -139,9 +139,12 @@ check-build-depends-%: esac ; \ not_installed= ; \ for pkg in $${pkgs}; do \ - i=$$(dpkg-query -f '$${db:Status-Status}' -W $${pkg} 2>/dev/null) ; \ + i=$$(dpkg-query -f '$${db:Status-Status}' -W $${pkg}:$$(dpkg --print-architecture) 2>/dev/null) ; \ if [ $$? -ne 0 -o "$${i}" != "installed" ]; then \ - not_installed="$${not_installed} $${pkg}" ; \ + i=$$(dpkg-query -f '$${db:Status-Status}' -W $${pkg}:all 2>/dev/null) ; \ + if [ $$? -ne 0 -o "$${i}" != "installed" ]; then \ + not_installed="$${not_installed} $${pkg}" ; \ + fi; \ fi ; \ done ; \ if test -n "$${not_installed}" ; then \ -- cgit