various improvements and fixes

This commit is contained in:
2026-10-27 06:30:58 -06:00
parent 72a33d7320
commit 44c67c980f
10 changed files with 83 additions and 45 deletions
+9
View File
@@ -15,12 +15,21 @@ install_packages() {
local packages=("$@")
local to_install=()
local as_deps=()
for pkg in "${packages[@]}"; do
if ! is_installed "$pkg" && ! is_group_installed "$pkg"; then
to_install+=("$pkg")
fi
done
# A package first installed as another one's dependency becomes an orphan
# when that one is removed, and updates.d/95-cleanup.sh removes orphans
mapfile -t as_deps < <(pacman -Qdq "${packages[@]}" 2> /dev/null)
if [ ${#as_deps[@]} -ne 0 ]; then
sudo pacman -D --asexplicit "${as_deps[@]}" > /dev/null
fi
if [ ${#to_install[@]} -ne 0 ]; then
echo "Installing: ${to_install[*]}"
yay -S --noconfirm --answerdiff=None --answeredit=None --answerclean=None "${to_install[@]}"