Update of /cvsroot/leaf/sourceforge/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18849
Modified Files: doc-build.sh Log Message: Additional work on functions Index: doc-build.sh =================================================================== RCS file: /cvsroot/leaf/sourceforge/admin/doc-build.sh,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** doc-build.sh 19 Mar 2006 04:03:10 -0000 1.2 --- doc-build.sh 20 Mar 2006 19:50:56 -0000 1.3 *************** *** 22,32 **** #---------------------------------------- ! export_documents () { cd "$TMP_DIR" rm -rf doc cvs "$PSERVER" -q export -D "$DATE" -d doc doc ln -s "$DB_XSL"/images doc/docbook/images } build_doc () { echo building $2 --- 22,59 ---- #---------------------------------------- ! cleanup () { cd "$TMP_DIR" rm -rf doc + } + + check_errors () { + # Function. Parameter 1 is the return code + # Para. 2 is text to display on failure. + if [ "${1}" -ne "0" ]; then + echo "ERROR # ${1} : ${2}" + cleanup + rm -f $LOCKFILE + exit ${1} + fi + } + + create_lockfile () { + lockfile -r 0 $LOCKFILE + check_errors $? "Lockfile creation failed." + echo "Got lock file: $LOCKFILE" + } + + export_documents () { cvs "$PSERVER" -q export -D "$DATE" -d doc doc + check_errors $? "CVS export error." ln -s "$DB_XSL"/images doc/docbook/images } + validate_documents () { + xmllint --noout --xinclude --postvalid --noent leaf-doc-set.xml + check_errors $? "Document validation failure!" + echo "Document validation success." + } + build_doc () { echo building $2 *************** *** 46,58 **** } - create_lockfile () { - lockfile -r 0 $LOCKFILE - if [ "$?" -ne 0 ] ; then - echo "Couldn't get lockfile!" - exit 1 - fi - - echo "Got lock file: $LOCKFILE" - } #---------------------------------------- --- 73,76 ---- *************** *** 61,64 **** --- 79,83 ---- create_lockfile + cleanup echo --- *************** *** 73,77 **** echo --- echo Building Documentation ! build_doc rm -f $LOCKFILE \ No newline at end of file --- 92,96 ---- echo --- echo Building Documentation ! # build_doc rm -f $LOCKFILE \ No newline at end of file ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ leaf-cvs-commits mailing list leaf-cvs-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/leaf-cvs-commits