diff options
author | Junichi Uekawa <dancer@netfort.gr.jp> | 2009-11-29 17:22:13 +0900 |
---|---|---|
committer | Junichi Uekawa <dancer@netfort.gr.jp> | 2009-11-29 17:22:13 +0900 |
commit | 040fb06d79720767e11e67769e51039729e56882 (patch) | |
tree | b439596600798a3a34bff877cf6bcd6d4ea4a260 /pdebuild-internal | |
parent | c789e0695482a3ee37c2374082dfb1725bcd627b (diff) | |
download | pbuilder-040fb06d79720767e11e67769e51039729e56882.tar pbuilder-040fb06d79720767e11e67769e51039729e56882.tar.gz |
make --hookdir work on pdebuild-internal (closes:#526471)
Diffstat (limited to 'pdebuild-internal')
-rw-r--r-- | pdebuild-internal | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/pdebuild-internal b/pdebuild-internal index d309c51..173bfb9 100644 --- a/pdebuild-internal +++ b/pdebuild-internal @@ -77,9 +77,25 @@ while [ -n "$1" ]; do esac done -# fool pbuilder-runhooks to use / as buildplace, since I am inside chroot. -BUILDPLACE=/ +# Calling pbuilder-runhooks; we try to fix up enough to fool +# pbuilder-runhooks. The following source call depends on +# pbuilder-runhook inside the chroot, which might be different from +# the version outside the chroot. . /usr/lib/pbuilder/pbuilder-runhooks +# fool pbuilder-runhooks to use / as buildplace, since I am already +# inside chroot. +BUILDPLACE=/ +# chroot command will just chroot to /, which will effectively chdir +# to / and nothing else. +CHROOTEXEC="chroot $BUILDPLACE " +# make HOOKDIR contain something if there is a hook, to fool HOOKDIR +# check inside pbuilder-runhooks that there is HOOKDIR +# configuration. We don't call loadhooks or unloadhooks ourselves, +# pbuilder execute will do that for you, so we should be okay. +# TODO: handle when --hookdir was not initially specified. +if [ -d "/$hookdir" ]; then + HOOKDIR="/$hookdir" +fi executehooks "D" export PBCURRENTCOMMANDLINEOPERATION="pdebuild" @@ -97,6 +113,8 @@ executehooks "A" # do build with that user. export DEBBUILDOPTS +# This command should be ran with current directory as bind-mounted +# package source directory if echo /usr/bin/dpkg-buildpackage -rfakeroot -us -uc '${DEBBUILDOPTS}' | \ su -p pbuser; then |