summaryrefslogtreecommitdiffstats
path: root/mkosi.conf.d/10-opensuse/mkosi.prepare
diff options
context:
space:
mode:
Diffstat (limited to 'mkosi.conf.d/10-opensuse/mkosi.prepare')
-rwxr-xr-xmkosi.conf.d/10-opensuse/mkosi.prepare8
1 files changed, 5 insertions, 3 deletions
diff --git a/mkosi.conf.d/10-opensuse/mkosi.prepare b/mkosi.conf.d/10-opensuse/mkosi.prepare
index 6ee0af2..728b502 100755
--- a/mkosi.conf.d/10-opensuse/mkosi.prepare
+++ b/mkosi.conf.d/10-opensuse/mkosi.prepare
@@ -6,18 +6,20 @@ if [[ "$1" == "build" ]]; then
exit 0
fi
+mapfile -t PACKAGES < <(jq --raw-output .VolatilePackages[] <"$MKOSI_CONFIG")
+
DEPS=""
-while read -r PACKAGE; do
+for PACKAGE in "${PACKAGES[@]}"; do
# zypper's output is not machine readable so we make do with sed instead.
DEPS="$DEPS\n$(
zypper info --requires --recommends --suggests "$PACKAGE" |
sed '/Requires/,$!d' | # Remove everything before Requires line
sed --quiet 's/^ //p' # All indented lines have dependencies
)"
-done < <(jq --raw-output .VolatilePackages[] <"$MKOSI_CONFIG")
+done
echo -e "$DEPS" |
- grep --invert-match --regexp systemd --regexp udev --regexp qemu |
+ grep --extended-regexp --invert-match --regexp "$(IFS=\| ; echo "${PACKAGES[*]}")" --regexp qemu |
sort --unique |
xargs --delimiter '\n' --no-run-if-empty mkosi-install