freebsd-ports/Tools/portbuild/scripts/makeworld
Kris Kennaway 4bcc698d1c * Cleanup
* Catch up to build ID directory changes
* Desupport 5.x
2008-07-26 13:47:45 +00:00

96 lines
1.6 KiB
Bash
Executable file

#!/bin/sh
#
# XXX lockfile and interlock with mkbindist to avoid overlapping
# builds
pb=/var/portbuild
if [ $# -lt 3 ]; then
echo "usage: makeworld arch branch buildid [args]"
exit 1
fi
arch=$1
branch=$2
buildid=$3
shift 3
builddir=${pb}/${arch}/${branch}/builds/${buildid}
. ${pb}/${arch}/portbuild.conf
# NB: we can't use buildenv because it sets ARCH and MACHINE_ARCH that
# confuses cross-builds
export TARGET_ARCH=${arch}
case "$branch" in
6*)
export SRCBRANCH="-r RELENG_6"
;;
7*)
export SRCBRANCH="-r RELENG_7"
;;
8*)
export SRCBRANCH=
;;
*)
echo "Invalid branch ${branch}"
exit 1
;;
esac
client=0
nocvs=0
# optional arguments
while [ $# -gt 0 ]; do
case "$1" in
-client)
client=1
;;
-nocvs)
nocvs=1
;;
*)
args="$1 ${args}"
;;
esac
shift
done
if [ "$client" = "1" ]; then
SRCBASE=${pb}/${arch}/src-client
shift 1
else
SRCBASE=${builddir}/src
export __MAKE_CONF=/dev/null
fi
cd ${SRCBASE}
if [ "$nocvs" = "0" ]; then
echo "==> Updating source tree"
cvs -Rq update -PdA ${SRCBRANCH} || exit $?
fi
echo "==> Starting make buildworld"
make buildworld ${args} || exit $?
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 || exit $?
echo "==> Starting make distribute"
make DESTDIR=/var/chroot distrib-dirs && \
make DESTDIR=/var/chroot distribution || exit $?
else
echo "==> Not doing installworld of client source tree"
fi