#!/bin/sh pb=/var/portbuild if [ $# -lt 2 ]; then echo "usage: makeworld arch branch [args]" exit 1 fi arch=$1 branch=$2 shift 2 . ${pb}/${arch}/portbuild.conf export TARGET_ARCH=${arch} client=0 nocvs=0 # optional arguments while [ $# -gt 0 ]; do case "x$1" in x-client) client=1 ;; x-nocvs) nocvs=1 ;; *) break ;; esac shift done if [ "$client" = "1" ]; then SRCBASE=${pb}/${arch}/src-client shift 1 else SRCBASE=${pb}/${arch}/${branch}/src export __MAKE_CONF=/dev/null fi cd ${SRCBASE} if [ "$nocvs" = "0" ]; then echo "==> Updating source tree" cvs -Rq update -Pd error=$? if [ "$error" != "0" ]; then exit 1 fi fi env echo "==> Starting make buildworld" make buildworld $* error=$? if [ "$error" != "0" ]; then exit $error fi echo "==> Cleaning up chroot" rm -rf /var/chroot/ chflags -R noschg /var/chroot/ rm -rf /var/chroot/ mkdir /var/chroot/ echo "==> Starting make installworld" if [ "$client" = "0" ]; then export NEWSPARC_TIMETYPE=__int64_t make installworld DESTDIR=/var/chroot error=$? if [ "$error" != "0" ]; then exit $error fi echo "==> Starting make distribute" if [ "$branch" = "5" ]; then cd etc make obj make all make distribute DISTRIBUTION=/var/chroot/ else make DESTDIR=/var/chroot distrib-dirs && \ make DESTDIR=/var/chroot distribution fi error=$? if [ "$error" != "0" ]; then exit $error fi else echo "==> Not doing installworld of client source tree" fi