File: generate.sh

package info (click to toggle)
mcvs 1.0.13-17
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 676 kB
  • ctags: 648
  • sloc: lisp: 5,091; ansic: 223; sh: 190; makefile: 58
file content (41 lines) | stat: -rwxr-xr-x 662 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh

function need_to_build_index ()
{
  ! cmp -s $1.idx $1.idx.old ||
    [ ! $1.ist -ot $1.ind ]
}

function need_to_build_dvi ()
{
   ! cmp -s $1.toc $1.toc.old ||
     [ ! $1.latex -ot $1.dvi ] ||
     [ ! $1.ind -ot $1.dvi ]
}

function build_index ()
{
  cp $1.idx $1.idx.old
  makeindex -s $1.ist $1.idx
}

function build_dvi ()
{
  cp $1.toc $1.toc.old
  latex $1.latex
}

LATEXDOC=meta-cvs

while true ; do
  if need_to_build_dvi $LATEXDOC ; then
    build_dvi $LATEXDOC
    if need_to_build_index $LATEXDOC ; then
      build_index $LATEXDOC
    fi
  elif need_to_build_index $LATEXDOC ; then
    build_index $LATEXDOC
  else
    break
  fi
done