mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2025-02-16 19:35:39 +00:00
More online updater fixes, to match new codenames
This commit is contained in:
parent
13acb4199c
commit
9fd4ab747b
|
@ -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" \
|
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" \
|
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
||||||
--title "RetroDECK Update Available" \
|
--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
|
rc=$? # Capture return code, as "Yes" button has no text value
|
||||||
if [[ $rc == "1" ]]; then # If any button other than "Yes" was clicked
|
if [[ $rc == "1" ]]; then # If any button other than "Yes" was clicked
|
||||||
if [[ $choice == "Ignore this version" ]]; then
|
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."
|
configurator_generic_dialog "RetroDECK Online Update" "The update process is now complete!\n\nPlease restart RetroDECK to keep the fun going."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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" \
|
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" \
|
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
||||||
--title "RetroDECK Update Available" \
|
--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
|
rc=$? # Capture return code, as "Yes" button has no text value
|
||||||
if [[ $rc == "1" ]]; then # If any button other than "Yes" was clicked
|
if [[ $rc == "1" ]]; then # If any button other than "Yes" was clicked
|
||||||
if [[ $choice == "Ignore this version" ]]; then
|
if [[ $choice == "Ignore this version" ]]; then
|
||||||
|
|
|
@ -123,8 +123,6 @@ if [[ ! -f "$rd_conf" ]]; then
|
||||||
if grep -qF "cooker" <<< $hard_version; then # If newly-installed version is a "cooker" build
|
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_repo" "RetroDECK-cooker" retrodeck "options"
|
||||||
set_setting_value $rd_conf "update_check" "true" 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
|
fi
|
||||||
|
|
||||||
echo "Setting config file permissions"
|
echo "Setting config file permissions"
|
||||||
|
|
|
@ -78,7 +78,7 @@ modules:
|
||||||
mkdir -p ${FLATPAK_DEST}/retrodeck/
|
mkdir -p ${FLATPAK_DEST}/retrodeck/
|
||||||
if [[ $VERSION == *"cooker"* ]];
|
if [[ $VERSION == *"cooker"* ]];
|
||||||
then
|
then
|
||||||
VERSION="$VERSION[VERSIONPLACEHOLDER]"
|
VERSION="$VERSION-VERSIONPLACEHOLDER"
|
||||||
fi
|
fi
|
||||||
echo $VERSION >> ${FLATPAK_DEST}/retrodeck/version
|
echo $VERSION >> ${FLATPAK_DEST}/retrodeck/version
|
||||||
cat ${FLATPAK_DEST}/retrodeck/version
|
cat ${FLATPAK_DEST}/retrodeck/version
|
||||||
|
|
|
@ -181,6 +181,7 @@ post_update() {
|
||||||
--title "RetroDECK Finishing Upgrade" \
|
--title "RetroDECK Finishing Upgrade" \
|
||||||
--text="RetroDECK is finishing the upgrade process, please wait."
|
--text="RetroDECK is finishing the upgrade process, please wait."
|
||||||
|
|
||||||
|
version=$hard_version
|
||||||
|
conf_write
|
||||||
changelog_dialog "$version"
|
changelog_dialog "$version"
|
||||||
create_lock
|
|
||||||
}
|
}
|
||||||
|
|
10
retrodeck.sh
10
retrodeck.sh
|
@ -98,16 +98,12 @@ done
|
||||||
|
|
||||||
# UPDATE TRIGGERED
|
# UPDATE TRIGGERED
|
||||||
# if lockfile exists
|
# if lockfile exists
|
||||||
if [ -f "$lockfile" ]
|
if [ -f "$lockfile" ]; then
|
||||||
then
|
|
||||||
# ...but the version doesn't match with the config file
|
# ...but the version doesn't match with the config file
|
||||||
if [ "$hard_version" != "$version" ];
|
if [ "$hard_version" != "$version" ]; then
|
||||||
then
|
|
||||||
echo "Config file's version is $version but the actual version is $hard_version"
|
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
|
if grep -qF "cooker" <<< $hard_version; then # If newly-installed version is a "cooker" build
|
||||||
cooker_base_version=$(echo $hard_version | cut -d'-' -f2)
|
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" \
|
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" \
|
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
||||||
--title "RetroDECK Cooker Upgrade" \
|
--title "RetroDECK Cooker Upgrade" \
|
||||||
|
@ -131,6 +127,8 @@ then
|
||||||
fi
|
fi
|
||||||
else # If newly-installed version is a normal build.
|
else # If newly-installed version is a normal build.
|
||||||
if grep -qF "cooker" <<< $version; then # If previously installed version was a cooker 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_repo" "RetroDECK" retrodeck "options"
|
||||||
set_setting_value $rd_conf "update_check" "false" retrodeck "options"
|
set_setting_value $rd_conf "update_check" "false" retrodeck "options"
|
||||||
set_setting_value $rd_conf "update_ignore" "" retrodeck "options"
|
set_setting_value $rd_conf "update_ignore" "" retrodeck "options"
|
||||||
|
|
Loading…
Reference in a new issue