diff --git a/usr/bin/setup-assistant b/usr/bin/setup-assistant index 5d4a98b..2ec52e7 100755 --- a/usr/bin/setup-assistant +++ b/usr/bin/setup-assistant @@ -70,9 +70,15 @@ function isOnline function upgrade2ultimate { PACKAGES=() + # WARNING: Currently not executed in pamac mode! PREPARE=() SETUP=() + HAS_PAMAC_INSTALLER=false + if [ -x "$(command -v pamac-installer)" ]; then + HAS_PAMAC_INSTALLER=true + fi + if ! askYesNoQuestion "font-manager" "Upgrade to ULTIMATE" "update" "Do you need cjk font support (fixes missing characters)?"; then PACKAGES+=("noto-fonts-cjk") fi @@ -215,10 +221,17 @@ function upgrade2ultimate SETUP+=("systemctl enable --now libvirtd") fi - alacritty -e bash /usr/lib/setup-assistant/apply.sh <( IFS=$'\n'; echo "${PREPARE[*]}" ) <(printf '%s\n' "${PACKAGES[@]}") <( IFS=$'\n'; echo "${SETUP[*]}" ) + if [ "$HAS_PAMAC_INSTALLER" = "true" ]; then + # Pamac can correctly handle the pamac-aur and pamac-all conflict, PREPARE can be ignored here. + if ! pamac-installer ${PACKAGES[@]} ; then + exit 0 + fi + pkexec bash -c "$( IFS=$'\n'; echo "${SETUP[*]}" )" + else + alacritty -e bash /usr/lib/setup-assistant/apply.sh <( IFS=$'\n'; echo "${PREPARE[*]}" ) <(printf '%s\n' "${PACKAGES[@]}") <( IFS=$'\n'; echo "${SETUP[*]}" ) + fi } -# I'm kind of confused why this is not part of the installer? systemctl --user enable psd >/dev/null 2>&1 & systemctl --user start psd >/dev/null 2>&1 & @@ -237,7 +250,8 @@ if ! askYesNoQuestion "update" "Setup Assistant" "update" "Do you want to get a fi if ! askYesNoQuestion "update" "Setup Assistant" "update" "Update the system? (recommended!)"; then - alacritty -e sudo pacman "-Syyu" + # yy because we may have updated the mirrorlist in the last step + alacritty -e pkexec pacman "-Syyu" fi if ! askYesNoQuestion "update" "Setup Assistant" "update" "Upgrade to Ultimate? (You can select which apps you want!)"; then