--- mitgcm.org/scripts/bld_manual.sh 2008/03/03 20:32:00 1.2 +++ mitgcm.org/scripts/bld_manual.sh 2008/03/05 00:56:11 1.3 @@ -1,6 +1,6 @@ #! /usr/bin/env bash -# $Header: /home/ubuntu/mnt/e9_copy/mitgcm.org/scripts/bld_manual.sh,v 1.2 2008/03/03 20:32:00 jmc Exp $ +# $Header: /home/ubuntu/mnt/e9_copy/mitgcm.org/scripts/bld_manual.sh,v 1.3 2008/03/05 00:56:11 jmc Exp $ #BLDDIR='/u/u0/httpd/html/build_manual' #cd $BLDDIR @@ -15,6 +15,7 @@ #OUTDIR='/u/u0/httpd/html/r2_manual' #- note: "mv" to relative path below is much faster than using full path above OUTDIR='../r2_manual' +ADDRERR='jmc@ocean.mit.edu' echo echo " Removing previous directories..." @@ -43,21 +44,39 @@ ( rm -f build.log cd mitgcm.org/devel/buildweb - make All | tee ../../../build.log + make All > ../../../build.log 2>&1 ) echo -n '-- Finish building manual at : ' ; date -if test -e scratch/dev_docs ; then - newbld="dev_docs_"`date +%Y%m%d`"_"`date +%H%M` + +newbld="dev_docs_"`date +%Y%m%d`"_"`date +%H%M` +if test -f scratch/dev_docs/index.html ; then echo " mv scratch/dev_docs $OUTDIR/$newbld" mv scratch/dev_docs $OUTDIR/$newbld +else + if test -e scratch/dev_docs ; then + echo " mv scratch/dev_docs scratch/$newbld" + mv scratch/dev_docs scratch/$newbld + fi + echo "========================================================" + echo "error running '"`basename $0`"' at : "`date` | tee tmp.$$ + echo " no file 'scratch/dev_docs/index.html' !" | tee -a tmp.$$ + echo " ==> Incomplete build" | tee -a tmp.$$ + echo "" | tee -a tmp.$$ + echo "-> tail -15 build.log : >->->->->->->->->->->->->" | tee -a tmp.$$ + tail -15 build.log | tee -a tmp.$$ + echo "<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<" | tee -a tmp.$$ + if test "x$ADDRERR" != x ; then + mail -s `basename $0`' Error' $ADDRERR < tmp.$$ + fi + rm -f tmp.$$ + exit 2 fi -#exit ( cd $OUTDIR - echo -n "-- Install latest in dir: "`pwd` + echo "-- Install latest in dir: "`pwd` test -e latest && rm -f latest - echo -n " ln -s `ls -td dev_docs* | head -1` latest" + echo " ln -s `ls -td dev_docs* | head -1` latest" ln -s `ls -td dev_docs* | head -1` latest n=$(( `ls dev_docs*/index.html | wc -l` - 7 )) if test $n -gt 0 ; then