46 lines
1.5 KiB
Bash
46 lines
1.5 KiB
Bash
#!/bin/bash
|
|
|
|
COREDESKTOP="$HOME/.local/share/coredesktop"
|
|
|
|
source "$COREDESKTOP/utils.sh"
|
|
source "$COREDESKTOP/packages.conf"
|
|
source "$COREDESKTOP/remove-packages.conf"
|
|
|
|
STATUS=0
|
|
|
|
echo "Removing unwanted packages..."
|
|
remove_packages "${REMOVE_PACMAN[@]}"
|
|
remove_flatpaks "${REMOVE_FLATPAKS[@]}"
|
|
|
|
# Machines installed before Federated Calendar need the repo before the -Sy
|
|
# below and install_packages, so this can't wait for a migration
|
|
echo "Checking the Federated Computer package repo..."
|
|
ensure_federated_repo || STATUS=1
|
|
|
|
# A machine that hasn't updated in a while can have a keyring too old to verify
|
|
# the new packages. Update it first; the -Su below completes this -Sy.
|
|
echo "Updating Arch keyring..."
|
|
sudo pacman -Sy --needed --noconfirm archlinux-keyring || STATUS=1
|
|
|
|
# script(1) keeps pacman's progress bars while logging its output for the
|
|
# initramfs check
|
|
echo "Updating Arch..."
|
|
mkdir -p "$(dirname "$PACMAN_UPDATE_LOG")"
|
|
: > "$PACMAN_UPDATE_LOG"
|
|
sudo script -qefc "pacman -Su --noconfirm" "$PACMAN_UPDATE_LOG" || STATUS=1
|
|
|
|
if initramfs_build_failed; then
|
|
echo -e "\e[31mRebuilding the initramfs failed. Don't reboot until it's fixed - see the output above or $PACMAN_UPDATE_LOG.\e[0m"
|
|
STATUS=1
|
|
fi
|
|
|
|
echo "Checking for new packages..."
|
|
install_packages "${SYSTEM_UTILS[@]}" || STATUS=1
|
|
install_packages "${DEV_TOOLS[@]}" || STATUS=1
|
|
install_packages "${MAINTENANCE[@]}" || STATUS=1
|
|
install_packages "${DESKTOP[@]}" || STATUS=1
|
|
install_packages "${MEDIA[@]}" || STATUS=1
|
|
install_packages "${FONTS[@]}" || STATUS=1
|
|
|
|
exit $STATUS
|