From abe5c72c55f142c9f6ecc4322b9460c2712f6167 Mon Sep 17 00:00:00 2001 From: TotallyNotElite Date: Sat, 19 Dec 2020 20:16:41 +0100 Subject: [PATCH] Support setup-assistant self update If the user does a full system upgrade using the setup assistant, the setup assistant could end up in a state where it is no longer compatible with its own /usr/lib files. We can prevent this by making the setup assistant reload itself after a system ugprade. This also allows us to apply updates to the setup assistant without releasing new ISO files. --- usr/bin/setup-assistant | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/usr/bin/setup-assistant b/usr/bin/setup-assistant index 4d4ade4..0fa05e4 100755 --- a/usr/bin/setup-assistant +++ b/usr/bin/setup-assistant @@ -232,26 +232,29 @@ function upgrade2ultimate fi } -systemctl --user enable psd >/dev/null 2>&1 & -systemctl --user start psd >/dev/null 2>&1 & +if [ -z "$SETUP_ASSISTANT_SELFUPDATE" ]; then + systemctl --user enable psd >/dev/null 2>&1 & + systemctl --user start psd >/dev/null 2>&1 & -libinput-gestures-setup autostart >/dev/null 2>&1 & -libinput-gestures-setup start >/dev/null 2>&1 & + libinput-gestures-setup autostart >/dev/null 2>&1 & + libinput-gestures-setup start >/dev/null 2>&1 & -while ! isOnline -do - if askYesNoQuestion "update" "Setup Assistant" "update" "No internet connection available, try again?"; then - exit 0 + while ! isOnline + do + if askYesNoQuestion "update" "Setup Assistant" "update" "No internet connection available, try again?"; then + exit 0 + fi + done + + if ! askYesNoQuestion "update" "Setup Assistant" "update" "Do you want to get a recent mirrorlist?"; then + reflector-simple >/dev/null 2>&1 fi -done -if ! askYesNoQuestion "update" "Setup Assistant" "update" "Do you want to get a recent mirrorlist?"; then - reflector-simple >/dev/null 2>&1 -fi - -if ! askYesNoQuestion "update" "Setup Assistant" "update" "Update the system? (recommended!)"; then - # yy because we may have updated the mirrorlist in the last step - alacritty -e pkexec bash -c "pacman -Syyu; read -p 'Press enter to continue'" + if ! askYesNoQuestion "update" "Setup Assistant" "update" "Update the system? (recommended!)"; then + # yy because we may have updated the mirrorlist in the last step + alacritty -e pkexec bash -c "pacman -Syyu; read -p 'Press enter to continue'" + SETUP_ASSISTANT_SELFUPDATE=1 exec setup-assistant + fi fi if ! askYesNoQuestion "update" "Setup Assistant" "update" "Upgrade to Ultimate? (You can select which apps you want!)"; then