1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-14 23:46:10 +00:00
freebsd-ports/Tools/portbuild/scripts/checkmachines

34 lines
605 B
Plaintext
Raw Normal View History

#!/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