Debian Codegraph @

manual/tests/check-stdlib-modules

raw
1 #!/bin/sh
2
3 TMPDIR="${TMPDIR:-/tmp}"
4
5 (cd $1/stdlib; ls -1 *.mli) | sed -e 's/\.mli//' >$TMPDIR/stdlib-$$-files
6 cut -c 1 $TMPDIR/stdlib-$$-files | tr a-z A-Z >$TMPDIR/stdlib-$$-initials
7 cut -c 2- $TMPDIR/stdlib-$$-files \
8 | paste -d '\0' $TMPDIR/stdlib-$$-initials - >$TMPDIR/stdlib-$$-modules
9
10 exitcode=0
11 for i in `cat $TMPDIR/stdlib-$$-modules`; do
12 case $i in
13 Stdlib | Camlinternal* | *Labels | Obj ) continue;;
14 Std_exit*) continue;;
15 esac
16 grep -q -e '"'$i'" & p\.~\\stdpageref{'$i'} &' $1/manual/src/library/stdlib-blurb.etex || {
17 echo "Module $i is missing from the module description in library/stdlib-blurb.etex." >&2
18 exitcode=2
19 } &&
20 grep -q -e '\\stddocitem{'$i'}' $1/manual/src/library/stdlib-blurb.etex || {
21 echo "Module $i is missing from the linklist in library/stdlib-blurb.etex." >&2
22 exitcode=2
23 }
24 done
25
26 rm -f $TMPDIR/stdlib-$$-*
27
28 if [ $exitcode -eq 0 ]; then
29 echo "All Standard Library modules are referenced"
30 fi
31
32 exit $exitcode