1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-31 21:57:12 +00:00
freebsd-ports/Tools/portbuild/scripts/checkmachines
Satoshi Asami 8b817234de (1) Do not delete and recreate the chroot dir for every new package
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.
1999-01-26 03:06:24 +00:00

34 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