mirror of
https://git.FreeBSD.org/ports.git
synced 2024-10-30 21:49:25 +00:00
0d088a094b
/var/portbuild is the new designated home of the portbuild setup, and is expected to be a symlink to wherever you choose to put the stuff. Also, change reportload to use /var/portbuild to store temporary files. Seems there are some bugs in the null mount code that make the files inaccessible if you are using an NFS root.
38 lines
726 B
Bash
Executable File
38 lines
726 B
Bash
Executable File
#!/bin/sh
|
|
|
|
buildroot=/var/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=$(awk '{print $1}' ${buildroot}/loads/$m)
|
|
if [ "x$num" = "x" ]; then
|
|
# logger "checkmachines: file ${buildroot}/loads/$m is empty"
|
|
num=99
|
|
fi
|
|
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
|