File: crossref.sh.in

package info (click to toggle)
gerris 20131206%2Bdfsg-21
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 14,252 kB
  • sloc: ansic: 66,595; sh: 15,922; f90: 1,513; makefile: 1,150; fortran: 696; python: 493; awk: 104; lisp: 89; xml: 27
file content (66 lines) | stat: -rw-r--r-- 1,120 bytes parent folder | download | duplicates (6)
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
#!/bin/sh 
# Generated automatically. Please modify crossref.sh.in.

path="@prefix@/share/gerris"

usage()
{
	cat <<EOF
Usage: crossref.sh [OPTIONS] FILE1 FILE2...

Creates cross-references

Options:
	[--url=URL] reference URL
        [--help]    displays this message and exits
EOF
	exit $1
}

if test $# -lt 1; then
	usage 1 1>&2
fi

while test $# -gt 1; do
  case "$1" in
  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  *) optarg= ;;
  esac

  case $1 in
    --url=*)
      url=$optarg
      ;;
    --help)
      usage 0 1>&2
      ;;
    --*)
      usage 0 1>&2
      ;;
      *)
      break
      ;;
  esac
  shift
done

keywords=`awk '{if ($1 == "gfs_keyword" && substr ($3,1,4) == "\"Gfs") print substr($3,2,length($3)-2); }' < $path/gfs.lang`

if test -d references; then :
else
    mkdir references
fi

for k in $keywords; do
    rm -f references/$k.html
    for f in $*; do
	gfsxref --url="$url/$f.html" $k < $f/$f.gfs >> references/$k.html
	cd $f
	for d in *; do
	    if test -d $d; then
		gfsxref --url="$url/$f.html#$d" $k < $d/$d.gfs >> ../references/$k.html
	    fi
	done
	cd ..
    done
done