freebsd-ports/Tools/portbuild/scripts/pdispatch
Kris Kennaway 2f9e4ad54b * Use portbuild.conf for config information.
* Shorten timeout period from 12 hours to 4 hours to avoid delaying the builds
  unnecessarily.
* Reverse sense of NOPLISTCHECK -> PLISTCHECK, since it's not an option
  we want enabled by default (it causes too many build failures).  This
  was too easy to forget when building packages 'by hand' using the parallel
  makefile.
2002-03-09 23:14:41 +00:00

49 lines
1.1 KiB
Bash
Executable file

#!/bin/sh
#
# pdispatch <branch> <command> <package.tgz> [<args> ...]
#
# Choose a random machine from ${buildroot}/ulist and dispatch the
# job to it via the ptimeout script.
pb=/var/portbuild
. ${pb}/portbuild.conf
# wait 4 hours maximum
timeout=14400
branch=$1
command=$2
shift 2
# ssh -x doesn't work on some machines
unset DISPLAY
pkgname=$(basename $1 .tgz)
buildroot=$(dirname $(dirname $0))
if grep -qxF $pkgname ${buildroot}/${branch}/duds; then
echo "skipping $pkgname"
exit 1
fi
args=${1+"$@"}
mach=$(cat ${buildroot}/ulist)
num=$(echo $(echo $mach | wc -w))
set $mach
shift $(echo "$$ $num" | awk '{srand($1); print(int(rand()*$2))}')
flags=""
if [ "x$NOCLEAN" != "x" ]; then
flags="${flags} -noclean"
fi
if [ "x$NO_RESTRICTED" != "x" ]; then
flags="${flags} -norestr"
fi
if [ "x$PLISTCHECK" != "x" ]; then
flags="${flags} -plistcheck"
fi
if [ "x$NODUMMY" != "x" ]; then
flags="${flags} -nodummy"
fi
echo "dispatching: ssh -a -t -n $1 ${command} ${branch} $flags $args at $(date)"
${buildroot}/scripts/ptimeout $timeout ssh -a -t -n $1 ${command} ${branch} ${flags} $args