From 98b3c7f2cdeb42c0fdf71bef28423cded83b7516 Mon Sep 17 00:00:00 2001 From: Jochen Sprickerhof Date: Thu, 11 Jul 2024 15:40:32 +0200 Subject: [PATCH] m-a-b-q: replace test_installed by dpkg-checkbuilddeps --- mmdebstrap-autopkgtest-build-qemu | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/mmdebstrap-autopkgtest-build-qemu b/mmdebstrap-autopkgtest-build-qemu index 294ab58..76af46b 100755 --- a/mmdebstrap-autopkgtest-build-qemu +++ b/mmdebstrap-autopkgtest-build-qemu @@ -273,26 +273,14 @@ case "$ARCHITECTURE" in ;; esac -test_installed() { - pkg="$1" - if [ "$(dpkg-query -f '${db:Status-Status}' -W "$pkg")" != installed ]; then - die "please install $pkg" - fi -} - -for pkg in autopkgtest dosfstools e2fsprogs fdisk mount mtools passwd uidmap libarchive13; do - test_installed "$pkg" -done - if test "$(dpkg-query -f '${db:Status-Status}' -W binutils-multiarch)" = installed; then GNU_PREFIX= + BINUTILS= else - test_installed dpkg-dev GNU_ARCHITECTURE="$(dpkg-architecture "-a$ARCHITECTURE" -qDEB_HOST_GNU_TYPE)" GNU_PREFIX="$GNU_ARCHITECTURE-" GNU_SUFFIX="-$(echo "$GNU_ARCHITECTURE" | tr _ -)" - test "$(dpkg-query -f '${db:Status-Status}' -W "binutils$GNU_SUFFIX")" = installed || - die "please install binutils$GNU_SUFFIX or binutils-multiarch" + BINUTILS=", binutils$GNU_SUFFIX | binutils-multiarch" fi arches=" $(dpkg --print-architecture) $(dpkg --print-foreign-architectures | tr '\n' ' ') " @@ -301,7 +289,11 @@ case $arches in *) die "enable $ARCHITECTURE by running: sudo dpkg --add-architecture $ARCHITECTURE && sudo apt update" ;; esac -test_installed "systemd-boot-efi:$ARCHITECTURE" +test "$(dpkg-query -f '${db:Status-Status}' -W "dpkg-dev")" = installed || + die "please install dpkg-dev" + +dpkg-checkbuilddeps -d "autopkgtest, dosfstools, e2fsprogs, fdisk, mount, mtools, passwd, uidmap, libarchive13, systemd-boot-efi:$ARCHITECTURE $BINUTILS" /dev/null || + die "please install the required packages listed above" BOOTSTUB="/usr/lib/systemd/boot/efi/linux${EFIIMG#boot}.stub"