123set -euo pipefail45tmp_root="$(mktemp -d "${TMPDIR:-/tmp}/sigil-home-path.XXXXXX")"6cleanup() {7 local status=$?8 trap - EXIT INT TERM HUP9 case "$tmp_root" in10 */sigil-home-path.??????) rm -rf -- "$tmp_root" ;;11 esac12 exit "$status"13}14trap cleanup EXIT INT TERM HUP1516release_id=0123456789abcdef17canonical_releases="$tmp_root/var/home/tank/.local/libexec/sigil-spark/releases"18install -d -m 0700 "$canonical_releases/$release_id"19ln -s var/home "$tmp_root/home"20install_root="$tmp_root/home/tank/.local/libexec/sigil-spark"21ln -s "releases/$release_id" "$install_root/current"2223resolved_current="$(readlink -f "$install_root/current")"24spelled_releases="$install_root/releases"25[[ "$(dirname -- "$resolved_current")" != "$spelled_releases" ]]26[[ "$(dirname -- "$resolved_current")" == "$(readlink -f "$spelled_releases")" ]]2728repo_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd -P)"29for script in \30 install-bazzite-package.sh \31 rollback-bazzite-release.sh \32 stage-bazzite-release.sh33do34 # Intentional literal: the production scripts must canonicalize this exact35 # runtime variable rather than the test shell expanding it here.36 # shellcheck disable=SC201637 grep -Fq '$(readlink -f "$releases_root")' "$repo_dir/scripts/$script"38done3940printf 'bazzite_canonical_home_tests=ok\n'