forked from Lainports/freebsd-ports
one 'head' node, rather than just pointyhat itself. Constants are factored out into installation-specific files known as portbuild/conf/server.conf and portbuild/conf/client.conf. There is only one server.conf file. Individual <arch> directories may have their own client.conf files, or may symlink to ../conf/client.conf. Note the very special handling of cvs tag. Feature safe: yes
87 lines
1.7 KiB
Bash
Executable file
87 lines
1.7 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
#
|
|
# XXX lockfile and interlock with mkbindist to avoid overlapping
|
|
# builds
|
|
|
|
pb=/var/portbuild
|
|
. ${pb}/conf/server.conf
|
|
|
|
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}/conf/server.conf
|
|
. ${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}
|
|
# Workaround needed for zfs - 20090321 erwin
|
|
export NO_FSCHG=1
|
|
|
|
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
|
|
|
|
# XXX MCL I don't know what this is supposed to do.
|
|
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"
|
|
eval tag=\$SRC_BRANCH_${branch}_TAG
|
|
cvs -Rq update -PdA -r ${tag} || exit $?
|
|
fi
|
|
|
|
echo "==> Starting make buildworld"
|
|
make buildworld ${args} || exit $?
|
|
|
|
echo "==> Cleaning up destdir"
|
|
destdir=${WORLDDIR}/${arch}/${branch}
|
|
rm -rf ${destdir}/
|
|
chflags -R noschg ${destdir}/
|
|
rm -rf ${destdir}/
|
|
mkdir -p ${destdir} || exit $?
|
|
|
|
echo "==> Starting make installworld"
|
|
if [ "$client" = "0" ]; then
|
|
export NEWSPARC_TIMETYPE=__int64_t
|
|
make installworld DESTDIR=${destdir} || exit $?
|
|
|
|
echo "==> Starting make distribute"
|
|
make DESTDIR=${destdir} distrib-dirs && \
|
|
make DESTDIR=${destdir} distribution || exit $?
|
|
|
|
else
|
|
echo "==> Not doing installworld of client source tree"
|
|
fi
|