Fix failed move commands in 0.8.2b post_update and add recovery for previous failed moves in 0.8.3b

This commit is contained in:
icenine451 2024-07-21 18:33:24 -04:00
parent 3c2128f21d
commit 297f8fe329

View file

@ -340,15 +340,40 @@ post_update() {
if [[ $(check_version_is_older_than "0.8.2b") == "true" ]]; then if [[ $(check_version_is_older_than "0.8.2b") == "true" ]]; then
log i "Vita3K changed some paths, reflecting them: moving \"/var/data/Vita3K\" in \"/var/config/Vita3K\"" log i "Vita3K changed some paths, reflecting them: moving \"/var/data/Vita3K\" in \"/var/config/Vita3K\""
mv -f "/var/data/Vita3K" "/var/config/Vita3K" move "/var/data/Vita3K" "/var/config/Vita3K"
log i "Moving ES-DE downloaded_media, gamelist, and themes from \"$rdhome\" to \"$rdhome/ES-DE\" due to a RetroDECK Framework bug" log i "Moving ES-DE downloaded_media, gamelist, and themes from \"$rdhome\" to \"$rdhome/ES-DE\" due to a RetroDECK Framework bug"
mv -f "$rdhome/themes" "$rdhome/ES-DE/themes" && log d "Move of \"$rdhome/themes\" completed" move "$rdhome/themes" "$rdhome/ES-DE/themes" && log d "Move of \"$rdhome/themes\" completed"
mv -f "$rdhome/downloaded_media" "$rdhome/ES-DE/downloaded_media" && log d "Move of \"$rdhome/downloaded_media\" completed" move "$rdhome/downloaded_media" "$rdhome/ES-DE/downloaded_media" && log d "Move of \"$rdhome/downloaded_media\" completed"
mv -f "$rdhome/gamelists/"* "$rdhome/ES-DE/gamelists" && log d "Move of \"$rdhome/gamelists/\" completed" && rm -rf "$rdhome/gamelists" move "$rdhome/gamelists" "$rdhome/ES-DE/gamelists" && log d "Move of \"$rdhome/gamelists/\" completed"
log i "Since in this version we moved to a PR build of Ryujinx we need to symlink it." log i "Since in this version we moved to a PR build of Ryujinx we need to symlink it."
ln -sv $ryujinxconf "$(dirname $ryujinxconf)/PRConfig.json" ln -sv $ryujinxconf "$(dirname $ryujinxconf)/PRConfig.json"
fi fi
if [[ $(check_version_is_older_than "0.8.3b") == "true" ]]; then
# In version 0.8.3b, the following changes were made:
# - Recovery from a failed move of the themes, downloaded_media and gamelists folder to their new ES-DE locations.
if [[ !-d "$rdhome/ES-DE/themes" || ! -d "$rdhome/ES-DE/downloaded_media" || ! -d "$rdhome/ES-DE/gamelists" ]]; then
log i "Moving ES-DE downloaded_media, gamelist, and themes from \"$rdhome\" to \"$rdhome/ES-DE\" due to a RetroDECK Framework bug"
if [[ -d "$rdhome/themes" && ! -d "$rdhome/ES-DE/themes" ]]; then
move "$rdhome/themes" "$rdhome/ES-DE/themes" && log d "Move of \"$rdhome/themes\" completed"
else
log i "ES-DE themes appears to already have been migrated."
fi
if [[ -d "$rdhome/downloaded_media" && ! -d "$rdhome/ES-DE/downloaded_media" ]]; then
move "$rdhome/downloaded_media" "$rdhome/ES-DE/downloaded_media" && log d "Move of \"$rdhome/downloaded_media\" completed"
else
log i "ES-DE downloaded media appears to already have been migrated."
fi
if [[ -d "$rdhome/gamelists" && ! -d "$rdhome/ES-DE/gamelists" ]]; then
move "$rdhome/gamelists" "$rdhome/ES-DE/gamelists" && log d "Move of \"$rdhome/gamelists/\" completed"
else
log i "ES-DE gamelists appears to already have been migrated."
fi
else
log i "ES-DE dfolders appears to already have been migrated."
fi
fi
# if [[ $(check_version_is_older_than "0.9.0b") == "true" ]]; then # if [[ $(check_version_is_older_than "0.9.0b") == "true" ]]; then
# # Placeholder for version 0.9.0b # # Placeholder for version 0.9.0b
# rm /var/config/emulationstation/.emulationstation # remving the old symlink to .emulationstation as it might be not needed anymore # rm /var/config/emulationstation/.emulationstation # remving the old symlink to .emulationstation as it might be not needed anymore