diff options
Diffstat (limited to 'scripts/auto-build/auto-build-common')
-rw-r--r-- | scripts/auto-build/auto-build-common | 44 |
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 +} |