start building onelab distro
[build.git] / vbuild-nightly.sh
index 2f409fe..18dcb39 100755 (executable)
@@ -5,7 +5,7 @@ COMMANDPATH=$0
 COMMAND=$(basename $0)
 
 # default values, tunable with command-line options
-DEFAULT_FCDISTRO=f8
+DEFAULT_FCDISTRO=centos5
 DEFAULT_PLDISTRO=planetlab
 DEFAULT_PERSONALITY=linux32
 DEFAULT_BASE="@DATE@--@PLDISTRO@-@FCDISTRO@-@PERSONALITY@"
@@ -39,7 +39,7 @@ function summary () {
 # read a full log and tries to extract the interesting stuff
 
 import sys,re
-m_show_line=re.compile(".* BEG (RPM|VSERVER).*|.*'boot'.*|\* .*|.*is not installed.*")
+m_show_line=re.compile(".* BEG (RPM|VSERVER).*|.*'boot'.*|\* .*|.*is not installed.*|.*PROPFIND.*|.*Starting.*:runtest.*")
 m_installing_any=re.compile('\r  (Installing:[^\]]*]) ')
 m_installing_err=re.compile('\r  (Installing:[^\]]*])(..+)')
 m_installing_end=re.compile('Installed:.*')
@@ -305,14 +305,15 @@ function show_env () {
     set +x
     echo FCDISTRO=$FCDISTRO
     echo PLDISTRO=$PLDISTRO
+    echo PERSONALITY=$PERSONALITY
     echo BASE=$BASE
     echo build_SVNPATH=$build_SVNPATH
     echo MAKEVARS="${MAKEVARS[@]}"
     echo DRY_RUN="$DRY_RUN"
     echo PLDISTROTAGS="$PLDISTROTAGS"
     echo TAGSRELEASE="$TAGSRELEASE"
-    echo -n "(might be unexpanded)"
-    echo WEBPATH="$WEBPATH"
+    # this does not help, it's not yet set when we run show_env
+    #echo WEBPATH="$WEBPATH"
     echo TESTBUILDURL="$TESTBUILDURL"
     if in_root_context ; then
        echo PLDISTROTAGS="$PLDISTROTAGS"
@@ -424,17 +425,14 @@ function main () {
 
     [ -n "$DRY_RUN" ] && MAILTO=""
        
-    ### set BASE from DISTRO, if unspecified
-    sedargs="-e s,@DATE@,${DATE},g -e s,@FCDISTRO@,${FCDISTRO},g -e s,@PLDISTRO@,${PLDISTRO},g -e s,@PERSONALITY@,${PERSONALITY},g"
-    BASE=$(echo ${BASE} | sed $sedargs)
-    WEBPATH=$(echo ${WEBPATH} | sed $sedargs)
-
-    # where to store the log for web access
-    WEBLOG=${WEBPATH}/${BASE}.log.txt
-    # compute the log URL - inserted in the mail messages for convenience
-    LOG_URL=$(echo ${WEBLOG} | sed -e "s,//,/,g" -e "s,/build/,${TESTBUILDURL},")
-    TESTLOGS_URL=$(echo ${WEBPATH}/${BASE}/testlogs | sed -e "s,//,/,g" -e "s,/build/,${TESTBUILDURL},")
-    
+    if [ -n "$OVERBASE" ] ; then
+       sedargs="-e s,@DATE@,${DATE},g"
+       BASE=$(echo ${OVERBASE} | sed $sedargs)
+    else
+       sedargs="-e s,@DATE@,${DATE},g -e s,@FCDISTRO@,${FCDISTRO},g -e s,@PLDISTRO@,${PLDISTRO},g -e s,@PERSONALITY@,${PERSONALITY},g"
+       BASE=$(echo ${BASE} | sed $sedargs)
+    fi
+
     if ! in_root_context ; then
         # in the vserver
        echo "==================== Within vserver BEG $(date)"
@@ -450,7 +448,6 @@ function main () {
        
        if [ -n "$OVERBASE" ] ; then
             ### Re-use a vserver (finish an unfinished build..)
-           BASE=${OVERBASE}
            if [ ! -d /vservers/${BASE} ] ; then
                echo $COMMAND : cannot find vserver $BASE
                exit 1
@@ -472,7 +469,7 @@ function main () {
            PLDISTROTAGS=$(vserver ${BASE} exec make --no-print-directory -C /build +PLDISTROTAGS)
            build_SVNPATH=$(vserver ${BASE} exec make --no-print-directory -C /build +build-SVNPATH)
            PERSONALITY=$(vserver ${BASE} exec make --no-print-directory -C /build +PERSONALITY)
-           MAILTO=$(vserver ${BASE} execmake --no-print-directory -C /build +MAILTO)
+           MAILTO=$(vserver ${BASE} exec make --no-print-directory -C /build +MAILTO)
            show_env
        else
            # create vserver: check it does not exist yet
@@ -522,6 +519,15 @@ function main () {
        # redirect log again
        exec >> $LOG 2>&1 
 
+       sedargs="-e s,@DATE@,${DATE},g -e s,@FCDISTRO@,${FCDISTRO},g -e s,@PLDISTRO@,${PLDISTRO},g -e s,@PERSONALITY@,${PERSONALITY},g"
+       WEBPATH=$(echo ${WEBPATH} | sed $sedargs)
+
+        # where to store the log for web access
+       WEBLOG=${WEBPATH}/${BASE}.log.txt
+        # compute the log URL - inserted in the mail messages for convenience
+       LOG_URL=$(echo ${WEBLOG} | sed -e "s,//,/,g" -e "s,/build/,${TESTBUILDURL},")
+       TESTLOGS_URL=$(echo ${WEBPATH}/${BASE}/testlogs | sed -e "s,//,/,g" -e "s,/build/,${TESTBUILDURL},")
+    
        if [ -n "$DO_BUILD" ] ; then 
 
            cp $COMMANDPATH /vservers/${BASE}/build/