scripts/server-services/repodoc/make-doc
changeset 2634 e98bbe64cca4
parent 2403 b8f65d8528e1
equal deleted inserted replaced
2:20fc3cfdce2c 3:3ecb2596dc5a
     1 #!/bin/bash
     1 #!/bin/bash
     2 
     2 
     3 (
     3 (
     4     export PATH=/usr/local/bin:$PATH
     4     export PATH=/usr/local/bin:$PATH
     5     REPOSITORY=https://lemon.cs.elte.hu/svn/lemon/trunk
     5     REPOSITORY=http://lemon.cs.elte.hu/hg/lemon/
     6     WORKINGCOPY=trunk
     6     WORKINGCOPY=lemon
     7 
     7 
     8     ROOT=$PWD
     8     ROOT=$PWD
     9     LASTREV_FILE=$ROOT/last-rev
     9     LASTREV_FILE=$ROOT/last-rev
    10     LASTREV=`cat $LASTREV_FILE`
    10     LASTREV=`cat $LASTREV_FILE`
    11     
    11 
    12     svn up $WORKINGCOPY
    12     cd $WORKINGCOPY
    13     
    13     hg pull
    14     REV=`svn info $WORKINGCOPY|grep 'Revision:'|cut -f 2 -d ' '`
    14     hg update
    15     LOGFILE=${ROOT}/logs/${REV}.log
    15 
    16     
    16     REV=`hg id -n`
    17     function make-dir () {
    17 
    18 	if [ ! -d $1 ]; then
       
    19 	    mkdir $1
       
    20 	fi
       
    21     }
       
    22     
       
    23     
       
    24     if [ $# -eq 0 ]; then
    18     if [ $# -eq 0 ]; then
    25 #     echo $LASTREV $REV
    19         if [ $LASTREV -lt $REV ]; then
    26 	    if [ $LASTREV -lt $REV ]; then
    20             # Delete autom4te.cache in order to get configure regenerated 
    27 		cd $WORKINGCOPY
    21             # and the new revision number propagated into it.
    28 		autoreconf -vi
    22             rm -rf autom4te.cache
    29 		./configure
    23             rm -rf doc/html
    30 		make doc
    24             autoreconf -vi
    31 		cd ..
    25             ./configure
    32 		rm -rf latest-doc
    26             make html
    33 		cp -r $WORKINGCOPY/doc/html latest-doc
    27             cd ..
    34 		echo $REV >$LASTREV_FILE
    28             rm -rf latest-doc
    35 	    fi
    29             cp -r $WORKINGCOPY/doc/html latest-doc
    36 	    
    30             echo $REV >$LASTREV_FILE
       
    31         fi
       
    32 
    37     elif [ $1 = '--help' ]; then
    33     elif [ $1 = '--help' ]; then
    38 	echo 'Usage:'
    34         echo 'Usage:'
    39 	echo '   doxymake --init'
    35         echo '   make-doc --init'
    40 	echo '   doxymake --help'
    36         echo '   make-doc --help'
    41 	echo '   doxymake'
    37         echo '   make-doc'
    42 	exit 1
    38         exit 1
    43     elif [ $1 = '--init' ]; then
    39     elif [ $1 = '--init' ]; then
    44 	make-dir logs
    40         rm -rf $WORKINGCOPY
    45 	rm -rf $WORKINGCOPY
    41         hg clone $REPOSITORY $WORKINGCOPY
    46 	svn co $REPOSITORY $WORKINGCOPY
    42         echo '0' >$LASTREV_FILE
    47 	echo '0' >$LASTREV_FILE
    43         exit 0
    48 	exit 0
       
    49     fi
    44     fi
    50  ) >/dev/null 2>&1
    45  ) >/dev/null 2>&1