Skip to content

fix(install): clean exit from install.sh (cleanup trap under set -u) - #31

Merged
kldzj merged 1 commit into
mainfrom
fix/install-cleanup-trap
Jun 30, 2026
Merged

fix(install): clean exit from install.sh (cleanup trap under set -u)#31
kldzj merged 1 commit into
mainfrom
fix/install-cleanup-trap

Conversation

@kldzj

@kldzj kldzj commented Jun 30, 2026

Copy link
Copy Markdown
Owner

Fix install.sh clean exit (cleanup trap under set -u)

The v3.0.0 release published fine, but the test-install smoke tests went red.
Cause: install.sh's EXIT trap (rm -rf "$tmp") runs in global scope, while
tmp was declared local to main(). Under set -u, a successful install
then ended with tmp: unbound variable and exit 1 (binary installed correctly,
but the script reported failure and left the temp dir).

Fix

  • Make tmp a global so the trap can see it.
  • Guard the trap with ${tmp:-}.

Verified

End-to-end in a debian:12 container against the published v3.0.0 release:
download, checksum, install, cleanup, and pzmod --version / pzmod help all
exit 0. This also turns the release workflow's test-install jobs green for
future releases.

Note: only the install script (served from main) was affected; the v3.0.0
binaries and the container image are correct and need no re-release.

The EXIT trap (rm -rf "$tmp") runs in global scope, but tmp was declared local
to main(), so under `set -u` a successful install ended with "tmp: unbound
variable" and exit 1. The binary installed fine, but the script reported failure
and left the temp dir behind. Make tmp a global and guard the trap with
${tmp:-}.

Verified end-to-end against the v3.0.0 release in a debian:12 container:
download, checksum, install, cleanup, and `pzmod --version` all exit 0. This
also fixes the release workflow's test-install jobs.
@kldzj
kldzj merged commit c3b769c into main Jun 30, 2026
1 check passed
@kldzj
kldzj deleted the fix/install-cleanup-trap branch June 30, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant