From 2b3eb346ff76fb4c08973fddb91a9498a5b3ebf9 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Tue, 6 Aug 2024 11:08:54 +0900 Subject: [PATCH] FRAMEWORK: fixing online updater to point to the new org/repo --- functions/checks.sh | 6 +++--- functions/global.sh | 6 ++++-- retrodeck.sh | 2 +- tools/configurator.sh | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/functions/checks.sh b/functions/checks.sh index d0a60f73..9d1de11d 100644 --- a/functions/checks.sh +++ b/functions/checks.sh @@ -44,10 +44,10 @@ check_for_version_update() { log d "Entering funtcion check_for_version_update" - wget -q --spider "https://api.github.com/repos/XargonWan/$update_repo/releases/latest" + wget -q --spider "https://api.github.com/repos/$git_organization_name/$update_repo/releases/latest" if [ $? -eq 0 ]; then - local online_version=$(curl --silent "https://api.github.com/repos/XargonWan/$update_repo/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') + local online_version=$(curl --silent "https://api.github.com/repos/$git_organization_name/$update_repo/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') if [[ ! "$update_ignore" == "$online_version" ]]; then if [[ "$update_repo" == "RetroDECK" ]] && [[ $(sed -e 's/[\.a-z]//g' <<< $version) -le $(sed -e 's/[\.a-z]//g' <<< $online_version) ]]; then @@ -83,7 +83,7 @@ check_for_version_update() { log i "Selected: \"OK\"" set_setting_value $rd_conf "update_ignore" "$online_version" retrodeck "options" # Store version to ignore for future checks fi - elif [[ "$update_repo" == "RetroDECK-cooker" ]] && [[ ! $version == $online_version ]]; then + elif [[ "$update_repo" == "$cooker_repository_name" ]] && [[ ! $version == $online_version ]]; then log i "Showing update request dialog as \"$online_version\" was found and is greater then \"$version\"" choice=$(rd_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" \ diff --git a/functions/global.sh b/functions/global.sh index 52db4426..8623902f 100644 --- a/functions/global.sh +++ b/functions/global.sh @@ -49,6 +49,8 @@ RA_API_URL="https://retroachievements.org/dorequest.php" presets_dir="$emuconfigs/defaults/retrodeck/presets" # Repository for all system preset config files incompatible_presets_reference_list="$emuconfigs/defaults/retrodeck/reference_lists/incompatible_presets.cfg" # A config file listing all incompatible presets for reference (eg. cannot have borders and widescreen enabled simultaniously) pretty_system_names_reference_list="$emuconfigs/defaults/retrodeck/reference_lists/pretty_system_names.cfg" # An internal translation list for turning internal names (eg. gbc) to "pretty" names (Nintendo GameBoy Color) +git_organization_name="RetroDECK" # The name of the organization in our git repository such as GitHub +cooker_repository_name="Cooker" # The name of the cooker repository under RetroDECK organization # Godot data transfer temp files @@ -176,7 +178,7 @@ if [[ ! -f "$rd_conf" ]]; then set_setting_value $rd_conf "sdcard" "$default_sd" retrodeck "paths" # Set SD card location if default path has changed if grep -qF "cooker" <<< "$hard_version" || grep -qF "PR-" <<< "$hard_version"; then # If newly-installed version is a "cooker" or PR build - set_setting_value $rd_conf "update_repo" "RetroDECK-cooker" retrodeck "options" + set_setting_value $rd_conf "update_repo" "$cooker_repository_name" retrodeck "options" set_setting_value $rd_conf "update_check" "true" retrodeck "options" set_setting_value $rd_conf "developer_options" "true" retrodeck "options" fi @@ -193,7 +195,7 @@ else log i "Loading it" 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" "$cooker_repository_name" retrodeck "options" set_setting_value $rd_conf "update_check" "true" retrodeck "options" set_setting_value $rd_conf "developer_options" "true" retrodeck "options" fi diff --git a/retrodeck.sh b/retrodeck.sh index b2ef5a7e..1c2b1f85 100644 --- a/retrodeck.sh +++ b/retrodeck.sh @@ -109,7 +109,7 @@ if [ -f "$lockfile" ]; then if grep -qF "cooker" <<< $hard_version; then # If newly-installed version is a "cooker" build log d "Newly-installed version is a \"cooker\" build" configurator_generic_dialog "RetroDECK Cooker Warning" "RUNNING COOKER VERSIONS OF RETRODECK CAN BE EXTREMELY DANGEROUS AND ALL OF YOUR RETRODECK DATA\n(INCLUDING BIOS FILES, BORDERS, DOWNLOADED MEDIA, GAMELISTS, MODS, ROMS, SAVES, STATES, SCREENSHOTS, TEXTURE PACKS AND THEMES)\nARE AT RISK BY CONTINUING!" - set_setting_value $rd_conf "update_repo" "RetroDECK-cooker" retrodeck "options" + set_setting_value $rd_conf "update_repo" "$cooker_repository_name" retrodeck "options" set_setting_value $rd_conf "update_check" "true" retrodeck "options" set_setting_value $rd_conf "developer_options" "true" retrodeck "options" cooker_base_version=$(echo $hard_version | cut -d'-' -f2) diff --git a/tools/configurator.sh b/tools/configurator.sh index 27514d6a..c2d455e0 100644 --- a/tools/configurator.sh +++ b/tools/configurator.sh @@ -1367,7 +1367,7 @@ configurator_online_update_channel_dialog() { if [ $? == 0 ] # User clicked "Yes" then - set_setting_value $rd_conf "update_repo" "RetroDECK-cooker" retrodeck "options" + set_setting_value $rd_conf "update_repo" "$cooker_repository_name" retrodeck "options" else # User clicked "Cancel" configurator_developer_dialog fi