blob: 05be19ae01ce397e06834c73525998a75c724ece (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
#!/bin/sh
#
# pdispatch <arch> <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
arch=$1
shift
. ${pb}/${arch}/portbuild.conf
. ${pb}/scripts/buildenv
# wait 8 hours maximum
timeout=28800
branch=$1
command=$2
shift 2
buildenv ${pb} ${arch} ${branch}
# ssh -x doesn't work on some machines
unset DISPLAY
pkgname=$(basename $1 ${PKGSUFFIX})
if grep -qxF $pkgname ${pb}/${arch}/${branch}/duds; then
echo "skipping $pkgname"
exit 1
fi
args=${1+"$@"}
num=$(wc -w ${pb}/${arch}/ulist | awk '{print $1}')
random=$(jot -r 1 1 ${num})
mach=$(cat ${pb}/${arch}/ulist | cut -f ${random} -d ' ' )
set $mach
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
if [ "x$WANT_DISTFILES" != "x" ]; then
flags="${flags} -distfiles"
fi
if [ "x$FETCH_ORIGINAL" != "x" ]; then
flags="${flags} -fetch-original"
fi
echo "dispatching: ssh -a -t -n root@$1 ${command} ${arch} ${branch} $flags $args at $(date)"
${pb}/scripts/ptimeout.host $timeout ssh -a -t -n root@$1 ${command} ${arch} ${branch} ${flags} $args
|