diff --git a/tools/heimdal-build.sh b/tools/heimdal-build.sh index 748596423..b5983accc 100644 --- a/tools/heimdal-build.sh +++ b/tools/heimdal-build.sh @@ -1,6 +1,6 @@ #!/bin/sh # Fetches, builds and store the result of a heimdal build -# $Id$ +# Version: $Id$ fetchmethod=curl #options are: wget, curl, ftp, afs resultdir= @@ -8,23 +8,31 @@ email=heimdal-build-log@it.su.se baseurl=ftp://ftp.pdc.kth.se/pub/heimdal/src afsdir=/afs/pdc.kth.se/public/ftp/pub/heimdal/src keeptree=no +passhrase= +noemail= # 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` -if test "$?" != 0; then +if [ "$?" != 0 ]; then echo "have no sane date, punting" exit 1 fi hostname=`hostname` -if test "$?" != 0; then +if [ "$?" != 0 ]; then echo "have no sane hostname, punting" exit 1 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= hversion= cvsroot= @@ -72,6 +80,18 @@ do keeptree=yes shift ;; + --passhrase) + passhrase="$2" + shift 2 + ;; + --no-email) + noemail="yes" + shift + ;; + --version) + echo "Version: $version" + exit 0 + ;; -*) echo "unknown option: $1" break @@ -156,14 +176,22 @@ if [ "X${resultdir}" != X ] ; then cp ab.txt "${resultdir}/ab-${hversion}-${hostname}-${date}.txt" fi -if [ "X${email}" != X ] ; then - cat >> email-header < email-header < Subject: heimdal-build-log SPAM COOKIE X-heimdal-build: kaka-till-love +Version: $version + EOF + + if [ "X$passhrase" != X ] ; then + cat >> email-header <