diff --git a/functions.sh b/functions.sh index 1802ec4b..9260ac25 100644 --- a/functions.sh +++ b/functions.sh @@ -896,7 +896,7 @@ check_for_version_update() { choice=$(zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --ok-label="Yes" --extra-button="No" --extra-button="Ignore this version" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Update Available" \ - --text="There is a new version of RetroDECK available!\n\nIf you would like to update to the new version now, click \"Yes\".\nIf you would like to skip reminders about this version, click \"Ignore this version\".\nYou will be reminded again at the next version update.\n\nIf you would like to disable these update notifications entirely, disable Online Update Checks in the Configurator.") + --text="There is a new version of RetroDECK available!\nYou are running version $hard_version, the latest is $online_version.\n\nIf you would like to update to the new version now, click \"Yes\".\nIf you would like to skip reminders about this version, click \"Ignore this version\".\nYou will be reminded again at the next version update.\n\nIf you would like to disable these update notifications entirely, disable Online Update Checks in the Configurator.") rc=$? # Capture return code, as "Yes" button has no text value if [[ $rc == "1" ]]; then # If any button other than "Yes" was clicked if [[ $choice == "Ignore this version" ]]; then @@ -914,11 +914,11 @@ check_for_version_update() { configurator_generic_dialog "RetroDECK Online Update" "The update process is now complete!\n\nPlease restart RetroDECK to keep the fun going." exit 1 fi - elif [[ "$update_repo" == "RetroDECK-cooker" ]] && [[ ! $current_version == $online_version ]]; then + elif [[ "$update_repo" == "RetroDECK-cooker" ]] && [[ ! $version == $online_version ]]; then choice=$(zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --ok-label="Yes" --extra-button="No" --extra-button="Ignore this version" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Update Available" \ - --text="There is a more recent build of the RetroDECK cooker branch.\n\nWould you like to update to it?\nIf you would like to skip reminders about this version, click \"Ignore this version\".\nYou will be reminded again at the next version update.\n\nIf you would like to disable these update notifications entirely, disable Online Update Checks in the Configurator.") + --text="There is a more recent build of the RetroDECK cooker branch.\nYou are running version $hard_version, the latest is $online_version.\n\nWould you like to update to it?\nIf you would like to skip reminders about this version, click \"Ignore this version\".\nYou will be reminded again at the next version update.\n\nIf you would like to disable these update notifications entirely, disable Online Update Checks in the Configurator.") rc=$? # Capture return code, as "Yes" button has no text value if [[ $rc == "1" ]]; then # If any button other than "Yes" was clicked if [[ $choice == "Ignore this version" ]]; then diff --git a/global.sh b/global.sh index c520856e..6215a12f 100755 --- a/global.sh +++ b/global.sh @@ -123,8 +123,6 @@ if [[ ! -f "$rd_conf" ]]; then if grep -qF "cooker" <<< $hard_version; then # If newly-installed version is a "cooker" build set_setting_value $rd_conf "update_repo" "RetroDECK-cooker" retrodeck "options" set_setting_value $rd_conf "update_check" "true" retrodeck "options" - update_ignore=$(curl --silent "https://api.github.com/repos/XargonWan/$update_repo/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') - set_setting_value $rd_conf "update_ignore" "$update_ignore" retrodeck "options" # Store the latest online version to ignore for future checks, as internal version and online tag version may not match up. fi echo "Setting config file permissions" diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 59b52bf8..cd350d36 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -78,7 +78,7 @@ modules: mkdir -p ${FLATPAK_DEST}/retrodeck/ if [[ $VERSION == *"cooker"* ]]; then - VERSION="$VERSION[VERSIONPLACEHOLDER]" + VERSION="$VERSION-VERSIONPLACEHOLDER" fi echo $VERSION >> ${FLATPAK_DEST}/retrodeck/version cat ${FLATPAK_DEST}/retrodeck/version diff --git a/post_update.sh b/post_update.sh index e256beae..dc038419 100644 --- a/post_update.sh +++ b/post_update.sh @@ -181,6 +181,7 @@ post_update() { --title "RetroDECK Finishing Upgrade" \ --text="RetroDECK is finishing the upgrade process, please wait." + version=$hard_version + conf_write changelog_dialog "$version" - create_lock } diff --git a/retrodeck.sh b/retrodeck.sh index 296ebb6a..086e5126 100644 --- a/retrodeck.sh +++ b/retrodeck.sh @@ -98,16 +98,12 @@ done # UPDATE TRIGGERED # if lockfile exists -if [ -f "$lockfile" ] -then +if [ -f "$lockfile" ]; then # ...but the version doesn't match with the config file - if [ "$hard_version" != "$version" ]; - then + if [ "$hard_version" != "$version" ]; then echo "Config file's version is $version but the actual version is $hard_version" if grep -qF "cooker" <<< $hard_version; then # If newly-installed version is a "cooker" build cooker_base_version=$(echo $hard_version | cut -d'-' -f2) - update_ignore=$(curl --silent "https://api.github.com/repos/XargonWan/$update_repo/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') - set_setting_value $rd_conf "update_ignore" "$update_ignore" retrodeck "options" # Store the latest online version to ignore for future checks, as internal version and online tag version may not match up. choice=$(zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --ok-label="Upgrade" --extra-button="Don't Upgrade" --extra-button="Fresh Install" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Cooker Upgrade" \ @@ -131,6 +127,8 @@ then fi else # If newly-installed version is a normal build. if grep -qF "cooker" <<< $version; then # If previously installed version was a cooker build + cooker_base_version=$(echo $version | cut -d'-' -f2) + version=$cooker_base_version # Temporarily assign cooker base version to $version so update script can read it properly. set_setting_value $rd_conf "update_repo" "RetroDECK" retrodeck "options" set_setting_value $rd_conf "update_check" "false" retrodeck "options" set_setting_value $rd_conf "update_ignore" "" retrodeck "options"