aboutsummaryrefslogtreecommitdiff
path: root/scripts/auto-build/auto-build-common
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 /scripts/auto-build/auto-build-common
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
Diffstat (limited to 'scripts/auto-build/auto-build-common')
-rw-r--r--scripts/auto-build/auto-build-common44
1 files changed, 44 insertions, 0 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
+}