scripts/server-services/repodoc/make-doc
author alpar
Thu, 23 Oct 2008 16:49:06 +0000
changeset 2626 324cfbf66a12
parent 2403 b8f65d8528e1
permissions -rw-r--r--
Adapt the doc generation to the hg repo
alpar@2320
     1
#!/bin/bash
alpar@2320
     2
alpar@2322
     3
(
alpar@2403
     4
    export PATH=/usr/local/bin:$PATH
alpar@2626
     5
    REPOSITORY=http://lemon.cs.elte.hu/hg/lemon/
alpar@2626
     6
    WORKINGCOPY=lemon
alpar@2320
     7
alpar@2322
     8
    ROOT=$PWD
alpar@2322
     9
    LASTREV_FILE=$ROOT/last-rev
alpar@2322
    10
    LASTREV=`cat $LASTREV_FILE`
alpar@2626
    11
alpar@2626
    12
    cd $WORKINGCOPY
alpar@2626
    13
    hg pull
alpar@2626
    14
    hg update
alpar@2626
    15
alpar@2626
    16
    REV=`hg id -n`
alpar@2626
    17
alpar@2322
    18
    if [ $# -eq 0 ]; then
alpar@2626
    19
        if [ $LASTREV -lt $REV ]; then
alpar@2626
    20
            # Delete autom4te.cache in order to get configure regenerated 
alpar@2626
    21
            # and the new revision number propagated into it.
alpar@2626
    22
            rm -rf autom4te.cache
alpar@2626
    23
            rm -rf doc/html
alpar@2626
    24
            autoreconf -vi
alpar@2626
    25
            ./configure
alpar@2626
    26
            make html
alpar@2626
    27
            cd ..
alpar@2626
    28
            rm -rf latest-doc
alpar@2626
    29
            cp -r $WORKINGCOPY/doc/html latest-doc
alpar@2626
    30
            echo $REV >$LASTREV_FILE
alpar@2626
    31
        fi
alpar@2626
    32
alpar@2322
    33
    elif [ $1 = '--help' ]; then
alpar@2626
    34
        echo 'Usage:'
alpar@2626
    35
        echo '   make-doc --init'
alpar@2626
    36
        echo '   make-doc --help'
alpar@2626
    37
        echo '   make-doc'
alpar@2626
    38
        exit 1
alpar@2322
    39
    elif [ $1 = '--init' ]; then
alpar@2626
    40
        rm -rf $WORKINGCOPY
alpar@2626
    41
        hg clone $REPOSITORY $WORKINGCOPY
alpar@2626
    42
        echo '0' >$LASTREV_FILE
alpar@2626
    43
        exit 0
alpar@2320
    44
    fi
alpar@2322
    45
 ) >/dev/null 2>&1