diff options
author | salo <salo> | 2006-02-10 23:41:20 +0000 |
---|---|---|
committer | salo <salo> | 2006-02-10 23:41:20 +0000 |
commit | 4d8df0eb0b8232908929c77afd9d339305476ad7 (patch) | |
tree | e452f467ddad25a12ec8609c0137ca5bd6c67b61 /pkgtools/pkg_comp | |
parent | afc48367e486c8082a96d385cd69b32147925ec1 (diff) | |
download | pkgsrc-4d8df0eb0b8232908929c77afd9d339305476ad7.tar.gz |
Welcome to 1.26:
- add MAKEROOT_HOOKS, a whitespace separated list of functions
or external scripts to be executed after the sandbox is created,
- be more verbose about hooks execution,
- run hooks only when they are defined.
ok <jmmv>
Diffstat (limited to 'pkgtools/pkg_comp')
-rw-r--r-- | pkgtools/pkg_comp/Makefile | 4 | ||||
-rw-r--r-- | pkgtools/pkg_comp/files/pkg_comp.8 | 12 | ||||
-rw-r--r-- | pkgtools/pkg_comp/files/pkg_comp.sh | 34 |
3 files changed, 36 insertions, 14 deletions
diff --git a/pkgtools/pkg_comp/Makefile b/pkgtools/pkg_comp/Makefile index 38e78daba5f..d4079febd06 100644 --- a/pkgtools/pkg_comp/Makefile +++ b/pkgtools/pkg_comp/Makefile @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.33 2006/01/06 23:08:51 seb Exp $ +# $NetBSD: Makefile,v 1.34 2006/02/10 23:41:20 salo Exp $ -DISTNAME= pkg_comp-1.25 +DISTNAME= pkg_comp-1.26 CATEGORIES= pkgtools MASTER_SITES= # empty DISTFILES= # empty diff --git a/pkgtools/pkg_comp/files/pkg_comp.8 b/pkgtools/pkg_comp/files/pkg_comp.8 index 8ad7afc7617..b4be783b0f0 100644 --- a/pkgtools/pkg_comp/files/pkg_comp.8 +++ b/pkgtools/pkg_comp/files/pkg_comp.8 @@ -1,4 +1,4 @@ -.\" $NetBSD: pkg_comp.8,v 1.29 2006/01/06 23:08:51 seb Exp $ +.\" $NetBSD: pkg_comp.8,v 1.30 2006/02/10 23:41:20 salo Exp $ .\" .\" pkg_comp - Build packages inside a clean chroot environment .\" Copyright (c) 2002, 2003, 2004, 2005 Julio M. Merino Vidal <jmmv@NetBSD.org> @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 6, 2006 +.Dd February 10, 2006 .Dt PKG_COMP 8 .Os .Sh NAME @@ -416,6 +416,14 @@ Defaults to Mount options. Defaults to .Sy -t null -o ro . +.It MAKEROOT_HOOKS +A whitespace separated list of functions or external scripts to be executed +after the sandbox is created. +Two arguments are given to each of them: +.Ar $DESTDIR , +and the word +.Ar makeroot . +Defaults to nothing. .It MOUNT_HOOKS A whitespace separated list of functions or external scripts to be executed after file systems are mounted. diff --git a/pkgtools/pkg_comp/files/pkg_comp.sh b/pkgtools/pkg_comp/files/pkg_comp.sh index 391493b6ccc..39605f1dac2 100644 --- a/pkgtools/pkg_comp/files/pkg_comp.sh +++ b/pkgtools/pkg_comp/files/pkg_comp.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: pkg_comp.sh,v 1.28 2006/02/10 23:36:12 salo Exp $ +# $NetBSD: pkg_comp.sh,v 1.29 2006/02/10 23:41:20 salo Exp $ # # pkg_comp - Build packages inside a clean chroot environment # Copyright (c) 2002, 2003, 2004, 2005 Julio M. Merino Vidal <jmmv@NetBSD.org> @@ -49,9 +49,9 @@ _TEMPLATE_VARS="DESTDIR ROOTSHELL COPYROOTCFG BUILD_TARGET DISTRIBDIR SETS \ SETS_X11 REAL_SRC REAL_SRC_OPTS REAL_PKGSRC \ REAL_PKGSRC_OPTS REAL_DISTFILES REAL_DISTFILES_OPTS \ REAL_PACKAGES REAL_PACKAGES_OPTS REAL_PKGVULNDIR \ - NETBSD_RELEASE MOUNT_HOOKS UMOUNT_HOOKS SYNC_UMOUNT \ - AUTO_TARGET AUTO_PACKAGES BUILD_PACKAGES REAL_CCACHE \ - LIBKVER_STANDALONE_PREFIX" + NETBSD_RELEASE MAKEROOT_HOOKS MOUNT_HOOKS UMOUNT_HOOKS \ + SYNC_UMOUNT AUTO_TARGET AUTO_PACKAGES BUILD_PACKAGES \ + REAL_CCACHE LIBKVER_STANDALONE_PREFIX" _BUILD_RESUME= @@ -120,6 +120,7 @@ env_setdefaults() : ${REAL_PKGVULNDIR:=/usr/pkgsrc/distfiles} : ${NETBSD_RELEASE:=no} : ${LIBKVER_STANDALONE_PREFIX:=/libkver} + : ${MAKEROOT_HOOKS:=} : ${MOUNT_HOOKS:=} : ${UMOUNT_HOOKS:=} : ${SYNC_UMOUNT:=no} @@ -280,9 +281,12 @@ fsmount() touch $fsstate - for h in ${MOUNT_HOOKS}; do - ${h} ${DESTDIR} mount - done + if [ -n "${MOUNT_HOOKS}" ]; then + echo "Executing mount hooks." + for h in ${MOUNT_HOOKS}; do + ${h} ${DESTDIR} mount + done + fi } # fsumount @@ -306,9 +310,12 @@ fsumount() return fi - for h in ${UMOUNT_HOOKS}; do - ${h} ${DESTDIR} umount - done + if [ -n "${UMOUNT_HOOKS}" ]; then + echo "Executing umount hooks." + for h in ${UMOUNT_HOOKS}; do + ${h} ${DESTDIR} umount + done + fi fsfailed=no @@ -530,6 +537,13 @@ makeroot() fi makeroot_x11 + + if [ -n "${MAKEROOT_HOOKS}" ]; then + echo "Executing makeroot hooks." + for h in ${MAKEROOT_HOOKS}; do + ${h} ${DESTDIR} makeroot + done + fi } # makeroot_mkconf |