summaryrefslogtreecommitdiffstats
path: root/mkosi.conf.d/10-debian-ubuntu/mkosi.prepare
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-16 18:28:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-16 18:28:34 +0000
commit39bea55b2de0eabc2a876ed40dd664d1f80cbcd2 (patch)
tree440d70559330bcdfe14968d44dd5d33ea570281e /mkosi.conf.d/10-debian-ubuntu/mkosi.prepare
parentReleasing progress-linux version 256.5-2~progress7.99u1. (diff)
downloadsystemd-39bea55b2de0eabc2a876ed40dd664d1f80cbcd2.tar.xz
systemd-39bea55b2de0eabc2a876ed40dd664d1f80cbcd2.zip
Merging upstream version 256.6.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mkosi.conf.d/10-debian-ubuntu/mkosi.prepare')
-rwxr-xr-xmkosi.conf.d/10-debian-ubuntu/mkosi.prepare26
1 files changed, 20 insertions, 6 deletions
diff --git a/mkosi.conf.d/10-debian-ubuntu/mkosi.prepare b/mkosi.conf.d/10-debian-ubuntu/mkosi.prepare
index acab113..bf2c5eb 100755
--- a/mkosi.conf.d/10-debian-ubuntu/mkosi.prepare
+++ b/mkosi.conf.d/10-debian-ubuntu/mkosi.prepare
@@ -8,9 +8,23 @@ fi
mapfile -t PACKAGES < <(jq --raw-output .VolatilePackages[] <"$MKOSI_CONFIG")
-apt-cache depends "${PACKAGES[@]}" |
- grep --invert-match --regexp "<" --regexp "|" --regexp systemd | # Remove e.g. <python3:any> and |dbus-broker like results
- grep --extended-regexp "Depends|Suggests|Recommends" |
- sed --quiet 's/.*: //p' | # Get every line with ": " in it and strip it at the same time.
- sort --unique |
- xargs --delimiter '\n' --no-run-if-empty mkosi-install
+PATTERNS=()
+
+# The ?reverse-depends() pattern for some weird reason lists all the packages providing systemd-sysusers
+# instead of just excluding it, so we add another pattern to filter out anything that conflicts with
+# any other systemd packages so we filter out both opensysusers and systemd-sysusers-standalone. We also
+# exclude packages that belong to the systemd source package as we'll install these later. Finally, we
+# exclude virtual packages as trying to install these makes apt fail with an error saying we need to install
+# a specific implementation even if one is already installed.
+COMMON="?not(?virtual), ?not(?reverse-conflicts(?source-package(^systemd$))), ?not(?reverse-breaks(?source-package(^systemd$))), ?not(?source-package(^systemd$))"
+
+for PACKAGE in "${PACKAGES[@]}"; do
+ # Get all the dependencies of the systemd packages including recommended and suggested dependencies.
+ PATTERNS+=(
+ "?and(?reverse-depends(?exact-name($PACKAGE)), $COMMON)"
+ "?and(?reverse-recommends(?exact-name($PACKAGE)), $COMMON)"
+ "?and(?reverse-suggests(?exact-name($PACKAGE)), $COMMON)"
+ )
+done
+
+mkosi-install "${PATTERNS[@]}"