mirror of
https://gitlab.com/shorewall/code.git
synced 2025-01-22 21:48:39 +01:00
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
This commit is contained in:
parent
89c1b314fe
commit
ad4baed5a0
47
tools/build/cronpublish.sh
Executable file
47
tools/build/cronpublish.sh
Executable file
@ -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
|
Loading…
Reference in New Issue
Block a user