From: martin f. krafft Date: Fri, 29 Jan 2010 00:10:55 +0000 (+0100) Subject: refactor cleaning up X-Git-Url: https://git.madduck.net/code/mbuild.git/commitdiff_plain/6f9b0176686f6d54ce1c5993114648b78c7b10d9?hp=c19cdfc8f47e14aaaf46ea289a13f5978217bdd7 refactor cleaning up Signed-off-by: martin f. krafft --- 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"