From e9216547244c20f771ac81fcf74257e2df8371ef Mon Sep 17 00:00:00 2001 From: Junichi Uekawa Date: Sun, 27 May 2007 02:54:59 +0900 Subject: trap SIGHUP as well as EXIT. --- ChangeLog | 8 ++++++++ debian/changelog | 3 ++- pbuilder | 18 +++++++++--------- pbuilder-buildpackage | 12 ++++++------ pbuilder-buildpackage-funcs | 2 +- pbuilder-createbuildenv | 2 +- pbuilder-updatebuildenv | 2 +- pbuilder-user-mode-linux | 2 +- 8 files changed, 29 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index e1a5853..f211f4c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-05-27 Junichi Uekawa + + * pbuilder-buildpackage: + * pbuilder-buildpackage-funcs: + * pbuilder-createbuildenv: + * pbuilder-updatebuildenv: + * pbuilder-user-mode-linux: trap sighup as well as exit. + 2007-05-17 Junichi Uekawa * Documentation/pbuilder-doc.xml: Make some references to 'base diff --git a/debian/changelog b/debian/changelog index 6196310..ed55aeb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,13 +8,14 @@ pbuilder (0.167) UNRELEASED; urgency=low * shut up lintian about binnmuability. Use {source:Version} instead of Source-Version, according to http://wiki.debian.org/binNMU * Use 'tee' to show output even in logged mode. + * trap SIGHUP as well as exit. [ Loic Minier ] * Tune aptitude opts in pbuilder-satisfydepends-aptitude to handle complex dependencies in experimental, to support unsigned APT repositories, and to not install Recommends. - -- Junichi Uekawa Thu, 17 May 2007 20:39:04 +0900 + -- Junichi Uekawa Sun, 27 May 2007 02:51:32 +0900 pbuilder (0.166) unstable; urgency=low diff --git a/pbuilder b/pbuilder index 67f683b..a0a49fe 100755 --- a/pbuilder +++ b/pbuilder @@ -55,10 +55,10 @@ case "$1" in . /usr/lib/pbuilder/pbuilder-checkparams . /usr/lib/pbuilder/pbuilder-runhooks extractbuildplace - trap umountproc_cleanbuildplace exit + trap umountproc_cleanbuildplace exit sighup loadhooks recover_aptcache - trap saveaptcache_umountproc_cleanbuildplace exit + trap saveaptcache_umountproc_cleanbuildplace exit sighup if [ "${INTERNAL_BUILD_UML}" = "yes" ]; then echo " -> entering the shell" @@ -72,7 +72,7 @@ File extracted to: $BUILDPLACE save_aptcache - trap umountproc_cleanbuildplace exit + trap umountproc_cleanbuildplace exit sighup # saving the place afterwards if [ "${SAVE_AFTER_LOGIN}" = "yes" ]; then @@ -82,7 +82,7 @@ File extracted to: $BUILDPLACE echo " -> Saving the results, modifications to this session will persist" unloadhooks umountproc - trap cleanbuildplace exit + trap cleanbuildplace exit sighup ${CHROOTEXEC} /usr/bin/apt-get clean || true create_basetgz fi @@ -101,11 +101,11 @@ File extracted to: $BUILDPLACE fi; extractbuildplace - trap umountproc_cleanbuildplace exit + trap umountproc_cleanbuildplace exit sighup loadhooks recover_aptcache - trap saveaptcache_umountproc_cleanbuildplace exit + trap saveaptcache_umountproc_cleanbuildplace exit sighup RUNNAME="$BUILDPLACE/run" cat "$EXECPROGRAM" > "$RUNNAME" @@ -115,7 +115,7 @@ File extracted to: $BUILDPLACE rm -f "$RUNNAME" save_aptcache - trap umountproc_cleanbuildplace exit + trap umountproc_cleanbuildplace exit sighup # saving the place afterwards if [ "${SAVE_AFTER_LOGIN}" = "yes" ]; then @@ -125,7 +125,7 @@ File extracted to: $BUILDPLACE echo " -> Saving the results, modifications to this session will persist" unloadhooks umountproc - trap cleanbuildplace exit + trap cleanbuildplace exit sighup ${CHROOTEXEC} /usr/bin/apt-get clean || true create_basetgz fi @@ -136,7 +136,7 @@ File extracted to: $BUILDPLACE . /usr/lib/pbuilder/pbuilder-checkparams . /usr/lib/pbuilder/pbuilder-runhooks extractbuildplace - trap umountproc_cleanbuildplace exit + trap umountproc_cleanbuildplace exit sighup loadhooks executehooks "F" echo " -> start dump config" diff --git a/pbuilder-buildpackage b/pbuilder-buildpackage index 0c9b8f1..4121c62 100755 --- a/pbuilder-buildpackage +++ b/pbuilder-buildpackage @@ -52,7 +52,7 @@ export HOME="/tmp/buildd" echobacktime extractbuildplace -trap umountproc_cleanbuildplace exit +trap umountproc_cleanbuildplace 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 +trap saveaptcache_umountproc_cleanbuildplace exit sighup checkbuilddep "$PACKAGENAME" save_aptcache -trap umountproc_cleanbuildplace exit +trap umountproc_cleanbuildplace 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 + trap umountproc_cleanbuildplace 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 +trap umountproc_cleanbuildplace exit sighup executehooks "B" save_aptcache -trap cleanbuildplace exit +trap cleanbuildplace exit sighup umountproc diff --git a/pbuilder-buildpackage-funcs b/pbuilder-buildpackage-funcs index 0619802..9104d27 100644 --- a/pbuilder-buildpackage-funcs +++ b/pbuilder-buildpackage-funcs @@ -43,7 +43,7 @@ function checkbuilddep () { # If asked to preserve the build place, and pbuilder-satisfydepends # didn't taint it, then don't clean it when exiting. if [ $? -eq 2 -a "${PRESERVE_BUILDPLACE}" = "yes" ]; then - trap umountproc exit + trap umountproc exit sighup fi echo "E: pbuilder-satisfydepends failed." >&2 exit 2 diff --git a/pbuilder-createbuildenv b/pbuilder-createbuildenv index d91d5c0..e2cb2d6 100755 --- a/pbuilder-createbuildenv +++ b/pbuilder-createbuildenv @@ -103,5 +103,5 @@ if [ ! "${INTERNAL_BUILD_UML}" = "yes" ]; then create_basetgz fi if [ "${PRESERVE_BUILDPLACE}" = "yes" ]; then - trap exit + trap exit sighup fi diff --git a/pbuilder-updatebuildenv b/pbuilder-updatebuildenv index a74b25f..f079ce2 100755 --- a/pbuilder-updatebuildenv +++ b/pbuilder-updatebuildenv @@ -74,5 +74,5 @@ if [ ! "${INTERNAL_BUILD_UML}" = "yes" ]; then create_basetgz fi if [ "${PRESERVE_BUILDPLACE}" = "yes" ]; then - trap exit + trap exit sighup fi diff --git a/pbuilder-user-mode-linux b/pbuilder-user-mode-linux index 53bbea1..ca1a1a4 100755 --- a/pbuilder-user-mode-linux +++ b/pbuilder-user-mode-linux @@ -51,7 +51,7 @@ function operate_uml () { # opeartes on UML, and runs pbuilder $1 # use this script file to bootstrap the pbuilder inside the UML INSIDE_PBUILDER=$(tempfile) - trap cleanup_function exit + trap cleanup_function exit sighup UML_CHROOT_MOUNTPOINT=/var/cache/pbuilder/pbuilder-mnt UML_CHROOT_BUILDRESULTMOUNTDIR=/var/cache/pbuilder/pbuilder-umlresult #The following script is ran inside UML as soon as it is started. -- cgit v1.2.3