From f029c336e9dc6c01780cce9cc41162f8a34ebad5 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Wed, 29 Jul 2026 14:32:26 +0100 Subject: [PATCH] mkosi: stage volatile deb packages for upgrade test Prepare scripts run before volatile packages are installed, so parse the list from the config to ensure they are all included to avoid failures due to some packages missing from the list. Follow-up for 28e1f84d6a2721000b0d781220b154f0bed50cc8 --- mkosi/mkosi.conf.d/debian-ubuntu/mkosi.prepare | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/mkosi/mkosi.conf.d/debian-ubuntu/mkosi.prepare b/mkosi/mkosi.conf.d/debian-ubuntu/mkosi.prepare index 3a4415c547..8a166cd166 100755 --- a/mkosi/mkosi.conf.d/debian-ubuntu/mkosi.prepare +++ b/mkosi/mkosi.conf.d/debian-ubuntu/mkosi.prepare @@ -40,6 +40,7 @@ if [[ $deltaver -le 0 ]]; then exit 0 fi +declare -A packages=() distro_packages=() devel_packages=() @@ -48,7 +49,18 @@ while IFS=$'\t' read -r package source package_architecture; do [[ $package_architecture == "$DISTRIBUTION_ARCHITECTURE" || $package_architecture == all ]] || continue [[ $package != *-dbgsym* ]] || continue - devel_packages+=("$package=$(dpkg-query --root="$BUILDROOT" --showformat='${Version}' --show "$package")") + packages["$package"]= +done < <(dpkg-query --root="$BUILDROOT" --show --showformat='${Package}\t${source:Package}\t${Architecture}\n') + +# Prepare scripts run before VolatilePackages are installed, so include them explicitly. +while read -r package; do + [[ $package != *-dbgsym* ]] || continue + + packages["$package"]= +done < <(jq --raw-output '.VolatilePackages[]' <"$MKOSI_CONFIG") + +for package in "${!packages[@]}"; do + devel_packages+=("$package=$develver") package_versions=$(apt-cache madison "$package") if awk -F '|' -v version="$distrover" ' @@ -63,7 +75,7 @@ while IFS=$'\t' read -r package source package_architecture; do ' <<<"$package_versions"; then distro_packages+=("$package=$distrover") fi -done < <(dpkg-query --root="$BUILDROOT" --show --showformat='${binary:Package}\t${source:Package}\t${Architecture}\n') +done if (( ${#distro_packages[@]} == 0 )); then echo "Skipping upgrade test, no distro packages found"