#!/bin/bash # $Id$ # This script is written by Børre Gaup and # Tomi Pieski # It is licensed under the GPL, version 2 or later. # # Shell script for exporting giellatekno www-pages from cvs # to the official www-directory # # To get cvs ssh working without password prompting: # Stand in the home directory of your own machine, and write: # ssh-keygen -t rsa # # chmod 0644 $HOME/.ssh/id_rsa.pub # then login to victorio, and write # mkdir $HOME/.ssh # chmod 700 $HOME/.ssh # then logout from victorio, and write # scp $HOME/.ssh/id_rsa.pub @victorio.uit.no:.ssh/authorized_keys2 # # This function takes two arguments: # The first is where it should work # The second is where it should send the built files # # This function validates and builds a forrest site, and then sends # the built files to the correct location build_and_copy_site() { BUILDDIR=$1 SVNADDRESS=$2 cd $BUILDDIR # Build the site, at the same time checking the docs forrest clean forrest validate-xdocs if [ "$?" == "0" ] then BUILDLOG=buildlog`date "+%Y-%m-%d-%H-%M"` forrest &> $BUILDLOG wc -l $BUILDLOG cd $BUILDDIR/build/site # Fix defective utf-8 characters find . -name "*.html" | LC_ALL=C xargs perl -p -i -e 's/ø/ø/g' find . -name "*.html" | LC_ALL=C xargs perl -p -i -e 's/á/á/g' find . -name "*.html" | LC_ALL=C xargs perl -p -i -e 's/ÄŒ/Č/g' find . -name "*.html" | LC_ALL=C xargs perl -p -i -e 's/Ä‘/đ/g' find . -name "*.html" | LC_ALL=C xargs perl -p -i -e 's/Ä/č/g' find . -name "*.html" | LC_ALL=C xargs perl -p -i -e 's/Å¡/š/g' find . -name "*.html" | LC_ALL=C xargs perl -p -i -e 's/Ã¥/å/g' scp -r * $SVNADDRESS/. else echo "Site build failed ..." fi } EXPECTED_ARGS=2 E_BADARGS=65 if [ $# -ne $EXPECTED_ARGS ] then echo "Usage: `basename $0` " exit $E_BADARGS else build_and_copy_site $1 $2 fi echo "Done updating giellatekno:-)!"