aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpbuilder-createbuildenv8
-rw-r--r--pbuilder-runhooks14
-rwxr-xr-xpbuilder-updatebuildenv12
3 files changed, 25 insertions, 9 deletions
diff --git a/pbuilder-createbuildenv b/pbuilder-createbuildenv
index 1a83982..bee47e4 100755
--- a/pbuilder-createbuildenv
+++ b/pbuilder-createbuildenv
@@ -25,7 +25,9 @@ echo " -> running debootstrap"
exit 1
)
echo " -> debootstrap finished"
-test -n "HOOKDIR" && loadhooks
+if [ -n "$HOOKDIR" ]; then
+ loadhooks
+fi
mkdir -p "$BUILDPLACE/tmp/buildd"
echo " -> copying local configuration"
for a in passwd hosts hostname resolv.conf ; do
@@ -45,7 +47,9 @@ fi
$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
-test -n "HOOKDIR" && executehooks "X"
+if [ -n "$HOOKDIR" ]; then
+ executehooks "X"
+fi
umountproc
echo " -> creating base.tgz"
( cd "$BUILDPLACE" && tar cfz "$BASETGZ" * || echo " -> failed building base.tgz")
diff --git a/pbuilder-runhooks b/pbuilder-runhooks
index 623f29b..8e19bca 100644
--- a/pbuilder-runhooks
+++ b/pbuilder-runhooks
@@ -18,6 +18,9 @@
#
# HISTORY:
# $Log$
+# Revision 1.5 2001/09/27 09:16:34 dancer
+# fixing some serious typos .
+#
# Revision 1.4 2001/09/27 08:20:58 dancer
# changing little bits to my liking, and hopefully removing any potentially dangerous bits.
#
@@ -48,7 +51,7 @@ hooks=/tmp/hooks
#
function loadhooks () {
- if [ -e "$BUILDPLACE/$hooks" ]; then
+ if [ -d "$BUILDPLACE/$hooks" ]; then
rm -rf "$BUILDPLACE/$hooks"
fi
if [ -d "$HOOKDIR" ]; then
@@ -61,7 +64,11 @@ function loadhooks () {
#
function unloadhooks () {
- rm -rf "$BUILDPLACE/$hooks"
+ if [ -d "$BUILDPLACE/$hooks" ]; then
+ rm -rf "$BUILDPLACE/$hooks"
+ else
+ echo "E: Logic failure."
+ fi
}
#--------------------------------------------------------------------------
@@ -77,7 +84,6 @@ function unloadhooks () {
function executehooks () {
local prefix=$1
-
# is this necessary?
pushd $BUILDPLACE/$hooks
for fn in $prefix[0-9][0-9]* ; do
@@ -85,7 +91,7 @@ function executehooks () {
*~)
echo "E: skipping an editor backup file $fn"
;;
- *.bak)
+ *.bak)
echo "E: skipping a backup file $fn"
;;
*)
diff --git a/pbuilder-updatebuildenv b/pbuilder-updatebuildenv
index 3a59098..7031931 100755
--- a/pbuilder-updatebuildenv
+++ b/pbuilder-updatebuildenv
@@ -9,7 +9,9 @@ test -n "$DISTRIBUTION" && echo "Upgrading for distribution $DISTRIBUTION"
extractbuildplace
-test -n "HOOKDIR" && loadhooks
+if [ -n "$HOOKDIR" ]; then
+ loadhooks
+fi
echo "Refreshing the base.tgz "
echo " -> upgrading packages"
$CHROOTEXEC /usr/bin/apt-get update
@@ -17,8 +19,12 @@ $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
-test -n "HOOKDIR" && executehooks
-test -n "HOOKDIR" && unloadhooks "X"
+
+if [ -n "$HOOKDIR" ]; then
+ executehooks
+ unloadhooks "X"
+fi
+
umountproc
echo " -> creating base.tgz"
(cd "$BUILDPLACE"; tar cfz "$BASETGZ" *)