diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rwxr-xr-x | pbuilder-buildpackage | 4 | ||||
-rw-r--r-- | pbuilder-buildpackage-funcs | 5 |
3 files changed, 11 insertions, 5 deletions
@@ -1,3 +1,10 @@ +2002-10-29 Junichi Uekawa <dancer@debian.org> + + * pbuilder-buildpackage: Changed to work with trap instead of other + kludgy alternatives. + + * pbuilder-buildpackage-funcs: fixed to use trap for buildpackage hooks. + 2002-10-27 Junichi Uekawa <dancer@debian.org> * pbuilder-checkparams (BASEBUILDPLACE): check for user-mode-linux operation, diff --git a/pbuilder-buildpackage b/pbuilder-buildpackage index 877c71b..bb998f0 100755 --- a/pbuilder-buildpackage +++ b/pbuilder-buildpackage @@ -47,6 +47,7 @@ fi showbuildbanner '$Id' echobacktime extractbuildplace +trap umountproc_cleanbuildplace exit loadhooks createbuilduser @@ -57,14 +58,15 @@ executehooks "D" echo Extracting source if ! $CHROOTEXEC /bin/bash -c "( cd tmp/buildd; chown $BUILDUSERNAME:$BUILDUSERNAME ../buildd *; $SUTOUSER /usr/bin/dpkg-source -x $(basename $PACKAGENAME) )"; then echo "pbuilder: Failed extracting the source" >&2 - umountproc_cleanbuildplace exit 1; fi recover_aptcache echo "Installing the build-deps" +trap saveaptcache_umountproc_cleanbuildplace exit checkbuilddep save_aptcache +trap umountproc_cleanbuildplace exit echo " -> Building the package" export PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin" diff --git a/pbuilder-buildpackage-funcs b/pbuilder-buildpackage-funcs index 76dd913..ee9f973 100644 --- a/pbuilder-buildpackage-funcs +++ b/pbuilder-buildpackage-funcs @@ -26,16 +26,13 @@ function copydsc () { $(cat "$DSCFILE" | \ awk 'BEGIN{p=0} /^$/ {p=0} /^.*:/ {p=0} {if (p){print "'$(dirname "$DSCFILE")'/" $3}} /^Files:/{p=1}' ) ; do echo " -> copying [$FILE]" - if ! cp "$FILE" "$TARGET" ; then - umountproc_cleanbuildplace - fi + cp "$FILE" "$TARGET" done } function checkbuilddep () { if ! /usr/lib/pbuilder/pbuilder-satisfydepends --control "$BUILDPLACE/"tmp/buildd/*/debian/control --chroot "$BUILDPLACE" --binary-all ; then echo "E: pbuilder-satisfydepends failed." >&2 - saveaptcache_umountproc_cleanbuildplace exit 1 fi # install extra packages to the chroot |