Find systemd units on disk and report the packages the desktop needs

This commit is contained in:
2026-09-20 23:13:32 +00:00
parent 06204a357a
commit 3fbdd754c1
6 changed files with 108 additions and 14 deletions
+16 -1
View File
@@ -8,8 +8,23 @@ note_change() {
changes=$((changes + 1))
}
unit_search_dirs=(
/etc/systemd/system
/run/systemd/system
/usr/local/lib/systemd/system
/usr/lib/systemd/system
)
system_unit_exists() {
systemctl cat -- "$1" &>/dev/null
local unit="$1" dir
systemctl cat -- "$unit" &>/dev/null && return 0
for dir in "${unit_search_dirs[@]}"; do
[[ -e $dir/$unit ]] && return 0
done
return 1
}
user_manager_available() {