Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-05-18 09:01:16 +0200
committerErich Eckner <git@eckner.net>2017-05-18 09:03:58 +0200
commit6c3b31bea4eb1915ea738ec968352b1e52e53289 (patch)
treeb26ccbfb393d06aa1e096faf67bbf7949deba905 /bin
parent39d159d60374a46ff3f4394f24288379db32b9a6 (diff)
bin/return-assignment: bugfix multiple traps
Diffstat (limited to 'bin')
-rwxr-xr-xbin/return-assignment9
1 files changed, 5 insertions, 4 deletions
diff --git a/bin/return-assignment b/bin/return-assignment
index ab8b151..def362c 100755
--- a/bin/return-assignment
+++ b/bin/return-assignment
@@ -29,11 +29,11 @@ fi
exit 1
fi
-function clean_up {
+function clean_up_lock_file {
rm -f "${build_list_lock_file}"
}
-trap clean_up EXIT
+trap clean_up_lock_file EXIT
if [ "$5" == 'ERROR' ]; then
# the build failed on the build slave
@@ -70,14 +70,15 @@ if ! grep -q "^${1//./\\.} $2 $3 $4\$" "${work_dir}/build-list"; then
exit 2
fi
-function clean_up {
+function clean_up_tmp_dir {
popd > /dev/null
rm -rf --one-file-system "${tmp_dir}"
+ clean_up_lock_file
}
tmp_dir="$(mktemp -d)"
pushd "${tmp_dir}" > /dev/null
-trap clean_up EXIT
+trap clean_up_tmp_dir EXIT
# extract package(s)
tar -x