From 869790bab941d76bbdb2ccd704c5998649e2ebe8 Mon Sep 17 00:00:00 2001 From: MechaCat02 Date: Sat, 11 Jul 2026 17:04:28 +0200 Subject: [PATCH] fix(tools): self-locate DB / cwd instead of the stale renamed path zq.py and sylph-run.sh hard-coded '/home/fabi/RE - Project Sylpheed/...' (the dashed dir was renamed 'RE Project Sylpheed'), so both were broken. Resolve relative to the script directory now; zq.py honours $SYLPHEED_DB. Co-Authored-By: Claude Opus 4.8 (1M context) --- sylph-run.sh | 4 +++- zq.py | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sylph-run.sh b/sylph-run.sh index e060567..f56eeb2 100755 --- a/sylph-run.sh +++ b/sylph-run.sh @@ -19,7 +19,9 @@ # resumes (tid25 start_entry 0x82506588 / tid26 0x825065b8). Full per-run log kept under # /tmp/sylph-run/. set -u -cd "/home/fabi/RE - Project Sylpheed/xenia-rs" || exit 2 +# cd to this script's own dir (was a hard-coded '/home/fabi/RE - Project Sylpheed/ +# xenia-rs' that went stale when the tree was renamed 'RE Project Sylpheed'). +cd "$(dirname "$(readlink -f "$0")")" || exit 2 RUNS="${1:-6}"; N="${2:-3000000000}"; TO="${3:-180}"; XGREP="${4:-}" OUT=/tmp/sylph-run; mkdir -p "$OUT" BIN=./target/release/xenia-rs diff --git a/zq.py b/zq.py index e334368..3374172 100755 --- a/zq.py +++ b/zq.py @@ -14,9 +14,13 @@ Usage: zq.py grep # instructions whose operands LIKE %substr% zq.py find # instructions whose raw word == value (e.g. a ptr) """ -import duckdb, sys +import duckdb, sys, os -DB = '/home/fabi/RE - Project Sylpheed/xenia-rs/sylpheed.db' +# Resolve the DB next to this script so the tool survives the tree being renamed +# (the old hard-coded '/home/fabi/RE - Project Sylpheed/...' path went stale when +# the dir became 'RE Project Sylpheed'). Override with $SYLPHEED_DB. +DB = os.environ.get('SYLPHEED_DB', + os.path.join(os.path.dirname(os.path.abspath(__file__)), 'sylpheed.db')) c = duckdb.connect(DB, read_only=True) H = lambda x: '0x%08x' % x