From 72ff17fff61cd9a9caaf6554fdb7dd53469c3ef4 Mon Sep 17 00:00:00 2001 From: Zsolt Tasnadi Date: Tue, 18 Aug 2026 10:00:09 +0200 Subject: [PATCH] Give the store home its own name per engine MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The desktop engine shares this store root, and both keyed their home by the store id alone — so installing both from the same publisher meant one config.json and one state.json between them, and the second install silently adopted the first one's state. Caught by installing the two side by side. The home is now `-retroarch`. The installer moves an existing `` home on its way past, so an install from yesterday keeps its state and its games; the uninstaller accepts either name. The launcher was already `-retroarch-store`, so nothing the user types changes. Co-Authored-By: Claude Opus 5 (1M context) --- README.md | 8 ++++++-- install.sh | 11 ++++++++++- uninstall.sh | 10 +++++++--- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 39e4f68..6f891f6 100644 --- a/README.md +++ b/README.md @@ -77,10 +77,14 @@ STORE_CONFIG=./my-config.json ./install.sh ``` It reads `store.id` from the config, installs the engine, the shared core and the -config into `~/.local/share/warp-engine-store//`, writes a +config into `~/.local/share/warp-engine-store/-retroarch/`, writes a `-retroarch-store` launcher into `~/.local/bin`, prints the paths it resolved and runs the first sync. +The store home is `-retroarch`, not ``: the desktop store engine shares +this root, and a shared home would mean a shared `config.json` and `state.json`. +An install from before this change is moved on the next run of the installer. + | Environment variable | Meaning | |---|---| | `STORE_CONFIG` | **required** — path or URL of the store's `config.json` | @@ -159,7 +163,7 @@ curl -fsSL https://git.teletypegames.org/engines/warpstore/raw/branch/master/uni ## Where things land ``` -~/.local/share/warp-engine-store/example/ +~/.local/share/warp-engine-store/example-retroarch/ ├── retroarch_store.py, warpstore.py, config.json └── state.json, catalog.json diff --git a/install.sh b/install.sh index ebe67bc..a1a0c93 100755 --- a/install.sh +++ b/install.sh @@ -57,9 +57,18 @@ print(sid, cfg.get("name") or sid) STORE_ID="${STORE_META%% *}" STORE_NAME="${STORE_META#* }" -STORE_HOME="$STORE_ROOT/$STORE_ID" +# One home per engine: the desktop store shares this root, and a shared home +# would mean a shared config.json and state.json. +STORE_HOME="$STORE_ROOT/$STORE_ID-retroarch" LAUNCHER="$BIN_DIR/$STORE_ID-retroarch-store" +# Installs from before the rename kept the home under the bare store id. +LEGACY_HOME="$STORE_ROOT/$STORE_ID" +if [ -d "$LEGACY_HOME" ] && [ -f "$LEGACY_HOME/retroarch_store.py" ] && [ ! -d "$STORE_HOME" ]; then + say "moving $LEGACY_HOME -> $STORE_HOME (one home per engine)" + mv "$LEGACY_HOME" "$STORE_HOME" +fi + mkdir -p "$STORE_HOME" "$BIN_DIR" install_file() { # install_file [local override] diff --git a/uninstall.sh b/uninstall.sh index 45c1e55..2d804ba 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -51,8 +51,10 @@ if [ -z "$STORE_ID" ]; then FOUND="" COUNT=0 for d in "$STORE_ROOT"/*/; do - if [ -f "$d/config.json" ]; then - FOUND="$FOUND $(basename "$d")" + if [ -f "$d/retroarch_store.py" ]; then + # `-retroarch` is the home; the store id is what the user types. + name="$(basename "$d")" + FOUND="$FOUND ${name%-retroarch}" COUNT=$((COUNT + 1)) fi done @@ -63,7 +65,9 @@ if [ -z "$STORE_ID" ]; then esac fi -STORE_HOME="$STORE_ROOT/$STORE_ID" +STORE_HOME="$STORE_ROOT/$STORE_ID-retroarch" +# Installs from before the rename kept the home under the bare store id. +[ -d "$STORE_HOME" ] || [ ! -f "$STORE_ROOT/$STORE_ID/retroarch_store.py" ] || STORE_HOME="$STORE_ROOT/$STORE_ID" LAUNCHER="$BIN_DIR/$STORE_ID-retroarch-store" [ -d "$STORE_HOME" ] || die "no store '$STORE_ID' in $STORE_ROOT"