From 70600059722511dcbcdae59a7f57f1fdff8a1f7c Mon Sep 17 00:00:00 2001 From: Junichi Uekawa Date: Sun, 27 May 2007 13:46:59 +0900 Subject: change "trap" handling so that all trap function calls are called _trap, and they will exit pbuilder after receiving a trap. --- pbuilder-buildpackage | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'pbuilder-buildpackage') diff --git a/pbuilder-buildpackage b/pbuilder-buildpackage index 4121c62..a71ff60 100755 --- a/pbuilder-buildpackage +++ b/pbuilder-buildpackage @@ -52,7 +52,7 @@ export HOME="/tmp/buildd" echobacktime extractbuildplace -trap umountproc_cleanbuildplace exit sighup +trap umountproc_cleanbuildplace_trap exit sighup loadhooks if [ ! -d "${BUILDRESULT}" ]; then @@ -89,10 +89,10 @@ recover_aptcache createbuilduser echo "Installing the build-deps" executehooks "D" -trap saveaptcache_umountproc_cleanbuildplace exit sighup +trap saveaptcache_umountproc_cleanbuildplace_trap exit sighup checkbuilddep "$PACKAGENAME" save_aptcache -trap umountproc_cleanbuildplace exit sighup +trap umountproc_cleanbuildplace_trap exit sighup echo "Copying source file" copydsc "$PACKAGENAME" "$BUILDPLACE/tmp/buildd" @@ -139,7 +139,7 @@ else fi if ! wait ${BUILD_PID}; then - trap umountproc_cleanbuildplace exit sighup + trap umountproc_cleanbuildplace_trap exit sighup eval "${KILL_WAIT_PID}" echo "pbuilder: Failed autobuilding of package" >&2 executehooks "C" @@ -149,10 +149,10 @@ else # build was successful fi -trap umountproc_cleanbuildplace exit sighup +trap umountproc_cleanbuildplace_trap exit sighup executehooks "B" save_aptcache -trap cleanbuildplace exit sighup +trap cleanbuildplace_trap exit sighup umountproc @@ -164,4 +164,7 @@ else echo "E: BUILDRESULT=[$BUILDRESULT] is not a directory." >&2 fi +cleanbuildplace +trap exit sighup echobacktime +exit 0 -- cgit v1.2.3