diff options
author | Konstantin Pavlov <thresh@nginx.com> | 2024-06-17 20:08:49 +0000 |
---|---|---|
committer | Konstantin Pavlov <pavlov.konstantin@gmail.com> | 2024-08-19 12:27:38 -0700 |
commit | 5d32e500b7dc70ec831540ee00b1316336379060 (patch) | |
tree | 0b9aa6b6ad4a2dc3a013316092e69360122bd5f5 /pkg | |
parent | 202242790764bf38aa4f4598f787175b9cc7e4ef (diff) | |
download | unit-5d32e500b7dc70ec831540ee00b1316336379060.tar.gz unit-5d32e500b7dc70ec831540ee00b1316336379060.tar.bz2 |
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.
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/deb/Makefile | 7 |
1 files changed, 5 insertions, 2 deletions
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 \ |