fix(release): refuse to run from a snap-sandboxed HOME
When release.sh is launched from VS Code's integrated terminal, podman sees $HOME=/home/$USER/snap/code/<rev>/ and stores its database there. If snapd auto-updates code mid-session (rev 258 -> 260), the next podman invocation finds a stale static-dir pointer and aborts with: Error: database static dir ".../snap/code/258/.../libpod" does not match our static dir ".../snap/code/260/.../libpod" Detect the pattern ($HOME under /home/*/snap/*) and bail out early with an actionable message: re-run from a regular host terminal.
This commit is contained in:
@@ -59,9 +59,26 @@ else
|
||||
err "Neither podman nor docker is installed."
|
||||
fi
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# -------------------------------------------------------------------
|
||||
# Refuse to run from inside a confined snap sandbox (e.g. the VS Code
|
||||
# integrated terminal). When the script is launched from such a
|
||||
# sandbox, $HOME points under /home/$USER/snap/code/<rev>/ and podman
|
||||
# stores its DB under that path. If a snap revision bump happens mid
|
||||
# session, the next podman invocation finds a stale static-dir pointer
|
||||
# and aborts with a confusing "database static dir ... does not match"
|
||||
# error. Re-run the script from a regular host shell instead.
|
||||
# -------------------------------------------------------------------
|
||||
case "${HOME:-}" in
|
||||
/home/*/snap/*)
|
||||
err "Refusing to run inside a snap-sandboxed HOME (${HOME}). \
|
||||
Re-run from a regular host terminal (e.g. gnome-terminal, konsole) \
|
||||
so podman uses a stable storage path."
|
||||
;;
|
||||
esac
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# Pre-flight checks
|
||||
# ---------------------------------------------------------------------------
|
||||
# -------------------------------------------------------------------
|
||||
echo "============================================"
|
||||
echo " AniWorld — Build & Push"
|
||||
echo " Engine : ${ENGINE}"
|
||||
|
||||
Reference in New Issue
Block a user