mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-23 08:03:11 +01:00
5eec31cd75
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@7053 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
48 lines
935 B
Bash
Executable File
48 lines
935 B
Bash
Executable File
#!/bin/sh
|
|
|
|
STYLESHEET=/usr/share/xml/docbook/stylesheet/nwalsh/current/xhtml/docbook.xsl
|
|
WEBSITE=/srv/www/html
|
|
PROJECTS="web docs docs-fr"
|
|
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|G)
|
|
publish $file
|
|
;;
|
|
A)
|
|
[ -d $file ] && mkdir $WEBSITE/$file || publish $file
|
|
;;
|
|
esac
|
|
done
|
|
done
|