Git init
[external/pango1.0.git] / docs / check.docs
1 #!/bin/sh
2
3 LC_ALL=C
4 export LC_ALL
5
6 if test -z "$DOC_MODULE"; then
7         # extract from Makefile
8         eval `grep '^DOC_MODULE' Makefile | sed 's/ //g'`
9         if test -z "$DOC_MODULE"; then
10                 echo Failed extracting DOC_MODULE from Makefile 1>&2
11                 echo Try setting DOC_MODULE env var manually 1>&2
12                 exit 1
13         fi
14 fi
15
16 if test -n "$REPORT_FILES"; then
17         $MAKE $REPORT_FILES || exit 1
18 fi
19
20 test -z "$srcdir" && srcdir=.
21 stat=0
22
23 if test -f "$DOC_MODULE-undeclared.txt"; then
24         undeclared=`cat "$DOC_MODULE-undeclared.txt"`
25         if test -n "$undeclared"; then
26                 echo Undeclared documentation symbols: 1>&2
27                 cat "$DOC_MODULE-undeclared.txt" 1>&2
28                 stat=1
29         fi
30 fi >&2
31 if test -f "$DOC_MODULE-unused.txt"; then
32         unused=`cat "$DOC_MODULE-unused.txt"`
33         if test -n "$unused"; then
34                 echo Unused documentated symbols: 1>&2
35                 cat "$DOC_MODULE-unused.txt" 1>&2
36                 stat=1
37         fi
38 fi >&2
39 if test -f "$DOC_MODULE-undocumented.txt"; then
40         if grep '^0 symbols incomplete' "$DOC_MODULE-undocumented.txt" >/dev/null &&
41            grep '^0 not documented'     "$DOC_MODULE-undocumented.txt" >/dev/null; then
42                 :
43         else
44                 echo Incomplete or undocumented symbols: 1>&2
45                 cat "$DOC_MODULE-undocumented.txt" 1>&2
46                 stat=1
47         fi
48 fi >&2
49
50 exit $stat