aboutsummaryrefslogtreecommitdiff
path: root/pbuilder-updatebuildenv
diff options
context:
space:
mode:
Diffstat (limited to 'pbuilder-updatebuildenv')
-rwxr-xr-xpbuilder-updatebuildenv16
1 files changed, 11 insertions, 5 deletions
diff --git a/pbuilder-updatebuildenv b/pbuilder-updatebuildenv
index d773346..d53510b 100755
--- a/pbuilder-updatebuildenv
+++ b/pbuilder-updatebuildenv
@@ -5,6 +5,12 @@ set -e
. /usr/lib/pbuilder/pbuilder-checkparams
. /usr/lib/pbuilder/pbuilder-runhooks
+function abortprocess () {
+# function to do the aborting process in pbuilder-updatebuildenv
+ umountproc
+ cleanbuildplace
+}
+
CHROOTEXEC="chroot $BUILDPLACE "
test -n "$DISTRIBUTION" && echo "Upgrading for distribution $DISTRIBUTION"
@@ -16,11 +22,11 @@ if [ -n "$HOOKDIR" ]; then
fi
echo "Refreshing the base.tgz "
echo " -> upgrading packages"
-$CHROOTEXEC /usr/bin/apt-get update
-$CHROOTEXEC /usr/bin/dpkg --purge lilo
-$CHROOTEXEC /usr/bin/apt-get -y dist-upgrade
-$CHROOTEXEC /usr/bin/apt-get -y install build-essential dpkg-dev apt $EXTRAPACKAGES
-$CHROOTEXEC /usr/bin/apt-get clean
+$CHROOTEXEC /usr/bin/apt-get update || abortprocess
+$CHROOTEXEC /usr/bin/dpkg --purge lilo || abortprocess
+$CHROOTEXEC /usr/bin/apt-get -y dist-upgrade || abortprocess
+$CHROOTEXEC /usr/bin/apt-get -y install build-essential dpkg-dev apt $EXTRAPACKAGES || abortprocess
+$CHROOTEXEC /usr/bin/apt-get clean || abortprocess
if [ -n "$HOOKDIR" ]; then
executehooks "X"