forked from Lainports/freebsd-ports
that is built. This saves a lot of time, especiall when the
parallelism (the number of jobs per machine, not the number of
machines) is low.
However, the build script only blows away /usr/local and
/usr/X11R6, so if there is a port that does some nasty things
outside that area, all bets are off.
(2) Better load balancing. Now, each machine reports its own
load in a form of a text file, which the master merely aggregates
to pick the lowest-loaded machine(s). Other than generally
running faster (and more up-to-date) under loaded conditions, the
master script will no longer hold up until a timeout when a
machine goes down.
33 lines
605 B
Bash
Executable file
33 lines
605 B
Bash
Executable file
#!/bin/sh
|
|
|
|
buildroot=/a/asami/portbuild
|
|
mlist=${buildroot}/mlist
|
|
stamp=${buildroot}/loads/.stamp
|
|
|
|
unset DISPLAY
|
|
|
|
while true; do
|
|
touch ${stamp}
|
|
sleep 15
|
|
min=99
|
|
set $(cat $mlist)
|
|
while [ $# -gt 1 ]; do
|
|
m=$1
|
|
l=$2
|
|
if [ -f ${buildroot}/loads/$m -a \
|
|
! -z "$(find ${buildroot}/loads/$m -newer ${stamp})" ]; then
|
|
num=$(cat ${buildroot}/loads/$m)
|
|
else
|
|
num=99
|
|
fi
|
|
num=$(($num / $l))
|
|
if [ $num -lt $min ]; then
|
|
mach=$m
|
|
min=$num
|
|
elif [ $num = $min ]; then
|
|
mach="$mach $m"
|
|
fi
|
|
shift 2
|
|
done
|
|
echo "$mach" > ${buildroot}/ulist
|
|
done
|