From 85f45baabf610e0f56233751ee8f5c2dde3397c0 Mon Sep 17 00:00:00 2001 From: Zsolt Tasnadi Date: Tue, 18 Aug 2026 08:32:46 +0200 Subject: [PATCH] Add an uninstall wrapper, and move to the stores org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit uninstall.sh mirrors install.sh: it names the store and lets the engine do the work. It passes STORE_ID rather than a config URL — taking a store away does not need a download, and the id is what names its home. Both wrappers are POSIX sh now, and neither pipes curl into a shell any more: a failed download would feed an empty script to sh and look like success, so the installer is fetched to a file and run from there. The repository moved from the tools org to stores. The old raw URLs still redirect, so a box installed yesterday keeps updating. Co-Authored-By: Claude Opus 5 (1M context) --- README.md | 39 ++++++++++++++++++++++++++------------- install.sh | 28 +++++++++++++++++----------- uninstall.sh | 17 +++++++++++++++++ 3 files changed, 60 insertions(+), 24 deletions(-) create mode 100755 uninstall.sh diff --git a/README.md b/README.md index 91564e1..dcc1de6 100644 --- a/README.md +++ b/README.md @@ -4,22 +4,22 @@ Puts the catalog into a Batocera box's ROM folders, with EmulationStation metadata and box art. Triggered from the **Ports** menu on the device, or from the CLI over SSH. -This repository is only the store definition — `config.json` plus a wrapper -installer. All the logic lives in the shared engine, -[`warp-engine-batocera-store`](https://git.teletypegames.org/tools/warp-engine-batocera-store), +This repository is only the store definition — `config.json` plus the two wrapper +scripts. All the logic lives in the shared engine, +[`warp-engine-batocera-store`](https://git.teletypegames.org/stores/warp-engine-batocera-store), which works with any WarpEngine-based site; this is just the Teletype Games configuration of it. For RetroArch rather than a Batocera box — desktop, Android, Steam Deck — the same catalog is served by -[`ttg-retroarch-store`](https://git.teletypegames.org/tools/ttg-retroarch-store). +[`ttg-retroarch-store`](https://git.teletypegames.org/stores/ttg-retroarch-store). ## Install Straight onto the device: ```sh -curl -fsSL https://git.teletypegames.org/tools/ttg-batocera-store/raw/branch/master/install.sh | bash +curl -fsSL https://git.teletypegames.org/stores/ttg-batocera-store/raw/branch/master/install.sh | sh ``` Or from a checkout of this repo: @@ -55,6 +55,27 @@ $S config # effective configuration Global flags go before the subcommand: `$S --roms-root /tmp/roms sync`. +## Uninstall + +```sh +curl -fsSL https://git.teletypegames.org/stores/ttg-batocera-store/raw/branch/master/uninstall.sh | sh +``` + +Or `/tmp/ttg-batocera-store/uninstall.sh` from a checkout on the box. It takes +out the games — including any unpacked Ports payload — our gamelist entries, the +*Teletype Games* Ports entry, the launcher and the store home, and restarts +EmulationStation. + +```sh +DRY_RUN=1 ./uninstall.sh # show what would go, remove nothing +KEEP_HOME=1 ./uninstall.sh # keep state.json and the log, for a reinstall +``` + +Nothing of yours goes with it: your own ROMs keep their folders, and your +gamelists are rewritten without our nodes rather than deleted — play counts and +favourites survive. The `gamelist.xml.ttg-backup` copies are listed and left +alone. + ## What this store installs | Catalog platform | Asset kind | Batocera system | Extension | @@ -131,11 +152,3 @@ becomes the default. /userdata/roms/c64/gamelist.xml our entries merged in /userdata/roms/ports/Teletype Games Store.sh ``` - -## Upgrading from the pre-split `batocera-store` - -The old repo installed everything into `/userdata/system/ttg-store`. Re-running -the install command above migrates it: `state.json` is carried over, the old -directory is renamed to `ttg-store.pre-split`, and the Ports entry is replaced -in place. The ROMs themselves never move, so nothing is re-downloaded. Delete -`/userdata/system/ttg-store.pre-split` once the new install looks right. diff --git a/install.sh b/install.sh index 834eb5e..a552c27 100755 --- a/install.sh +++ b/install.sh @@ -1,32 +1,33 @@ -#!/bin/bash +#!/bin/sh # Install the Teletype Games store on a Batocera box. # -# curl -fsSL https://git.teletypegames.org/tools/ttg-batocera-store/raw/branch/master/install.sh | bash +# curl -fsSL https://git.teletypegames.org/stores/ttg-batocera-store/raw/branch/master/install.sh | sh # # All the work is done by the shared engine; this script only says which store -# to install. See https://git.teletypegames.org/tools/warp-engine-batocera-store +# to install. See https://git.teletypegames.org/stores/warp-engine-batocera-store # -set -euo pipefail +set -eu -FORGE="${FORGE:-https://git.teletypegames.org}" -ENGINE_RAW_BASE="${ENGINE_RAW_BASE:-$FORGE/tools/warp-engine-batocera-store/raw/branch/master}" -# Only set when run as a file; piped from curl "$0" is `bash` and everything +FORGE="${FORGE:-https://git.teletypegames.org/stores}" +ENGINE_RAW_BASE="${ENGINE_RAW_BASE:-$FORGE/warp-engine-batocera-store/raw/branch/master}" +# Only set when run as a file; piped from curl "$0" is `sh` and everything # has to come from the forge — never from whatever the cwd happens to hold. SRC_DIR="" if [ -f "$0" ]; then - SRC_DIR="$(cd "$(dirname "$(readlink -f "$0")")" && pwd)" + SRC_DIR="$(cd "$(dirname "$(readlink -f "$0" 2>/dev/null || echo "$0")")" && pwd)" fi # Prefer the config next to this script when run from a checkout. if [ -z "${STORE_CONFIG:-}" ] && [ -n "$SRC_DIR" ] && [ -f "$SRC_DIR/config.json" ]; then STORE_CONFIG="$SRC_DIR/config.json" else - STORE_CONFIG="${STORE_CONFIG:-$FORGE/tools/ttg-batocera-store/raw/branch/master/config.json}" + STORE_CONFIG="${STORE_CONFIG:-$FORGE/ttg-batocera-store/raw/branch/master/config.json}" fi export STORE_CONFIG ENGINE_RAW_BASE # Keep the Ports entry the box already has, so an upgrade replaces it in place. -export BATOCERA_PORT_NAME="${BATOCERA_PORT_NAME:-Teletype Games Store}" +BATOCERA_PORT_NAME="${BATOCERA_PORT_NAME:-Teletype Games Store}" +export BATOCERA_PORT_NAME # --- migrate the pre-split ttg-store layout ------------------------------- # Up to engine 1.x everything lived in /userdata/system/ttg-store. The ROMs @@ -49,4 +50,9 @@ if [ -d "$LEGACY_HOME" ] && [ ! -f "$NEW_HOME/state.json" ]; then echo "[install] old install kept at $LEGACY_HOME.pre-split — delete it once things look right" fi -curl -fsSL "$ENGINE_RAW_BASE/install.sh" | bash +# Fetched to a file rather than piped into a shell: a failed download must fail +# loudly instead of feeding an empty script to sh, which would look like success. +TMP="$(mktemp)" +trap 'rm -f "$TMP"' EXIT +curl -fsSL "$ENGINE_RAW_BASE/install.sh" -o "$TMP" +sh "$TMP" diff --git a/uninstall.sh b/uninstall.sh new file mode 100755 index 0000000..e33f96c --- /dev/null +++ b/uninstall.sh @@ -0,0 +1,17 @@ +#!/bin/sh +# Remove the Teletype Games store from this Batocera box. +# +# curl -fsSL https://git.teletypegames.org/stores/ttg-batocera-store/raw/branch/master/uninstall.sh | sh +# +# All the work is done by the engine's uninstaller; this only says which store. +# DRY_RUN=1 to see what would go, KEEP_HOME=1 to keep the state and the log. +set -eu +FORGE="${FORGE:-https://git.teletypegames.org/stores}" +ENGINE_RAW_BASE="${ENGINE_RAW_BASE:-$FORGE/warp-engine-batocera-store/raw/branch/master}" +STORE_ID="${STORE_ID:-ttg}" +export STORE_ID + +TMP="$(mktemp)" +trap 'rm -f "$TMP"' EXIT +curl -fsSL "$ENGINE_RAW_BASE/uninstall.sh" -o "$TMP" +sh "$TMP"