diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | debian/changelog | 6 | ||||
-rwxr-xr-x | pbuilder-buildpackage | 5 | ||||
-rwxr-xr-x | pbuilder-createbuildenv | 11 | ||||
-rw-r--r-- | pbuilder-runhooks | 14 | ||||
-rwxr-xr-x | pbuilder-updatebuildenv | 11 | ||||
-rw-r--r-- | pbuilder.1 | 16 |
7 files changed, 58 insertions, 16 deletions
@@ -1,3 +1,14 @@ +2002-02-24 Junichi Uekawa <dancer@debian.org> + + * pbuilder-runhooks: add quoting. + + * pbuilder.1: added notes of hooks + + * pbuilder-createbuildenv: HOOKDIR checking is moved over to runhooks. + * pbuilder-updatebuildenv: likewise + + * pbuilder-runhooks: checks HOOKDIR, and if it's blank, quit. + 2002-02-22 Junichi Uekawa <dancer@debian.org> * debian/changelog: release 0.23 diff --git a/debian/changelog b/debian/changelog index 4b29ee7..545f36d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,12 @@ pbuilder (0.24) unstable; urgency=low * (not yet released) FIXME + * hooks support is in place for build target now. Read pbuilder.1 + for details. Adding C00bash, which contains a line calling "bash" + will allow running inside the chroot... + (closes: #134757) - -- Junichi Uekawa <dancer@debian.org> Sat, 23 Feb 2002 01:57:10 +0900 + -- Junichi Uekawa <dancer@debian.org> Sun, 24 Feb 2002 16:54:36 +0900 pbuilder (0.23) unstable; urgency=low diff --git a/pbuilder-buildpackage b/pbuilder-buildpackage index 247ae73..c2b386a 100755 --- a/pbuilder-buildpackage +++ b/pbuilder-buildpackage @@ -224,6 +224,7 @@ fi showbuildbanner echobacktime extractbuildplace +loadhooks createbuilduser echo Copying source file @@ -243,6 +244,8 @@ save_aptcache echo " -> Building the package" export PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin" +executehooks "A" + if [ -z "$DEBEMAIL" ]; then if ! $CHROOTEXEC /bin/bash -c "cd tmp/buildd/*/; $SUTOUSER dpkg-buildpackage -us -uc $DEBBUILDOPTS"; then echo "pbuilder: Failed autobuilding of package" >&2 @@ -252,11 +255,13 @@ if [ -z "$DEBEMAIL" ]; then else if ! $CHROOTEXEC /bin/bash -c "cd tmp/buildd/*/; $SUTOUSER dpkg-buildpackage -us -uc \"-m$DEBEMAIL\" $DEBBUILDOPTS"; then echo "pbuilder: Failed autobuilding of package" >&2 + executehooks "C" umountproc_cleanbuildplace exit 1; fi fi +executehooks "B" umountproc if [ -n "$BUILDRESULT" ]; then diff --git a/pbuilder-createbuildenv b/pbuilder-createbuildenv index f181b51..fcbf58d 100755 --- a/pbuilder-createbuildenv +++ b/pbuilder-createbuildenv @@ -54,9 +54,7 @@ if ! ( cd "$BUILDPLACE" && debootstrap "$DISTRIBUTION" . "$MIRRORSITE" "$DEBOOTS fi echo " -> debootstrap finished" -if [ -n "$HOOKDIR" ]; then - loadhooks -fi +loadhooks mkdir -p "$BUILDPLACE/tmp/buildd" echo " -> copying local configuration" @@ -81,10 +79,9 @@ $CHROOTEXEC /usr/bin/apt-get -y dist-upgrade $CHROOTEXEC /usr/bin/apt-get -y install build-essential dpkg-dev apt $EXTRAPACKAGES save_aptcache $CHROOTEXEC /usr/bin/apt-get clean -if [ -n "$HOOKDIR" ]; then - executehooks "X" - unloadhooks -fi + +executehooks "X" +unloadhooks umountproc trap cleanbuildplace exit diff --git a/pbuilder-runhooks b/pbuilder-runhooks index da7cf4a..822996f 100644 --- a/pbuilder-runhooks +++ b/pbuilder-runhooks @@ -18,6 +18,9 @@ # # HISTORY: # $Log$ +# Revision 1.12 2002/02/24 07:57:06 dancer +# added hooks support for pbuilder build target. +# # Revision 1.11 2001/10/21 05:03:21 dancer # fixing bugs related to runhooks, reported by Dale. Some serious logic disorder seems to be. # @@ -69,6 +72,9 @@ hooks=tmp/hooks # function loadhooks () { + if [ -z "$HOOKDIR" ]; then + return ; + fi if [ -d "$BUILDPLACE/$hooks" ]; then rm -rf "$BUILDPLACE/$hooks" fi @@ -83,6 +89,9 @@ function loadhooks () { # function unloadhooks () { + if [ -z "$HOOKDIR" ]; then + return ; + fi if [ -d "$BUILDPLACE/$hooks" ]; then rm -rf "$BUILDPLACE/$hooks" else @@ -103,6 +112,9 @@ function unloadhooks () { function executehooks () { local prefix="$1" + if [ -z "$HOOKDIR" ]; then + return ; + fi for fn in "$BUILDPLACE/$hooks/$prefix"[0-9][0-9]* ; do case "$fn" in *~) @@ -112,7 +124,7 @@ function executehooks () { echo "W: skipping a backup file $fn" ;; *) - if [ -x $fn ]; then + if [ -x "$fn" ]; then $CHROOTEXEC "$hooks/"$(basename "$fn") echo " -> user script $fn finished" else diff --git a/pbuilder-updatebuildenv b/pbuilder-updatebuildenv index c081b5e..b020254 100755 --- a/pbuilder-updatebuildenv +++ b/pbuilder-updatebuildenv @@ -29,9 +29,7 @@ test -n "$DISTRIBUTION" && echo "Upgrading for distribution $DISTRIBUTION" extractbuildplace trap umountproc_cleanbuildplace exit -if [ -n "$HOOKDIR" ]; then - loadhooks -fi +loadhooks echo "Refreshing the base.tgz " echo " -> upgrading packages" $CHROOTEXEC /usr/bin/apt-get update @@ -44,10 +42,9 @@ $CHROOTEXEC /usr/bin/apt-get -y install build-essential dpkg-dev apt $EXTRAPACKA save_aptcache $CHROOTEXEC /usr/bin/apt-get clean || true -if [ -n "$HOOKDIR" ]; then - executehooks "X" - unloadhooks -fi +executehooks "X" +unloadhooks + umountproc trap cleanbuildplace exit echo " -> creating base.tgz" @@ -188,6 +188,8 @@ in other than Bourne Shell or Perl, it is up to the user to ensure the interpreter was previously installed in the chrooted environment. Files ending in ~ or .bak are ignored. + + Although it may not seem necessary, .B "pbuilder update" does not invoke the hooks if @@ -206,6 +208,20 @@ distribution, pbuilder will call debootstrap with that as the 4th parameter in the chroot creation process. This allows for use of custom debootstrap hook script. +.B "A<digit><digit><whatever-else-you-want>" +is for +.B build +target. +It is executed before build starts, after +unpacking the build system, and unpacking the source. + +.B "B<digit><digit><whatever-else-you-want>" +is executed after build system finishes building, +successfully, before copying back the build result. + +.B "C<digit><digit><whatever-else-you-want>" +is executed after build fails, before cleanup. + .TP .BI "--debemail [" "email-address" "]" |