Use trap-based Tcl metadata tmpdir cleanup in appimage workflows

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
This commit is contained in:
Darryl L. Miles 2026-07-20 16:46:47 +01:00 committed by R. Timothy Edwards
parent a365d5a5c1
commit a5aa32883c
5 changed files with 17 additions and 9 deletions

View File

@ -154,14 +154,16 @@ jobs:
if [ "$source_method" = "github" ]; then
tcl_tmpdir=$(mktemp -d)
cleanup_tcl_tmpdir() { rm -rf "$tcl_tmpdir"; }
trap cleanup_tcl_tmpdir EXIT
if ! git -c advice.detachedHead=false clone --depth 1 --single-branch --branch "$tcl_ref" https://github.com/tcltk/tcl.git "$tcl_tmpdir"; then
rm -rf "$tcl_tmpdir"
echo "Failed to clone Tcl ref $tcl_ref" >&2
exit 1
fi
tcl_commit=$(git -C "$tcl_tmpdir" rev-parse HEAD)
tcl_commit_date=$(git -C "$tcl_tmpdir" log -1 --format=%ci)
rm -rf "$tcl_tmpdir"
trap - EXIT
cleanup_tcl_tmpdir
else
tcl_commit=""
tcl_commit_date=""

View File

@ -154,14 +154,16 @@ jobs:
if [ "$source_method" = "github" ]; then
tcl_tmpdir=$(mktemp -d)
cleanup_tcl_tmpdir() { rm -rf "$tcl_tmpdir"; }
trap cleanup_tcl_tmpdir EXIT
if ! git -c advice.detachedHead=false clone --depth 1 --single-branch --branch "$tcl_ref" https://github.com/tcltk/tcl.git "$tcl_tmpdir"; then
rm -rf "$tcl_tmpdir"
echo "Failed to clone Tcl ref $tcl_ref" >&2
exit 1
fi
tcl_commit=$(git -C "$tcl_tmpdir" rev-parse HEAD)
tcl_commit_date=$(git -C "$tcl_tmpdir" log -1 --format=%ci)
rm -rf "$tcl_tmpdir"
trap - EXIT
cleanup_tcl_tmpdir
else
tcl_commit=""
tcl_commit_date=""

View File

@ -154,14 +154,16 @@ jobs:
if [ "$source_method" = "github" ]; then
tcl_tmpdir=$(mktemp -d)
cleanup_tcl_tmpdir() { rm -rf "$tcl_tmpdir"; }
trap cleanup_tcl_tmpdir EXIT
if ! git -c advice.detachedHead=false clone --depth 1 --single-branch --branch "$tcl_ref" https://github.com/tcltk/tcl.git "$tcl_tmpdir"; then
rm -rf "$tcl_tmpdir"
echo "Failed to clone Tcl ref $tcl_ref" >&2
exit 1
fi
tcl_commit=$(git -C "$tcl_tmpdir" rev-parse HEAD)
tcl_commit_date=$(git -C "$tcl_tmpdir" log -1 --format=%ci)
rm -rf "$tcl_tmpdir"
trap - EXIT
cleanup_tcl_tmpdir
else
tcl_commit=""
tcl_commit_date=""

View File

@ -154,14 +154,16 @@ jobs:
if [ "$source_method" = "github" ]; then
tcl_tmpdir=$(mktemp -d)
cleanup_tcl_tmpdir() { rm -rf "$tcl_tmpdir"; }
trap cleanup_tcl_tmpdir EXIT
if ! git -c advice.detachedHead=false clone --depth 1 --single-branch --branch "$tcl_ref" https://github.com/tcltk/tcl.git "$tcl_tmpdir"; then
rm -rf "$tcl_tmpdir"
echo "Failed to clone Tcl ref $tcl_ref" >&2
exit 1
fi
tcl_commit=$(git -C "$tcl_tmpdir" rev-parse HEAD)
tcl_commit_date=$(git -C "$tcl_tmpdir" log -1 --format=%ci)
rm -rf "$tcl_tmpdir"
trap - EXIT
cleanup_tcl_tmpdir
else
tcl_commit=""
tcl_commit_date=""

View File

@ -22,7 +22,7 @@ ARG TCL_TARBALL_SHA256=
ARG TK_TARBALL_SHA256=
# Build Dependencies (and dump version to logging)
# git is required to support TCL_SOURCE=github overrides from workflow_dispatch.
# git is installed unconditionally so workflow_dispatch can switch TCL_SOURCE to github when needed.
RUN yum install -y cairo-devel freeglut-devel gcc make git tcsh \
&& echo "### rpm -qa:" \
&& rpm -qa | sort \