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
+40 -1
View File
@@ -58,7 +58,7 @@ install_packages() {
if (( ${#repo_missing[@]} )); then
say "install ${#repo_missing[@]} repo package(s)"
as_root pacman -S --needed --noconfirm "${repo_missing[@]}"
install_repo_packages "${repo_missing[@]}"
fi
if (( ${#aur_missing[@]} )); then
@@ -71,6 +71,45 @@ install_packages() {
fi
}
install_repo_packages() {
local package
local -a failed=()
as_root pacman -S --needed --noconfirm "$@" && return 0
say "WARN the batch install failed; refreshing the package databases"
as_root pacman -Sy --noconfirm || true
as_root pacman -S --needed --noconfirm "$@" && return 0
say "WARN still failing; retrying one package at a time"
for package in "$@"; do
as_root pacman -S --needed --noconfirm "$package" || failed+=("$package")
done
(( ${#failed[@]} == 0 )) && return 0
say "WARN ${#failed[@]} repo package(s) failed to install: ${failed[*]}"
}
desktop_essentials=(sddm hyprland quickshell uwsm)
report_desktop_essentials() {
local package
local -a missing=()
for package in "${desktop_essentials[@]}"; do
package_installed "$package" || missing+=("$package")
done
if (( ${#missing[@]} == 0 )); then
say "ok desktop essentials"
return 0
fi
say "WARN the desktop cannot start without: ${missing[*]}"
say " install them with 'sudo pacman -S ${missing[*]}', then ./install.sh again"
}
install_aur_packages() {
local package
local -a failed=()