File: check-stdlib-modules

package info (click to toggle)
ocaml 5.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 44,384 kB
  • sloc: ml: 370,196; ansic: 52,820; sh: 27,419; asm: 5,462; makefile: 3,684; python: 974; awk: 278; javascript: 273; perl: 59; fortran: 21; cs: 9
file content (32 lines) | stat: -rwxr-xr-x 978 bytes parent folder | download
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
#!/bin/sh

TMPDIR="${TMPDIR:-/tmp}"

(cd $1/stdlib; ls -1 *.mli) | sed -e 's/\.mli//' >$TMPDIR/stdlib-$$-files
cut -c 1 $TMPDIR/stdlib-$$-files | tr a-z A-Z >$TMPDIR/stdlib-$$-initials
cut -c 2- $TMPDIR/stdlib-$$-files \
| paste -d '\0' $TMPDIR/stdlib-$$-initials - >$TMPDIR/stdlib-$$-modules

exitcode=0
for i in `cat $TMPDIR/stdlib-$$-modules`; do
  case $i in
    Stdlib | Camlinternal* | *Labels | Obj ) continue;;
    Std_exit*) continue;;
  esac
  grep -q -e '"'$i'" & p\.~\\stdpageref{'$i'} &' $1/manual/src/library/stdlib-blurb.etex || {
    echo "Module $i is missing from the module description in library/stdlib-blurb.etex." >&2
    exitcode=2
  } &&
  grep -q -e '\\stddocitem{'$i'}' $1/manual/src/library/stdlib-blurb.etex || {
    echo "Module $i is missing from the linklist in library/stdlib-blurb.etex." >&2
    exitcode=2
  }
done

rm -f $TMPDIR/stdlib-$$-*

if [ $exitcode -eq 0 ]; then
  echo "All Standard Library modules are referenced"
fi

exit $exitcode