Mercurial > hg > batmud > ggrtf
changeset 779:ef7ec8837221
Improved building script.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 15 Jul 2008 12:01:13 +0000 |
parents | 4603fa1a5724 |
children | a15ca4701e5e |
files | docs/build-docs.sh |
diffstat | 1 files changed, 26 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/docs/build-docs.sh Tue Jul 15 10:40:20 2008 +0000 +++ b/docs/build-docs.sh Tue Jul 15 12:01:13 2008 +0000 @@ -33,14 +33,16 @@ if test -n "$PNMTOPS" && test -x "$PNMTOPS" && test -n "$GIFTOPNM" && test -x "$GIFTOPNM"; then echo "** NetPBM tools found" for i in *.gif; do - echo " - $i" - $GIFTOPNM "$i" | $PNMTOPS -scale=0.5 -noturn > `echo "$i" | sed "s/.gif/.eps/"` + TOUTFILE=`echo "$i" | sed "s/.gif/.eps/"` + echo " - $i -> $TOUTFILE" + $GIFTOPNM "$i" | $PNMTOPS -scale=0.5 -noturn > "$TOUTFILE" done elif test -n "$CONVERT" && test -x "$CONVERT"; then echo "** ImageMagick found" for i in *.gif; do - echo " - $i" - $CONVERT "$i" `echo "$i" | sed "s/.gif/.eps/"` + TOUTFILE=`echo "$i" | sed "s/.gif/.eps/"` + echo " - $i -> $TOUTFILE" + $CONVERT "$i" "$TOUTFILE" done else echo "*** WARNING! No supported image conversion tools found, not converting images." @@ -83,12 +85,22 @@ cp *.css *.png *.gif "$HTMLPATH" && cd "$HTMLPATH" && $XSLTPROC $XSLTPARAMS "$CATALOGS1" "../$SRCTMP" cd "$CPWD" - $XSLTPROC $XSLTPARAMS "$CATALOGS2" "$SRCTMP" > "$HTMLFILE" + if $XSLTPROC $XSLTPARAMS "$CATALOGS2" "$SRCTMP" > "$HTMLFILE"; then + echo "** Transform successful." + else + echo "*** ERROR! $XSLTPROC failed. Quitting on fatal error." + echo "*** Check $SRCTMP for errors." + exit 2 + fi echo "** Checking for HTML Tidy ..." if test -n "$TIDY" && test -x "$TIDY"; then echo "** Found, cleaning up the mess by DocBook .." - $TIDY -q -w 120 -utf8 -asxhtml -i -m $HTMLPATH/*.html "$HTMLFILE" + if $TIDY -q -w 120 -utf8 -asxhtml -i -m $HTMLPATH/*.html "$HTMLFILE"; then + echo "** Tidying process successful." + else + echo "*** ERROR! HTML tidy failed. Non-fatal error, continuing." + fi else echo "*** WARNING! HTML tidy not found! To get better HTML output," echo "*** please install HTML tidy (http://tidy.sourceforge.net/)" @@ -108,8 +120,12 @@ if test -n "$GS" && test -x "$GS" && test -e "$PSFILE"; then echo "* PDF ..." rm -f "$PDFFILE" - $GS -dSAFER -dCompatibilityLevel=1.2 -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite \ - -sOutputFile=$PDFFILE -dCompatibilityLevel=1.2 -c .setpdfwrite -f manual.ps + if $GS -dSAFER -dCompatibilityLevel=1.2 -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite \ + -sOutputFile=$PDFFILE -dCompatibilityLevel=1.2 -c .setpdfwrite -f manual.ps; then + echo "*** PDF conversion successful." + else + echo "*** ERROR! $GS failed. Non-fatal error, continuing." + fi elif test -e "$PSFILE"; then echo "*** WARNING! GhostScript does not seem to be installed." echo "*** PDF version of the manual will not be generated." @@ -126,9 +142,9 @@ elif test -n "$ELINKS" && test -x "$ELINKS"; then $ELINKS -dump "$HTMLFILE" > "$TXTFILE" elif test -n "$LYNX" && test -x "$LYNX"; then - echo "foobar" + echo "*** FIXME! lynx found, don't know how to transform." else - echo "*** No Links, ELinks or Lynx found. Not generating plaintext documentation." + echo "*** WARNING! No Links, ELinks or Lynx found. Not generating plaintext documentation." fi fi