2004-11-08 18:55:25 -05:00
|
|
|
#!/bin/bash
|
|
|
|
#----------------------------------------------------------------------
|
|
|
|
|
|
|
|
set -o errexit
|
|
|
|
|
|
|
|
# read the config variables from the file given on the command line
|
2006-02-26 22:25:48 -05:00
|
|
|
# . $1
|
2004-11-08 18:55:25 -05:00
|
|
|
|
2006-02-27 00:06:06 -05:00
|
|
|
coHost=$1
|
|
|
|
host=$2
|
|
|
|
reltag=$3
|
|
|
|
shift;shift;shift
|
2004-11-08 18:55:25 -05:00
|
|
|
pyver=$@
|
|
|
|
|
2004-11-08 22:40:11 -05:00
|
|
|
if [ $pyver = config ]; then
|
|
|
|
pyver=$PYVER
|
|
|
|
fi
|
|
|
|
|
2004-11-08 18:55:25 -05:00
|
|
|
|
|
|
|
function TestOnline {
|
|
|
|
local host=$1
|
|
|
|
local message=$2
|
|
|
|
|
|
|
|
if ping -q -c1 -w1 $host > /dev/null; then
|
|
|
|
return 0
|
|
|
|
else
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if [ $skiplinux != yes ]; then
|
|
|
|
|
|
|
|
startedCoHost=no
|
|
|
|
hostAvailable=no
|
|
|
|
|
|
|
|
# test if the target machine is online
|
|
|
|
if TestOnline $host; then
|
|
|
|
hostAvailable=yes
|
|
|
|
else
|
|
|
|
# Attempt to start the host via it's coLinux host, if there is one
|
2005-02-28 13:37:29 -05:00
|
|
|
if [ $coHost != none -a $startcohost == yes ]; then
|
2004-11-08 18:55:25 -05:00
|
|
|
if TestOnline $coHost; then
|
|
|
|
echo "Attempting to start $host via coLinux on $coHost..."
|
|
|
|
ssh $coHost "/c/coLinux/VMs/$host.bat -d > /dev/null 2>&1 &"
|
|
|
|
|
|
|
|
# Give it time to boot and be ready for conenctions,
|
|
|
|
# and then test with ssh, limiting retries.
|
2005-02-28 13:37:29 -05:00
|
|
|
for x in `seq 36`; do
|
2004-11-08 18:55:25 -05:00
|
|
|
sleep 5
|
|
|
|
echo "checking..."
|
|
|
|
if ssh root@$host "true" >/dev/null 2>&1; then
|
|
|
|
# success! the host is ready so we can break out of the loop
|
|
|
|
break;
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# test if the host is ready
|
|
|
|
if TestOnline $host; then
|
|
|
|
echo "coLinux start of $host on $coHost successful."
|
|
|
|
startedCoHost=yes
|
|
|
|
hostAvailable=yes
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "The $coHost machine is offline, unable to start coLinux for $host"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $hostAvailable = yes ]; then
|
|
|
|
echo "The $host machine is online, build continuing..."
|
|
|
|
else
|
|
|
|
echo "The $host machine is **OFFLINE**, skipping the binary RPM build."
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
echo "Copying source files and build script..."
|
|
|
|
ssh root@$host "mkdir -p $LINUX_BUILD && rm -rf $LINUX_BUILD/*"
|
|
|
|
scp $STAGING_DIR/wxPython-src* $STAGING_DIR/wxPython.spec\
|
|
|
|
distrib/all/do-build-rpm \
|
|
|
|
root@$host:$LINUX_BUILD
|
|
|
|
|
|
|
|
echo "Running build script on $host..."
|
|
|
|
cmd=./do-build-rpm
|
|
|
|
ssh root@$host "cd $LINUX_BUILD && $cmd $reltag $skipclean $VERSION $pyver"
|
|
|
|
|
|
|
|
echo "Fetching the results..."
|
|
|
|
scp "root@$host:$LINUX_BUILD/wxPython*.i[0-9]86.rpm" $STAGING_DIR
|
|
|
|
ssh root@$host "rm $LINUX_BUILD/wxPython*.i[0-9]86.rpm"
|
|
|
|
|
|
|
|
|
|
|
|
if [ $startedCoHost = yes ]; then
|
|
|
|
echo "Halting $host on $coHost..."
|
|
|
|
ssh root@$host "/sbin/halt"
|
|
|
|
sleep 10
|
|
|
|
fi
|
2005-06-05 00:51:51 -04:00
|
|
|
sleep 30
|
|
|
|
|
|
|
|
echo "Done!"
|
2004-11-08 18:55:25 -05:00
|
|
|
fi
|
2005-04-08 17:46:07 -04:00
|
|
|
|