From 6f9b0176686f6d54ce1c5993114648b78c7b10d9 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Fri, 29 Jan 2010 01:10:55 +0100 Subject: [PATCH] refactor cleaning up Signed-off-by: martin f. krafft --- sbuild-wrapper.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sbuild-wrapper.sh b/sbuild-wrapper.sh index ccb1973..4f6224d 100755 --- a/sbuild-wrapper.sh +++ b/sbuild-wrapper.sh @@ -10,7 +10,11 @@ set -eu ME="${0##*/}" BUILDDIR="$(mktemp -dt $ME.XXXXXXXX)" -trap "cd /tmp && rm -r '$BUILDDIR'" 0 +cleanup() { + cd /tmp && rm -r "$BUILDDIR" + trap - 1 2 3 4 5 6 7 8 10 11 12 13 14 15 +} +trap cleanup 1 2 3 4 5 6 7 8 10 11 12 13 14 15 BUNDLE_DIR="${TMPDIR:-/tmp}" TARGET_DIR="$PWD" @@ -171,8 +175,7 @@ bundle="${BUNDLE_DIR}/${BUILD_PREFIX}".bundle.tar tar -chf "$bundle" * chmod 644 "$bundle" -rm -r "$BUILDDIR" -trap - 0 +cleanup print_bundle_location "$bundle" -- 2.39.5