Let a kind be a list, and carry the asset's catalog path
Both changes are what the third adapter asked for, the way the second one asked for resolve_for_host. `pick_release` now takes several kinds in order of preference. A desktop store on Apple Silicon wants `mac_universal`, will settle for `mac_arm64`, and takes `mac_x64` only as a last resort because that one runs under Rosetta. Release order still wins over kind order: the newest release with any acceptable asset beats an older release with a better one. Records also carry `asset_path`, the catalog-side path, because not every asset is a download — an `html` build is a hosted directory, and the desktop store needs its URL rather than a file name. The machine-wide uninstaller learned the third engine. It also had to stop assuming one store per directory name: the RetroArch and desktop engines share a store root, so a home is now identified by which engine file is in it, and the launcher name is derived from the home rather than guessed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
+23
-7
@@ -10,6 +10,9 @@
|
||||
# it finds every store home under the known roots, has each store's own engine
|
||||
# purge what it installed, and then deletes the store.
|
||||
#
|
||||
# Three engines exist today — Batocera, RetroArch and desktop — and the last two
|
||||
# share a store root, so a home is identified by which engine file is in it.
|
||||
#
|
||||
# DRY_RUN=1 print what would go, remove nothing
|
||||
# KEEP_GAMES=1 leave the installed games alone, remove only the scripts
|
||||
# FORCE=1 purge even while RetroArch is running
|
||||
@@ -86,18 +89,31 @@ if [ -d "$BATOCERA_STORE_ROOT" ]; then
|
||||
[ "$DRY_RUN" = "1" ] || rmdir "$BATOCERA_STORE_ROOT" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# --- RetroArch stores ------------------------------------------------------
|
||||
# --- RetroArch and desktop stores -----------------------------------------
|
||||
# Both live under the same root, one directory per store id, told apart by the
|
||||
# engine file inside. A store id can even carry both.
|
||||
if [ -d "$STORE_ROOT" ]; then
|
||||
extra=""
|
||||
[ "$FORCE" = "1" ] && extra="--force"
|
||||
for home in "$STORE_ROOT"/*/; do
|
||||
[ -f "$home/config.json" ] || continue
|
||||
id="$(basename "$home")"
|
||||
FOUND=$((FOUND + 1))
|
||||
say "retroarch store '$id' in $home"
|
||||
purge_store "${home%/}" retroarch_store.py RETROARCH_STORE_HOME "$extra"
|
||||
run rm -f "$BIN_DIR/$id-retroarch-store"
|
||||
run rm -rf "${home%/}"
|
||||
name="$(basename "$home")"
|
||||
home="${home%/}"
|
||||
if [ -f "$home/retroarch_store.py" ]; then
|
||||
id="${name%-retroarch}"
|
||||
FOUND=$((FOUND + 1))
|
||||
say "retroarch store '$id' in $home"
|
||||
purge_store "$home" retroarch_store.py RETROARCH_STORE_HOME "$extra"
|
||||
run rm -f "$BIN_DIR/$id-retroarch-store"
|
||||
fi
|
||||
if [ -f "$home/desktop_store.py" ]; then
|
||||
id="${name%-desktop}"
|
||||
FOUND=$((FOUND + 1))
|
||||
say "desktop store '$id' in $home"
|
||||
purge_store "$home" desktop_store.py DESKTOP_STORE_HOME ""
|
||||
run rm -f "$BIN_DIR/$id-desktop-store"
|
||||
fi
|
||||
run rm -rf "$home"
|
||||
done
|
||||
[ "$DRY_RUN" = "1" ] || rmdir "$STORE_ROOT" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user