]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mkosi: stage volatile deb packages for upgrade test
authorLuca Boccassi <luca.boccassi@gmail.com>
Wed, 29 Jul 2026 13:32:26 +0000 (14:32 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 30 Jul 2026 08:13:35 +0000 (09:13 +0100)
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

index 3a4415c54712dcce05ec6a79eab3f7a72d01c02d..8a166cd16605f8509eb04123ee7381ddd161d89f 100755 (executable)
@@ -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"