More options and flags.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18240 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-10-05 15:57:38 +00:00
parent 56ce987de5
commit e9e1e536ab

View File

@@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# Fetches, builds and store the result of a heimdal build # Fetches, builds and store the result of a heimdal build
# $Id$ # Version: $Id$
fetchmethod=curl #options are: wget, curl, ftp, afs fetchmethod=curl #options are: wget, curl, ftp, afs
resultdir= resultdir=
@@ -8,23 +8,31 @@ email=heimdal-build-log@it.su.se
baseurl=ftp://ftp.pdc.kth.se/pub/heimdal/src baseurl=ftp://ftp.pdc.kth.se/pub/heimdal/src
afsdir=/afs/pdc.kth.se/public/ftp/pub/heimdal/src afsdir=/afs/pdc.kth.se/public/ftp/pub/heimdal/src
keeptree=no keeptree=no
passhrase=
noemail=
# no more use configurabled part below (hopefully) # no more use configurabled part below (hopefully)
usage="[--current] [--release version] [--cvs] [--cvs-flags] [--result-directory dir] [--fetch-method method --keep-tree] [--autotools]" usage="[--current] [--release version] [--cvs SourceRepository] [--cvs-flags] [--result-directory dir] [--fetch-method wget|ftp|curl|cvs] --keep-tree] [--autotools] [--passhrase string] [--no-email]"
date=`date +%Y%m%d` date=`date +%Y%m%d`
if test "$?" != 0; then if [ "$?" != 0 ]; then
echo "have no sane date, punting" echo "have no sane date, punting"
exit 1 exit 1
fi fi
hostname=`hostname` hostname=`hostname`
if test "$?" != 0; then if [ "$?" != 0 ]; then
echo "have no sane hostname, punting" echo "have no sane hostname, punting"
exit 1 exit 1
fi fi
version=`grep "^# Version: " "$0" | cut -f2- -d:`
if [ "X${version}" = X ]; then
echo "Can not figure out what version I am"
exit 1
fi
dir= dir=
hversion= hversion=
cvsroot= cvsroot=
@@ -72,6 +80,18 @@ do
keeptree=yes keeptree=yes
shift shift
;; ;;
--passhrase)
passhrase="$2"
shift 2
;;
--no-email)
noemail="yes"
shift
;;
--version)
echo "Version: $version"
exit 0
;;
-*) -*)
echo "unknown option: $1" echo "unknown option: $1"
break break
@@ -156,14 +176,22 @@ if [ "X${resultdir}" != X ] ; then
cp ab.txt "${resultdir}/ab-${hversion}-${hostname}-${date}.txt" cp ab.txt "${resultdir}/ab-${hversion}-${hostname}-${date}.txt"
fi fi
if [ "X${email}" != X ] ; then if [ "X${noemail}" = X ] ; then
cat >> email-header <<EOF cat > email-header <<EOF
From: ${USER:-unknown-user}@${hostname} From: ${USER:-unknown-user}@${hostname}
To: <heimdal-build-log@it.su.se> To: <heimdal-build-log@it.su.se>
Subject: heimdal-build-log SPAM COOKIE Subject: heimdal-build-log SPAM COOKIE
X-heimdal-build: kaka-till-love X-heimdal-build: kaka-till-love
Version: $version
EOF EOF
if [ "X$passhrase" != X ] ; then
cat >> email-header <<EOF
autobuild-passphrase: ${passhrase}
EOF
cat email-header ab.txt | sendmail "${email}" cat email-header ab.txt | sendmail "${email}"
fi fi