#!/bin/sh cd / # On Mac OS X, there are some handy things in Fink, but don't override the # built-in tools PATH="${PATH}:/sw/bin:/sw/sbin" export PATH # the source dir where this script is SCRIPT_DIR=`echo $0 | sed 's|\(.*\)/.*$|\1|'` . $SCRIPT_DIR/auto-build-common # the name of this script SCRIPT=`echo $0| sed 's|.*/\(.*\)|\1|g'` run_build_script () { distro=$1 LOGFILE=${HOME}/logs/${DATE}_${TIME}_${SYSTEM}_${HOSTNAME}_${distro}_${SCRIPT}.txt touch ${LOGFILE} sh ${HOME}/auto-build/${distro}/scripts/auto-build/${distro}-auto-builder.sh >> $LOGFILE 2>&1 case $SYSTEM in mingw*) /c/cygwin/bin/sh --login -c \ "rsync -a ${LOGFILE} rsync://128.238.56.50/upload/${DATE}/logs/" ;; *) rsync -a ${LOGFILE} rsync://128.238.56.50/upload/${DATE}/logs/ ;; esac # send status report if something failed completion_test=`tail -1 ${LOGFILE}` if [ "x${completion_test}" != "xSUCCESS" ]; then if [ "x${RECIPIENT}" != "x" ]; then SUBJECT="autobuild: $distro $HOSTNAME $DATE $TIME" tail -20 ${LOGFILE} | mail -s "${SUBJECT}" ${RECIPIENT} fi fi } # temporary hack to update Mac OS X Fink builds case $SYSTEM in darwin) echo "Updating Fink on Mac OS X" fink -y update-all ;; esac for dir in ${HOME}/auto-build/*; do dirname=`echo $dir | sed 's|.*/\(.*\)|\1|'` test -e $dir/scripts/auto-build/${dirname}-auto-builder.sh && \ run_build_script $dirname done # since the above test can cause this script to exit with an error, force it # to be happy to prevent getting automated error emails to root true