documentation fix
[docutils.git] / sandbox / manpage-writer / check
blob6ebedef2d6e0d9b5d2f90e413c110e8ef2160725
1 #!/bin/sh
3 # Author: Engelbert Gruber <grubert@users.sf.net>
4 # Copyright: This module has been placed in the public domain.
6 IN_DIR=input
7 OUT_DIR=output
8 EXP_DIR=expected
10 if [ "$1" = "create" ] ; then
11 CREATE=1
14 TMPF_OUT=diff-out.tmp.$$
15 TMPF_EXP=diff-exp.tmp.$$
16 for IN_F in $IN_DIR/*.txt ; do
17 BASE=`basename $IN_F`
18 F_BASE=${BASE%.txt}
19 TMPF=$BASE.$$.diff
20 grep -v "Generated by docutils manpage writer on" $EXP_DIR/$F_BASE.man > $TMPF_EXP
21 grep -v "Generated by docutils manpage writer on" $OUT_DIR/$F_BASE.man > $TMPF_OUT
22 diff -s -u $TMPF_EXP $TMPF_OUT > $TMPF
23 if test $? -gt 0 ; then
24 echo "File: $BASE"
25 ( echo "File: $BASE" ; cat $TMPF ) | less
26 if [ "$CREATE" = "1" ] ; then
27 cp $OUT_DIR/$F_BASE.man $EXP_DIR
30 rm $TMPF
31 done
32 rm $TMPF_OUT $TMPF_EXP