Fix version change detection logic for cookers

This commit is contained in:
icenine451 2024-03-27 09:11:52 -04:00
parent 26de86eed5
commit fb4a1525c5
2 changed files with 9 additions and 1 deletions

View file

@ -171,5 +171,12 @@ elif [[ "$new_version_major_rev" -eq "$current_version_major_rev" ]]; then
fi fi
fi fi
# Perform post_update commands for current version if it is a cooker
if grep -qF "cooker" <<< $hard_version; then # If newly-installed version is a "cooker" build, always perform post_update commands for current version
if [[ "$(echo $hard_version | cut -d'-' -f2)" == "$new_version" ]]; then
is_newer_version="true"
fi
fi
echo "$is_newer_version" echo "$is_newer_version"
} }

View file

@ -102,8 +102,8 @@ done
log d "Update triggered" log d "Update triggered"
# if lockfile exists # if lockfile exists
if [ -f "$lockfile" ]; then if [ -f "$lockfile" ]; then
log d "Lockfile found but the version doesn't match with the config file"
if [ "$hard_version" != "$version" ]; then if [ "$hard_version" != "$version" ]; then
log d "Lockfile found but the version doesn't match with the config file"
log i "Config file's version is $version but the actual version is $hard_version" log i "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
log d "Newly-installed version is a \"cooker\" build" log d "Newly-installed version is a \"cooker\" build"
@ -130,6 +130,7 @@ if [ -f "$lockfile" ]; then
log w "Removing RetroDECK data and starting fresh" log w "Removing RetroDECK data and starting fresh"
rm -rf /var rm -rf /var
rm -rf "$HOME/retrodeck" rm -rf "$HOME/retrodeck"
rm -rf "$rdhome"
source /app/libexec/global.sh source /app/libexec/global.sh
finit finit
fi fi