From ad4baed5a05f8063e1d96d507fee5fc9f1f69669 Mon Sep 17 00:00:00 2001 From: judas_iscariote Date: Wed, 8 Mar 2006 05:21:08 +0000 Subject: [PATCH] cronpublish script updated to use SVN. TODO: testing, french docs sync too. git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@3632 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- tools/build/cronpublish.sh | 47 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 tools/build/cronpublish.sh diff --git a/tools/build/cronpublish.sh b/tools/build/cronpublish.sh new file mode 100755 index 000000000..582e2f4dc --- /dev/null +++ b/tools/build/cronpublish.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +STYLESHEET=/usr/share/xml/docbook/stylesheet/nwalsh/current/xhtml/docbook.xsl +WEBSITE=/srv/www/html +PROJECTS="web docs" +HOMEDIR=/home/judas_iscariote +SVN_BIN=/usr/bin/svn + +publish() { + case $1 in + *.xml) + b=${1%.*} + + if [ -f $WEBSITE/$b.htm ]; then + b=$b.htm + f="$WEBSITE/$b" + else + b=$b.html + f="$WEBSITE/$b" + fi + + echo "Converting $1 from XML to HTML ($b) ..." + + xmllint --valid --noout $1 && xsltproc --output $f --stringparam html.stylesheet html.css --stringparam ulink.target _self -param toc.section.depth 3 $STYLESHEET $1 + chmod g+w $f + ;; + *) + cp $1 $WEBSITE/$1 + chmod g+w $WEBSITE/$1 + ;; + esac + +} + +for project in $PROJECTS; do + cd $HOMEDIR/$project + $SVN_BIN update --non-interactive | while read UA file; do + case $UA in + U|P) + publish $file + ;; + A) + [ -d $file ] && mkdir $WEBSITE/$file || publish $file + ;; + esac + done +done