summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLevente Polyak <anthraxx@archlinux.org>2023-01-12 21:33:00 +0100
committerLevente Polyak <anthraxx@archlinux.org>2023-01-17 00:47:20 +0100
commitd45e77738bda2d17b10f87d05167a12fa5be8d63 (patch)
tree4f34b1427b3681829899b557e547d043c0623ab7
parent009c58f7c94b5f63aa41a0a82cd23ee7712f05a9 (diff)
downloaddevtools-d45e77738bda2d17b10f87d05167a12fa5be8d63.tar.xz
commitpkg: properly cleanup commit msg file on abort
Use the workdir location which gets cleaned up automatically. Previously this was leaking tmpfiles if the commitpkg command got aborted after file creation. Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
-rw-r--r--src/commitpkg.in3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/commitpkg.in b/src/commitpkg.in
index 235d12b..2f0ea1f 100644
--- a/src/commitpkg.in
+++ b/src/commitpkg.in
@@ -132,7 +132,8 @@ if [[ -n $(svn status -q) ]]; then
svn commit -q -m "${msgtemplate}: ${1}" || die
stat_done
else
- msgfile="$(mktemp)"
+ [[ -z ${WORKDIR:-} ]] && setup_workdir
+ msgfile=$(mktemp --tmpdir="${WORKDIR}" commitpkg.XXXXXXXXXX)
echo "$msgtemplate" > "$msgfile"
if [[ -n $SVN_EDITOR ]]; then
$SVN_EDITOR "$msgfile"