aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2009-03-23 20:51:08 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2009-03-23 20:51:08 +0000
commitc2bf0092b165f600d8a14f234c3270e29acafd71 (patch)
treecf7d26044a483fb945f5601b35dec8adfab5c894
parentfc154a3ffca2cbffe03ce02910372c95273d009b (diff)
- added direct mailing support for Cygwin 'email' via Windows/MinGW builds
- added network debug info - made source rsync function and reverted Cygwin rsync to be the same as the UNIX ones. This means that it doesn't try to copy symlinks anymore. svn path=/trunk/; revision=10892
-rw-r--r--scripts/auto-build/auto-build-common44
-rwxr-xr-xscripts/auto-build/pd-extended-auto-builder.sh21
-rwxr-xr-xscripts/auto-build/run-automated-builder7
3 files changed, 54 insertions, 18 deletions
diff --git a/scripts/auto-build/auto-build-common b/scripts/auto-build/auto-build-common
index 0106a69f..96ddd805 100644
--- a/scripts/auto-build/auto-build-common
+++ b/scripts/auto-build/auto-build-common
@@ -1,3 +1,4 @@
+#!/bin/sh
# these are common variables for the auto-build scripts
SYSTEM=$(uname -s | sed 'y|ABCDEFGHIJKLMNOPQRSTUVWXYZ|abcdefghijklmnopqrstuvwxyz|')
@@ -8,6 +9,8 @@ HOSTNAME=$(hostname | sed 's|\([a-zA-Z0-9-]\)\..*|\1|' | sed 'y|ABCDEFGHIJKLMNOP
# use the hostname from /etc/hostname in case we are a chroot build enviroment
if [ -e /etc/hostname ]; then
HOSTNAME=`cat /etc/hostname`
+else
+ HOSTNAME=$(hostname | sed 's|\([a-zA-Z0-9-]\)\..*|\1|' | sed 'y|ABCDEFGHIJKLMNOPQRSTUVWXYZ|abcdefghijklmnopqrstuvwxyz|')
fi
## the following creates a spam-bot that sends emails to an address that has not asked for it
@@ -32,3 +35,44 @@ else
echo "Skipping... (see ${SCRIPT_DIR}/auto-build-common for instructions)"
echo
fi
+
+# cygwin/Mingw don't have 'mail', but do have 'email' which is close enough.
+# To get around the troubles with mail servers, we'll contact the SMTP server
+# of the mailing lists directly (mail.iem.at).
+if [ -x `which email` ]; then
+ MAIL_COMMAND="email --smtp-server mail.iem.at"
+else
+ MAIL_COMMAND=mail
+fi
+
+
+#------------------------------------------------------------------------------#
+# print out ip addresses for debugging
+print_ip_address()
+{
+ echo -n "hostname: "
+ hostname
+ echo "---------------------------"
+ if [ -x /sbin/ifconfig ]; then
+ /sbin/ifconfig
+ else
+ ipconfig
+ fi
+}
+
+
+rsync_distro()
+{
+# let rsync handle the cleanup with --delete
+ DISTRO=$(basename $1)
+ echo "rsyncing $DISTRO to ${1}:"
+ RSYNC_COMMAND="rsync -a --delete rsync://128.238.56.50/distros/${DISTRO}/ ${1}/"
+ case $SYSTEM in
+ mingw*)
+ /c/cygwin/bin/sh -c "$RSYNC_COMMAND"
+ ;;
+ *)
+ echo $RSYNC_COMMAND
+ ;;
+ esac
+}
diff --git a/scripts/auto-build/pd-extended-auto-builder.sh b/scripts/auto-build/pd-extended-auto-builder.sh
index c3942819..280b4596 100755
--- a/scripts/auto-build/pd-extended-auto-builder.sh
+++ b/scripts/auto-build/pd-extended-auto-builder.sh
@@ -36,26 +36,17 @@ esac
# convert into absolute path
-## shouldn't this use the ${SCRIPT_DIR} variable rather than call an external program?
-cd $(echo $0 | sed 's|\(.*\)/.*$|\1|')/../..
-auto_build_root_dir=$(pwd)
-echo "root: $auto_build_root_dir"
-
-# let rsync handle the cleanup with --delete
-case $SYSTEM in
- mingw*)
- /c/cygwin/bin/sh -c \
- "rsync --archive --no-links --copy-links --delete rsync://128.238.56.50/distros/pd-extended/ ${auto_build_root_dir}/"
- ;;
- *)
- rsync -a --delete rsync://128.238.56.50/distros/pd-extended/ ${auto_build_root_dir}/
- ;;
-esac
+cd "${SCRIPT_DIR}/../.."
+auto_build_root_dir="$(pwd)"
+echo "build root: $auto_build_root_dir"
+rsync_distro "$auto_build_root_dir"
cd "${auto_build_root_dir}/packages/$BUILD_DIR"
make -C "${auto_build_root_dir}/packages" set_version
make test_locations
mount
+print_ip_address
+exit
make package_clean
make install && make package
diff --git a/scripts/auto-build/run-automated-builder b/scripts/auto-build/run-automated-builder
index 69eba376..6fb22dd0 100755
--- a/scripts/auto-build/run-automated-builder
+++ b/scripts/auto-build/run-automated-builder
@@ -23,8 +23,10 @@ SCRIPT=$(echo $0| sed 's|.*/\(.*\)|\1|g')
mailbody_on_failure () {
## this is a somewhat simplistic expression to detect error-lines
+ echo "last 20 errors ----------------------------------------"
cat ${LOGFILE} | grep -i "error: " | tail -20
-# tail -20 ${LOGFILE}
+ echo "last 5 lines ----------------------------------------"
+ tail -5 ${LOGFILE}
echo ""
echo "the full logfile - if it has been succesfully uploaded - can be viewed at:"
echo "http://autobuild.puredata.info/auto-build/${DATE}/logs/${LOGFILE##*/}"
@@ -61,8 +63,7 @@ run_build_script ()
if [ "x${completion_test}" != "xSUCCESS" ]; then
if [ "x${RECIPIENT}" != "x" ]; then
SUBJECT="autobuild: $distro $HOSTNAME $DATE $TIME"
- mailbody_on_failure | mail -s "${SUBJECT}" ${RECIPIENT}
- #tail -20 ${LOGFILE} | mail -s "${SUBJECT}" ${RECIPIENT}
+ mailbody_on_failure | $MAIL_COMMAND -s "${SUBJECT}" ${RECIPIENT}
fi
fi
}