aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog12
-rw-r--r--debian/changelog5
-rwxr-xr-xpbuilder3
-rwxr-xr-xpbuilder-buildpackage10
-rwxr-xr-xpbuilder-createbuildenv10
-rw-r--r--pbuilder-modules4
-rwxr-xr-xpbuilder-updatebuildenv7
7 files changed, 32 insertions, 19 deletions
diff --git a/ChangeLog b/ChangeLog
index 508f28e..0e8cdd2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2002-01-27 Junichi Uekawa <dancer@debian.org>
+
+ * pbuilder: modified to use umountproc_cleanbuildplace in "trap" for "pbuilder login"
+
+ * pbuilder-createbuildenv: added a trap function to cleanbuildplace on exit.
+ some obsolete and unnecessary cleanbuildplace invocation removed.
+
+ * pbuilder-buildpackage: changed abortingfunction -> umountproc_cleanbuildplace (name change)
+ * pbuilder-modules (umountproc_cleanbuildplace): changed function name.
+ * pbuilder-updatebuildenv: changed aborting function to umountproc_cleanbuildplace, to unify.
+ moved the "trap" invocation to a better location, before loadhooks.
+
2002-01-24 Junichi Uekawa <dancer@debian.org>
* pbuilder-updatebuildenv: Aborting function is performed through
diff --git a/debian/changelog b/debian/changelog
index 50298c8..162dd3b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,10 @@
pbuilder (0.19) unstable; urgency=low
* new version, not yet released
- * Added "pbuilder update" temp file cleaning process.
+ * Improved "pbuilder update/create/build" temp file cleaning process,
+ so that in most cases it will be cleaned.
- -- Junichi Uekawa <dancer@debian.org> Thu, 24 Jan 2002 02:51:40 +0900
+ -- Junichi Uekawa <dancer@debian.org> Sun, 27 Jan 2002 20:45:00 +0900
pbuilder (0.18) unstable; urgency=low
diff --git a/pbuilder b/pbuilder
index ccee45f..ca89bd9 100755
--- a/pbuilder
+++ b/pbuilder
@@ -38,10 +38,9 @@ case "$1" in
shift
. /usr/lib/pbuilder/pbuilder-checkparams
extractbuildplace
+ trap umountproc_cleanbuildplace exit
echo " -> entering the shell"
chroot "$BUILDPLACE" bin/bash
- umountproc
- cleanbuildplace
;;
*)
. /usr/lib/pbuilder/pbuilder-modules
diff --git a/pbuilder-buildpackage b/pbuilder-buildpackage
index b89c51f..76df7dd 100755
--- a/pbuilder-buildpackage
+++ b/pbuilder-buildpackage
@@ -102,7 +102,7 @@ function checkbuilddep_internal () {
done;
if [ "$SATISFIED" = "no" ]; then
echo Could not satisfy build-dependency.
- abortingfunction
+ umountproc_cleanbuildplace
exit 1
fi
done;
@@ -134,7 +134,7 @@ function checkbuilddep_internal () {
if $CHROOTEXEC usr/bin/dpkg -s $(echo "$INSTALLPKG" | tr "/" " " | awk '{print $1}') 2>&1 | grep ^Package: > /dev/null; then
if ! $CHROOTEXEC usr/bin/apt-get -y remove $(echo "$INSTALLPKG" | tr "/" " " | awk '{print $1}') ; then
echo "E: Could not satisfy build-conflicts" >&2
- abortingfunction
+ umountproc_cleanbuildplace
exit 1
fi
else
@@ -165,7 +165,7 @@ copydsc "$PACKAGENAME" "$BUILDPLACE/tmp/buildd"
echo Extracting source
if ! $CHROOTEXEC /bin/bash -c "( cd tmp/buildd; /usr/bin/dpkg-source -x $(basename $PACKAGENAME) )"; then
echo pbuilder: Failed extracting the source >&2
- abortingfunction
+ umountproc_cleanbuildplace
exit 1;
fi
@@ -201,13 +201,13 @@ export PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin"
if [ -z "$DEBEMAIL" ]; then
if ! $CHROOTEXEC /bin/bash -c "cd tmp/buildd/*/; dpkg-buildpackage -us -uc $DEBBUILDOPTS"; then
echo "pbuilder: Failed autobuilding of package" >&2
- abortingfunction
+ umountproc_cleanbuildplace
exit 1;
fi
else
if ! $CHROOTEXEC /bin/bash -c "cd tmp/buildd/*/; dpkg-buildpackage -us -uc \"-m$DEBEMAIL\" $DEBBUILDOPTS"; then
echo "pbuilder: Failed autobuilding of package" >&2
- abortingfunction
+ umountproc_cleanbuildplace
exit 1;
fi
fi
diff --git a/pbuilder-createbuildenv b/pbuilder-createbuildenv
index 7ad8cff..3cee940 100755
--- a/pbuilder-createbuildenv
+++ b/pbuilder-createbuildenv
@@ -11,6 +11,7 @@ if [ -z "$DISTRIBUTION" ]; then
fi
echo "Distribution is $DISTRIBUTION."
+# first clean it.
cleanbuildplace
echo "Building the build environment"
@@ -19,6 +20,8 @@ if [ ! -d "$BUILDPLACE" ]; then
echo "pbuilder: Could not make directory [$BUILDPLACE]" >&2
exit 1
fi
+trap cleanbuildplace exit
+
echo " -> running debootstrap"
DEBOOTSTRAPSCRIPT=""
if [ -n "$HOOKDIR" ]; then
@@ -29,7 +32,6 @@ if [ -n "$HOOKDIR" ]; then
fi
if ! ( cd "$BUILDPLACE" && debootstrap "$DISTRIBUTION" . "$MIRRORSITE" "$DEBOOTSTRAPSCRIPT" ) ; then
echo "pbuilder: debootstrap failed" >&2
- cleanbuildplace
exit 1
fi
@@ -51,6 +53,7 @@ installaptlines
echo "Refreshing the base.tgz "
echo " -> upgrading packages"
mountproc
+trap umountproc_cleanbuildplace exit
$CHROOTEXEC /usr/bin/apt-get update
if [ -n "$REMOVEPACKAGES" ]; then
$CHROOTEXEC /usr/bin/dpkg --purge $REMOVEPACKAGES
@@ -62,8 +65,11 @@ if [ -n "$HOOKDIR" ]; then
executehooks "X"
unloadhooks
fi
+
umountproc
+trap cleanbuildplace exit
+
echo " -> creating base.tgz"
( cd "$BUILDPLACE" && tar cfz "$BASETGZ" * || echo " -> failed building base.tgz")
-cleanbuildplace
+
diff --git a/pbuilder-modules b/pbuilder-modules
index 0c6c2a2..b838665 100644
--- a/pbuilder-modules
+++ b/pbuilder-modules
@@ -87,7 +87,7 @@ function cleanbuildplace () {
fi;
}
-function abortingfunction () {
+function umountproc_cleanbuildplace () {
# rolling back to abort.
umountproc
cleanbuildplace
@@ -120,7 +120,7 @@ EOF
function extractbuildplace () {
# after calling this function, umountproc, and cleanbuildplace
- # needs to be called.
+ # needs to be called. Please trap it.
cleanbuildplace
echo "building the build env"
echo " -> extracting base.tgz"
diff --git a/pbuilder-updatebuildenv b/pbuilder-updatebuildenv
index cff78b6..2fed04e 100755
--- a/pbuilder-updatebuildenv
+++ b/pbuilder-updatebuildenv
@@ -5,24 +5,19 @@ 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"
extractbuildplace
+trap umountproc_cleanbuildplace exit
if [ -n "$HOOKDIR" ]; then
loadhooks
fi
echo "Refreshing the base.tgz "
echo " -> upgrading packages"
-trap abortprocess exit
$CHROOTEXEC /usr/bin/apt-get update
$CHROOTEXEC /usr/bin/dpkg --purge lilo
$CHROOTEXEC /usr/bin/apt-get -y dist-upgrade