tex_t4ht.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #! /bin/sh
  2. LC_ALL=C; export LC_ALL
  3. basename=tex_t4ht
  4. diffs_dir=diffs
  5. logfile=$basename.log
  6. stdout_file=$basename.out
  7. [ "z$srcdir" = 'z' ] && srcdir=.
  8. if which httexi > /dev/null 2>&1; then
  9. :
  10. else
  11. exit 77
  12. fi
  13. [ -d $diffs_dir ] || mkdir $diffs_dir
  14. echo "$basename" > $logfile
  15. : > $stdout_file
  16. if tmp_dir=`mktemp -p /tmp -d l2h_t2h_XXXXXXXX`; then
  17. :
  18. else
  19. exit 1
  20. fi
  21. [ -d $basename ] && rm -rf $basename
  22. mkdir $basename
  23. echo "perl -w -x $srcdir/../../texi2html.pl --set-init-var 'TEST 1' --set-init-var 'L2H_TMP $tmp_dir' --conf-dir $srcdir/../../maintained_extra --init-file tex4ht.pm --expand tex --out $basename/ $srcdir/../manuals/mini_ker.texi $srcdir/../formatting/tex.texi >> $stdout_file 2>$basename/${basename}.2" >> $logfile
  24. perl -w -x $srcdir/../../texi2html.pl --set-init-var 'TEST 1' --set-init-var "L2H_TMP $tmp_dir" --conf-dir $srcdir/../../maintained_extra --init tex4ht.pm --expand tex --out $basename/ $srcdir/../manuals/mini_ker.texi $srcdir/../formatting/tex.texi >> $stdout_file 2>$basename/${basename}.2
  25. return_code=0
  26. ret=$?
  27. if [ $ret != 0 ]; then
  28. echo "F: $basename/$basename.2"
  29. return_code=1
  30. else
  31. rm -f $basename/*_tex4ht_*.log \
  32. $basename/*_tex4ht_*.idv $basename/*_tex4ht_*.dvi \
  33. $basename/*_tex4ht_tex.html $basename/*.png
  34. for dir in ${basename}; do
  35. if [ -d $srcdir/${dir}_res ]; then
  36. diff -u --exclude=CVS --exclude=.svn --exclude='*.png' -r "$srcdir/${dir}_res" "${dir}" 2>>$logfile > "$diffs_dir/$dir.diff"
  37. dif_ret=$?
  38. if [ $dif_ret != 0 ]; then
  39. echo "D: $diffs_dir/$dir.diff"
  40. return_code=1
  41. else
  42. rm "$diffs_dir/$dir.diff"
  43. fi
  44. else
  45. echo "no res: ${dir}_res"
  46. fi
  47. done
  48. fi
  49. rm -rf $tmp_dir
  50. exit $return_code