2006-03-08 06:21:08 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
STYLESHEET=/usr/share/xml/docbook/stylesheet/nwalsh/current/xhtml/docbook.xsl
|
|
|
|
WEBSITE=/srv/www/html
|
2006-03-18 09:48:11 +01:00
|
|
|
PROJECTS="web docs docs-fr"
|
2006-03-08 06:21:08 +01:00
|
|
|
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
|