freebsd-ports/Tools/portbuild/scripts/makeindex
Mark Linimon 3d5c2cff29 Generalize the packge building scripts to be able to be run on more than
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.

Gracefully handle the case of INDEX failing to build.  This helps the
calling script to exit instead of spewing errors.

Feature safe:	yes
2010-06-25 23:22:45 +00:00

52 lines
1 KiB
Bash
Executable file

#!/bin/sh
# usage: $0 arch branch buildid
# Don't want to pick up host customizations
export INDEX_PRISTINE=1
# Don't give luser advice if it fails
export INDEX_QUIET=1
# Concurrency of index build
export INDEX_JOBS=6
pb=/var/portbuild
usage () {
echo "usage: makeindex arch branch buildid"
exit 1
}
if [ $# -ne 3 ]; then
usage
fi
arch=$1
branch=$2
buildid=$3
shift 3
builddir=${pb}/${arch}/${branch}/builds/${buildid}
. ${pb}/conf/server.conf
. ${pb}/${arch}/portbuild.conf
. ${pb}/scripts/buildenv
# Set up the build env variables
buildenv ${pb} ${arch} ${branch} ${builddir}
unset DISPLAY
# Don't pick up installed packages from the host
export LOCALBASE=/nonexistentlocal
cd ${PORTSDIR}
make index
if [ ! -e ${INDEXFILE} ]; then
echo "makeindex: failed to make ${INDEXFILE}"
exit 1
fi
# remove extra spaces in dependency list -- this causes problems
# Also transform the dummy paths to their canonical locations
sed -i '' -e 's/ */ /g' -e 's/| */|/g' -e 's/ *|/|/g' -e "s,${LOCALBASE},/usr/local," ${INDEXFILE}