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:
parent
a365d5a5c1
commit
a5aa32883c
|
|
@ -154,14 +154,16 @@ jobs:
|
||||||
|
|
||||||
if [ "$source_method" = "github" ]; then
|
if [ "$source_method" = "github" ]; then
|
||||||
tcl_tmpdir=$(mktemp -d)
|
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
|
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
|
echo "Failed to clone Tcl ref $tcl_ref" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
tcl_commit=$(git -C "$tcl_tmpdir" rev-parse HEAD)
|
tcl_commit=$(git -C "$tcl_tmpdir" rev-parse HEAD)
|
||||||
tcl_commit_date=$(git -C "$tcl_tmpdir" log -1 --format=%ci)
|
tcl_commit_date=$(git -C "$tcl_tmpdir" log -1 --format=%ci)
|
||||||
rm -rf "$tcl_tmpdir"
|
trap - EXIT
|
||||||
|
cleanup_tcl_tmpdir
|
||||||
else
|
else
|
||||||
tcl_commit=""
|
tcl_commit=""
|
||||||
tcl_commit_date=""
|
tcl_commit_date=""
|
||||||
|
|
|
||||||
|
|
@ -154,14 +154,16 @@ jobs:
|
||||||
|
|
||||||
if [ "$source_method" = "github" ]; then
|
if [ "$source_method" = "github" ]; then
|
||||||
tcl_tmpdir=$(mktemp -d)
|
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
|
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
|
echo "Failed to clone Tcl ref $tcl_ref" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
tcl_commit=$(git -C "$tcl_tmpdir" rev-parse HEAD)
|
tcl_commit=$(git -C "$tcl_tmpdir" rev-parse HEAD)
|
||||||
tcl_commit_date=$(git -C "$tcl_tmpdir" log -1 --format=%ci)
|
tcl_commit_date=$(git -C "$tcl_tmpdir" log -1 --format=%ci)
|
||||||
rm -rf "$tcl_tmpdir"
|
trap - EXIT
|
||||||
|
cleanup_tcl_tmpdir
|
||||||
else
|
else
|
||||||
tcl_commit=""
|
tcl_commit=""
|
||||||
tcl_commit_date=""
|
tcl_commit_date=""
|
||||||
|
|
|
||||||
|
|
@ -154,14 +154,16 @@ jobs:
|
||||||
|
|
||||||
if [ "$source_method" = "github" ]; then
|
if [ "$source_method" = "github" ]; then
|
||||||
tcl_tmpdir=$(mktemp -d)
|
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
|
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
|
echo "Failed to clone Tcl ref $tcl_ref" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
tcl_commit=$(git -C "$tcl_tmpdir" rev-parse HEAD)
|
tcl_commit=$(git -C "$tcl_tmpdir" rev-parse HEAD)
|
||||||
tcl_commit_date=$(git -C "$tcl_tmpdir" log -1 --format=%ci)
|
tcl_commit_date=$(git -C "$tcl_tmpdir" log -1 --format=%ci)
|
||||||
rm -rf "$tcl_tmpdir"
|
trap - EXIT
|
||||||
|
cleanup_tcl_tmpdir
|
||||||
else
|
else
|
||||||
tcl_commit=""
|
tcl_commit=""
|
||||||
tcl_commit_date=""
|
tcl_commit_date=""
|
||||||
|
|
|
||||||
|
|
@ -154,14 +154,16 @@ jobs:
|
||||||
|
|
||||||
if [ "$source_method" = "github" ]; then
|
if [ "$source_method" = "github" ]; then
|
||||||
tcl_tmpdir=$(mktemp -d)
|
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
|
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
|
echo "Failed to clone Tcl ref $tcl_ref" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
tcl_commit=$(git -C "$tcl_tmpdir" rev-parse HEAD)
|
tcl_commit=$(git -C "$tcl_tmpdir" rev-parse HEAD)
|
||||||
tcl_commit_date=$(git -C "$tcl_tmpdir" log -1 --format=%ci)
|
tcl_commit_date=$(git -C "$tcl_tmpdir" log -1 --format=%ci)
|
||||||
rm -rf "$tcl_tmpdir"
|
trap - EXIT
|
||||||
|
cleanup_tcl_tmpdir
|
||||||
else
|
else
|
||||||
tcl_commit=""
|
tcl_commit=""
|
||||||
tcl_commit_date=""
|
tcl_commit_date=""
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ ARG TCL_TARBALL_SHA256=
|
||||||
ARG TK_TARBALL_SHA256=
|
ARG TK_TARBALL_SHA256=
|
||||||
|
|
||||||
# Build Dependencies (and dump version to logging)
|
# 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 \
|
RUN yum install -y cairo-devel freeglut-devel gcc make git tcsh \
|
||||||
&& echo "### rpm -qa:" \
|
&& echo "### rpm -qa:" \
|
||||||
&& rpm -qa | sort \
|
&& rpm -qa | sort \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue