Fix setup on stock macOS bash, shader step false success, battery gate misreport (#4, #5, #7)

- Brace every $NAME that is directly followed by a non-ASCII character in the shell scripts: bash 3.2 in a UTF-8 locale read the first byte of the following character as part of the variable name and aborted under set -u (#4, #6).
- setup.sh and d2rm_pack.py: the shader translation step is complete only when every entry in the completion marker is ok and every library file exists; the script's exit status is no longer hidden by a pipe (#5).
- devbattery.sh / devlock.sh: a missing local timeout or ideviceinfo is reported as such and stops at once, instead of being reported as an offline device and polled for up to an hour (#7).
- smoke_mac.sh builds its package for iPhone only regardless of the project default.

Reported by @SakuraToErii. The setup.sh part of #4 was also submitted by @hubeiqiao in #6.

Co-authored-by: hubeiqiao <12777592+hubeiqiao@users.noreply.github.com>
This commit is contained in:
jhaizhou
2026-10-13 03:17:23 +08:00
co-authored by hubeiqiao
parent 824d2d3f0b
commit 66c3a2fb70
28 changed files with 121 additions and 68 deletions
+2 -2
View File
@@ -19,7 +19,7 @@ PKG=$1; KEYS=$2; DM_ROOT=${DM_ROOT:-$HOME/dm-work}; OUT=$DM_ROOT/data/switch/3.3
die() { echo "✗ $*" >&2; exit 1; }
HT=${HACTOOL:-$(command -v hactool || true)}; [ -n "$HT" ] && [ -x "$HT" ] || die "没找到 hactool:装好后放进 PATH,或设 HACTOOL=<路径>(见本文件开头)"
[ -f "$PKG" ] || die "没有这个游戏包:$PKG"; [ -f "$KEYS" ] || die "没有这个密钥文件:$KEYS"
[ ! -e "$OUT" ] || die "已有 $OUT,不覆盖。要重做先自己把它移走"
[ ! -e "$OUT" ] || die "已有 ${OUT},不覆盖。要重做先自己把它移走"
ht() { "$HT" -k "$KEYS" --disablekeywarns --suppresskeys "$@"; }
T=$DM_ROOT/build/cache/dm/extract.$$; mkdir -p "$T/nca" || die "建不了中间目录 $T"; trap 'rm -rf "$T"' EXIT
say() { echo "[$(date +%T)] $*"; }
@@ -64,4 +64,4 @@ SUMS
[ -f "$OUT.part/RomFS/data/build_manifest.psv" ] || { echo " ✗ 资源里没有 data/build_manifest.psv"; ok=0; }
[ "$ok" = 1 ] || { rm -rf "$OUT.part"; die "版本不对:游戏包里的更新不是 3.3.94012"; }
mv "$OUT.part" "$OUT" || die "改名到 $OUT 没成"
say "好了:$OUT。接着在仓库根目录运行 ./setup.sh"
say "好了:${OUT}。接着在仓库根目录运行 ./setup.sh"