From dabfac59b0bdfd519443698b967031f5583c649b Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Mon, 28 Feb 2022 07:36:07 -0500 Subject: [PATCH] Update the audiogame cache to be stored in the proper place according to the XDG spec. This was easier than I was expecting, so watch for bugs. --- audiogame-manager.sh | 8 +++++++- game-scripts/crazy-party-update.sh | 2 +- game-scripts/swamp-update.sh | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index 4d1d141..8dcb63e 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -814,10 +814,16 @@ if [[ -z "$DISPLAY" ]]; then export DISPLAY=":0" fi # Settings file -cache="${XDG_CONFIG_HOME:-$HOME/.config}/storm-games/audiogame-manager/cache" +cache="${XDG_CACHE_HOME:-$HOME/.cache}/audiogame-manager" configFile="${XDG_CONFIG_HOME:-$HOME/.config}/storm-games/audiogame-manager/games.conf" mkdir -p "${cache}" mkdir -p "${configFile%/*}" +# Update the cache for older versions of audiogame-manager +if [[ -d "${configFile%/*}/cache" ]]; then + { mv -v "${configFile%/*}/cache/"* "${cache}" + rmdir -v "${configFile%/*}/cache/"; } | dialog \ + --backtitle "Audiogame Manager" --progressbox "Updating cache, please wait..." -1 -1 +fi checkWinetricksUpdate="false" # Turn off debug messages export WINEDEBUG="-all" diff --git a/game-scripts/crazy-party-update.sh b/game-scripts/crazy-party-update.sh index 30c0a64..b6c783f 100755 --- a/game-scripts/crazy-party-update.sh +++ b/game-scripts/crazy-party-update.sh @@ -37,7 +37,7 @@ # Works which are defined in the CPAL as a work which combines Covered Code # or portions thereof with code not governed by the terms of the CPAL. -cache="${XDG_CONFIG_HOME:-$HOME/.config}/storm-games/audiogame-manager/cache" +cache="${XDG_CACHE_HOME:-$HOME/.cache}/audiogame-manager" configFile="${XDG_CONFIG_HOME:-$HOME/.config}/storm-games/audiogame-manager/games.conf" url="http://pragmapragma.free.fr/crazy-party/Crazy-Party-beta77.zip" (rm -v "${cache}/Crazy-Party-beta76.zip" diff --git a/game-scripts/swamp-update.sh b/game-scripts/swamp-update.sh index e69f551..f44b273 100755 --- a/game-scripts/swamp-update.sh +++ b/game-scripts/swamp-update.sh @@ -37,7 +37,7 @@ # Works which are defined in the CPAL as a work which combines Covered Code # or portions thereof with code not governed by the terms of the CPAL. -cache="${XDG_CONFIG_HOME:-$HOME/.config}/storm-games/audiogame-manager/cache" +cache="${XDG_CACHE_HOME:-$HOME/.cache}/audiogame-manager" updateURL="https://www.kaldobsky.com/audiogames" updateFiles=("Swamp.zip")