#!/bin/sh
LYNX="/sw/bin/lynx"
LYNXB="/usr/local/bin/lynx"
if [ ! -x "$LYNX" ] ; then
if [ ! -x "$LYNXB" ] ; then
echo "Sorry. The HeadaerDoc regression test suite requires"
echo " lynx to be installed. You can obtain lynx from:"
echo " http://lynx.isc.org"
exit -1;
fi
LYNX="$LYNXB"
fi
HTMLTOTEXT="$LYNX -dump -nolist"
WWWPATTERN='^\[.*\] file:'
cd $1
FILES="$(find .)";
cd ..
for i in $FILES ; do
NAME="$(echo $i | sed "s/^\.\///")"
if [ -d "$1/$NAME" ] ; then
mkdir -p ./tmp/$NAME
else
if [ -f "$1/$NAME" ] ; then
mkdir -p "./tmp/$(dirname $NAME)"
cp $1/$NAME ./tmp/$NAME
$HTMLTOTEXT ./tmp/$NAME | grep -v "\(Last Updated .*\)" > ./tmp/$NAME-verified
cp $2/$NAME ./tmp/$NAME
$HTMLTOTEXT ./tmp/$NAME | grep -v "\(Last Updated .*\)" > ./tmp/$NAME-test
diff -bBdu --ignore-all-space ./tmp/$NAME-verified ./tmp/$NAME-test > ./tmp/$NAME-txtdiff
rm ./tmp/$NAME
STRING="$(cat ./tmp/$NAME-txtdiff)"
if [ "X$STRING" != "X" ] ; then
echo "Diffing $NAME"
cat "./tmp/$NAME-txtdiff"
fi
cat "./tmp/$NAME-txtdiff" >> textchanges
else
echo "Could not process file $1/NAME";
fi
fi
done