From fab1c53cb38ab278f8dd81f5519efa43e72056d7 Mon Sep 17 00:00:00 2001 From: Dylan De Faoite Date: Mon, 9 Mar 2026 15:45:19 +0000 Subject: [PATCH] fix(bootstrap): entire file skip upon one package fail If one package in a file failed, the whole file was skipped. --- bootstrap.sh | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) mode change 100755 => 100644 bootstrap.sh diff --git a/bootstrap.sh b/bootstrap.sh old mode 100755 new mode 100644 index cc7c2ac..176ad7b --- a/bootstrap.sh +++ b/bootstrap.sh @@ -53,8 +53,7 @@ EOF # 2. NETWORKING # ============================================================================= -log "Installing and enabling NetworkManager" -sudo pacman -S networkmanager +log "Enabling NetworkManager" sudo systemctl enable --now NetworkManager # ============================================================================= @@ -65,6 +64,9 @@ log "Configuring pacman (colour + parallel downloads)" sudo sed -i 's/^#Color/Color/' /etc/pacman.conf sudo sed -i 's/^#ParallelDownloads.*/ParallelDownloads = 5/' /etc/pacman.conf +log "Enabling multilib repo" +sudo sed -i '/\[multilib\]/,/Include/s/^#//' /etc/pacman.conf + log "Updating mirrors and syncing package database" sudo pacman -Sy --noconfirm reflector 2>/dev/null || true sudo reflector --country Ireland,Germany --age 12 --protocol https \ @@ -79,9 +81,11 @@ sudo pacman -Syyu --noconfirm log "Installing pacman packages" for file in "$PKG_DIR"/pacman/*.txt; do log " → $(basename "$file")" - # base/linux/base-devel already installed; --needed skips them safely - sudo pacman -S --needed --noconfirm - < "$file" || \ - warn "Some packages in $(basename "$file") failed — continuing" + while IFS= read -r pkg; do + [[ -z "$pkg" || "$pkg" == \#* ]] && continue + sudo pacman -S --needed --noconfirm "$pkg" \ + || warn " Skipping pacman package not found: $pkg" + done < "$file" done # ============================================================================= @@ -114,8 +118,11 @@ fi log "Installing AUR packages" for file in "$PKG_DIR"/aur/*.txt; do log " → $(basename "$file")" - yay -S --needed --noconfirm - < "$file" || \ - warn "Some AUR packages in $(basename "$file") failed — continuing" + while IFS= read -r pkg; do + [[ -z "$pkg" || "$pkg" == \#* ]] && continue + yay -S --needed --noconfirm "$pkg" \ + || warn " Skipping AUR package not found: $pkg" + done < "$file" done # ============================================================================= @@ -167,6 +174,7 @@ sudo systemctl enable sddm # ============================================================================= log "Enabling system services" +sudo systemctl enable bluetooth sudo systemctl enable docker sudo usermod -aG docker "$USER" sudo systemctl enable earlyoom 2>/dev/null || true