CHROOT and prePortBuild hook

Alexander Logvinov freebsd at akavia.ru
Mon May 26 18:12:29 EDT 2008


Hello!

Where is CHROOT environment variable in the prePortBuild hook?

# uname -r
7.0-RELEASE

# pkg_info -Ix tinder
tinderbox-2.4.2_2   Port build tinderbox system

# ./tc listHooks
Name       : prePortBuild
Command    : hookbuild.sh
Description:
Hook to run before building a port.
If this command returns a non-zero value, the port will not be built.
The following environment will be passed to the hook command:
        PACKAGE_NAME : Package name of the port
        BUILD : Build name for this port
        JAIL : Jail name for this Build
        PORTSTREE : PortsTree name for this Build
        CHROOT : Location of the Build root
        PORTDIR : Directory origin of this port
        PB : Tinderbox root


# cat hookbuild.sh
#!/bin/sh

major_version=$(echo ${JAIL} | sed -E -e 's|(^.).*$|\1|')
if [ ${major_version} -lt 7 ]; then
    cp ${PB}/scripts/misc/libmap.conf ${CHROOT}/etc
    echo 1 > /home/test
    echo ${CHROOT} >> /home/test
    echo 2 >> /home/test
fi

# cat /home/test
1

2


-- 
WBR



More information about the tinderbox-list mailing list