File: check_fp

package info (click to toggle)
gprolog 1.2.18-12
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 6,336 kB
  • ctags: 6,208
  • sloc: ansic: 47,851; perl: 17,497; makefile: 1,136; sh: 564
file content (69 lines) | stat: -rwxr-xr-x 839 bytes parent folder | download | duplicates (3)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/sh

# Daniel Diaz 
# Manual fix-point checker
#
# Usage: check_fp dvi/pdf prefix [ verbose ]
#
#    dvi/pdf:  dvi to use latex, pdf to use pdflatex
#    prefix:   LaTeX file name prefix
#    verbose:  0 no, 1 yes

verbose_msg ()

{
 test $verbose = 1 && echo $*
}



differ ()

{
 if diff $1 $2  >/dev/null 2>&1
 then
    false
 else
    true
 fi
}


copy ()

{
 f=$1.$2
 fp=$f.fp

 if test ! -f $f; then
    verbose_msg "$f does not exist - rebuild (rm $res)"
    rm -f $res
    return
 fi

 if test ! -f $fp || `differ $f $fp`; then
    verbose_msg "$f and $fp differ - rebuild (rm $res)"
    cp $f $fp
    rm -f $res
    return
 fi

 verbose_msg $f and $fp are identical
}

type=$1
base=$2
verbose=${3:-0}

if test $1 = pdf; then
    res=$base.pdf
else
    res=$base.dvi
fi

copy $base aux
copy $base toc
copy $base idx

exit 0