/[MITgcm]/mitgcm.org/scripts/bld_manual.sh
ViewVC logotype

Annotation of /mitgcm.org/scripts/bld_manual.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (hide annotations) (download) (as text)
Wed Mar 5 00:56:11 2008 UTC (16 years, 10 months ago) by jmc
Branch: MAIN
Changes since 1.2: +26 -7 lines
File MIME type: application/x-sh
keep log files in dedicated dir (instead of filling my mail box)

1 jmc 1.1 #! /usr/bin/env bash
2    
3 jmc 1.3 # $Header: /u/gcmpack/mitgcm.org/scripts/bld_manual.sh,v 1.2 2008/03/03 20:32:00 jmc Exp $
4 jmc 1.1
5     #BLDDIR='/u/u0/httpd/html/build_manual'
6     #cd $BLDDIR
7     #retval=$?
8     #if test "x$retval" != x0 ; then
9     # echo "unable to cd to '$BLDDIR' => exit"
10     # exit
11     #fi
12     echo -n "-- Start '"`basename $0`"' at : " ; date
13    
14     export CVSROOT=/u/gcmpack
15     #OUTDIR='/u/u0/httpd/html/r2_manual'
16     #- note: "mv" to relative path below is much faster than using full path above
17     OUTDIR='../r2_manual'
18 jmc 1.3 ADDRERR='jmc@ocean.mit.edu'
19 jmc 1.1
20     echo
21     echo " Removing previous directories..."
22     test -e old && rm -rf old
23     mkdir old
24     mv MITgcm manual mitgcm.org old
25     rm -rf old &
26    
27     if test -e scratch/dev_docs ; then
28     mv scratch/dev_docs "scratch/dev_docs_"`date +%Y%m%d`"_"`date +%H%M`
29     fi
30    
31     echo
32     echo "-- Download from CVS :"
33     rm -f dwn.log
34     echo -n ' MITgcm ... '
35     cvs -q co -P MITgcm > dwn.log
36     echo "=====================================" >> dwn.log
37     echo -n ', manual ... ' ;
38     cvs -q co -P manual >> dwn.log
39     echo "=====================================" >> dwn.log
40     echo -n ', mitgcm.org ...'
41     cvs -q co -P mitgcm.org >> dwn.log
42     echo -n " : done " ; date
43    
44     (
45     rm -f build.log
46     cd mitgcm.org/devel/buildweb
47 jmc 1.3 make All > ../../../build.log 2>&1
48 jmc 1.1 )
49     echo -n '-- Finish building manual at : ' ; date
50 jmc 1.3
51     newbld="dev_docs_"`date +%Y%m%d`"_"`date +%H%M`
52     if test -f scratch/dev_docs/index.html ; then
53 jmc 1.2 echo " mv scratch/dev_docs $OUTDIR/$newbld"
54 jmc 1.1 mv scratch/dev_docs $OUTDIR/$newbld
55 jmc 1.3 else
56     if test -e scratch/dev_docs ; then
57     echo " mv scratch/dev_docs scratch/$newbld"
58     mv scratch/dev_docs scratch/$newbld
59     fi
60     echo "========================================================"
61     echo "error running '"`basename $0`"' at : "`date` | tee tmp.$$
62     echo " no file 'scratch/dev_docs/index.html' !" | tee -a tmp.$$
63     echo " ==> Incomplete build" | tee -a tmp.$$
64     echo "" | tee -a tmp.$$
65     echo "-> tail -15 build.log : >->->->->->->->->->->->->" | tee -a tmp.$$
66     tail -15 build.log | tee -a tmp.$$
67     echo "<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<" | tee -a tmp.$$
68     if test "x$ADDRERR" != x ; then
69     mail -s `basename $0`' Error' $ADDRERR < tmp.$$
70     fi
71     rm -f tmp.$$
72     exit 2
73 jmc 1.1 fi
74    
75     (
76     cd $OUTDIR
77 jmc 1.3 echo "-- Install latest in dir: "`pwd`
78 jmc 1.1 test -e latest && rm -f latest
79 jmc 1.3 echo " ln -s `ls -td dev_docs* | head -1` latest"
80 jmc 1.2 ln -s `ls -td dev_docs* | head -1` latest
81 jmc 1.1 n=$(( `ls dev_docs*/index.html | wc -l` - 7 ))
82     if test $n -gt 0 ; then
83 jmc 1.2 echo -n ' remove dir: '
84     ls -t dev_docs*/index.html | sed 's/\/index.html//' | tail -"$n"
85 jmc 1.1 ls -t dev_docs*/index.html | sed 's/\/index.html//' | tail -"$n" | xargs rm -rf
86     fi
87     )
88    
89     echo -n '-- Done at : ' ; date

  ViewVC Help
Powered by ViewVC 1.1.22