aboutsummaryrefslogtreecommitdiff
path: root/pdebuild-internal
diff options
context:
space:
mode:
authorJunichi Uekawa <dancer@dancer64.netfort.gr.jp>2007-05-31 23:56:53 +0900
committerJunichi Uekawa <dancer@dancer64.netfort.gr.jp>2007-05-31 23:56:53 +0900
commit2b9b75db4c491bfbf6b756f6aff937dc01231d1b (patch)
tree5bb5489f0c04541562961057a5a0de8797e3f1be /pdebuild-internal
parent5c0628653fb9bdd6e4216f8ad21c20964b2237d6 (diff)
downloadpbuilder-2b9b75db4c491bfbf6b756f6aff937dc01231d1b.tar
pbuilder-2b9b75db4c491bfbf6b756f6aff937dc01231d1b.tar.gz
add hook handling in pdebuild-internal
Diffstat (limited to 'pdebuild-internal')
-rw-r--r--pdebuild-internal20
1 files changed, 18 insertions, 2 deletions
diff --git a/pdebuild-internal b/pdebuild-internal
index a60fbad..6cf2e9a 100644
--- a/pdebuild-internal
+++ b/pdebuild-internal
@@ -72,6 +72,11 @@ while [ -n "$1" ]; do
esac
done
+# fool pbuilder-runhooks to use / as buildplace, since I am inside chroot.
+BUILDPLACE=
+. /usr/lib/pbuilder-runhooks
+
+executehooks "D"
export PBCURRENTCOMMANDLINEOPERATION="pdebuild"
"$PBUILDERSATISFYDEPENDSCMD"
apt-get install -y --force-yes fakeroot
@@ -81,9 +86,20 @@ groupadd -g "${BUILDRESULTGID}" -o pbgroup
useradd -g pbgroup -u "${BUILDRESULTUID}" -o pbuser
# what about id -G output? if other groups than the designated is used, we're stuffed.
-
export HOME=$(pwd)/../
+executehooks "A"
+
# do build with that user.
export DEBBUILDOPTS
-echo /usr/bin/dpkg-buildpackage -rfakeroot -us -uc '${DEBBUILDOPTS}' | su -p pbuser
+if echo /usr/bin/dpkg-buildpackage -rfakeroot -us -uc '${DEBBUILDOPTS}' | \
+ su -p pbuser;
+ then
+ # build was successful
+ :
+else
+ executehooks "C"
+ exit 1
+fi
+
+executehooks "B"