Setting tag linux-2.6-32-27
[build.git] / vbuild-nightly.sh
index 71e6bd0..58973a9 100755 (executable)
@@ -135,7 +135,7 @@ function failure() {
        webpublish_cp_stdin_to_file $WEBBASE.ko ||:
     if [ -n "$MAILTO" ] ; then
        ( \
-           echo "Subject: Failures with $MAIL_SUBJECT $BASE on $(hostname)" ; \
+           echo "Subject: KO ${BASE} ${MAIL_SUBJECT}" ; \
            echo "To: $MAILTO" ; \
            echo "See full build log at $WEBBASE_URL/log.txt" ; \
            echo "and tail version at $WEBBASE_URL.ko" ; \
@@ -174,7 +174,7 @@ function success () {
     fi
     if [ -n "$MAILTO" ] ; then
        ( \
-           echo "Subject: Success with ${MAIL_SUBJECT} ${BASE} on $(hostname)" ; \
+           echo "Subject: PASS ${BASE} ${MAIL_SUBJECT}" ; \
            echo "To: $MAILTO" ; \
            echo "$PLDISTRO ($BASE) build for $FCDISTRO completed on $(date)" ; \
            echo "See full build log at $WEBBASE_URL/log.txt" ; \
@@ -216,6 +216,9 @@ function build () {
 
     MAKEVARS=("BASE=${BASE}" "${MAKEVARS[@]}")
 
+    # initialize latex
+    /build/latex-first-run.sh || :
+
     # stage1
     make -C /build $DRY_RUN "${MAKEVARS[@]}" stage1=true 
     # versions
@@ -407,6 +410,7 @@ function usage () {
     echo " -p personality - defaults to $DEFAULT_PERSONALITY"
     echo " -m mailto - no default"
     echo " -s build_scm_url - git or svn URL where to fetch the build module - defaults to $DEFAULT_BUILD_SCM_URL"
+    echo "    define GIT tag or branch name appending @tagname to url"
     echo " -t pldistrotags - defaults to \${PLDISTRO}-tags.mk"
     echo " -b base - defaults to $DEFAULT_BASE"
     echo "    @NAME@ replaced as appropriate"
@@ -445,14 +449,12 @@ function main () {
     PUBLISH_SRPMS=true
     SSH_KEY=""
     SIGNYUMREPO=""
-    DEFULT_BUILD_BRANCH="master"
-    BUILD_BRANCH=$DEFULT_BUILD_BRANCH
 
+    OPTS_ORIG=$@
     OPTS=$(getopt -o "f:d:p:m:s:t:b:o:c:w:W:r:M:yg:u:K:SBTnv7i:h" -l "build-branch:" -- $@)
     if [ $? != 0 ]
     then
         usage
-        echo "lala"
     fi
     eval set -- "$OPTS"
     while true; do
@@ -482,16 +484,12 @@ function main () {
            -7) BASE="$(date +%a|tr A-Z a-z)-@FCDISTRO@" ; shift ;;
            -i) IFNAME=$2; shift 2 ;;
            -h) usage ; shift ;;
-            --build-branch) BUILD_BRANCH=$2; shift 2 ;;
             --) shift; break ;;
        esac
     done
 
-       
     # preserve options for passing them again later, together with expanded base
-    declare -a options
-    toshift=$(($OPTIND - 1))
-    arg=1; while [ $arg -le $toshift ] ; do options=(${options[@]} "$1") ; shift; arg=$(($arg+1)) ; done
+    options=$OPTS_ORIG
 
     # allow var=value stuff; 
     for target in "$@" ; do
@@ -532,17 +530,19 @@ function main () {
 
     ### elaborate mail subject
     if [ -n "$DO_BUILD" -a -n "$DO_TEST" ] ; then
-       MAIL_SUBJECT="complete"
+       MAIL_SUBJECT="full"
     elif [ -n "$DO_BUILD" ] ; then
-       MAIL_SUBJECT="package-only"
+       MAIL_SUBJECT="pkg-only"
     elif [ -n "$DO_TEST" ] ; then
        MAIL_SUBJECT="test-only"
     fi
     if [ -n "$OVERBASE" ] ; then
-       MAIL_SUBJECT="$MAIL_SUBJECT incremental run on"
+       MAIL_SUBJECT="${MAIL_SUBJECT} rerun"
     else
-       MAIL_SUBJECT="$MAIL_SUBJECT fresh build"
+       MAIL_SUBJECT="${MAIL_SUBJECT} fresh"
     fi
+    short_hostname=$(hostname | cut -d. -f1)
+    MAIL_SUBJECT="on ${short_hostname} - ${MAIL_SUBJECT}"
 
     ### compute WEBHOST from TESTBUILDURL 
     # this is to avoid having to change the builds configs everywhere
@@ -642,13 +642,9 @@ function main () {
            # Extract build again - in the vserver
            [ -n "$SSH_KEY" ] && setupssh ${BASE} ${SSH_KEY}
            if echo $BUILD_SCM_URL | grep -q git ; then
-               vserver $BASE exec bash -c "git clone --branch $BUILD_BRANCH $GIT_REPO /build; cd /build; git checkout $GIT_TAG"
+               vserver $BASE exec bash -c "git clone $GIT_REPO /build; cd /build; git checkout $GIT_TAG"
            else
-                if [ "x$BUILD_BRANCH" != "x$DEFAULT_BUILD_BRANCH" ]; then
-                   vserver $BASE exec svn checkout ${BUILD_SCM_URL} /build
-                else
-                    vserver $BASE exec svn checkout ${BUILD_SCM_URL}/branches/$BUILD_BRANCH /build
-                fi
+               vserver $BASE exec svn checkout ${BUILD_SCM_URL} /build
            fi
        fi
        # install ssh key in vserver