#!/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 # export LC_ALL=no_NO.UTF-8 FORREST_HOME=$HOME/forrest PATH=$PATH:$FORREST_HOME/bin update_trunk() { cd if ! [ -x $HOME/gtsvn ]; then svn co https://victorio.uit.no/langtech/trunk gtsvn svn co https://victorio.uit.no/biggies/trunk big else cd $HOME/gtsvn echo "*** $HOME/gtsvn this is $GTHOME***" svn up cd $HOME/big echo "*** $HOME/big this is $GTBIG ***" svn up fi } # 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 nice -n 10 forrest 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 } update_trunk build_and_copy_site \ $HOME/gtsvn/ped \ gtuit@giellatekno.uit.no:Sites/oahpa build_and_copy_site \ $HOME/gtsvn/xtdoc/gtuit \ gtuit@giellatekno.uit.no:Sites build_and_copy_site \ $HOME/gtsvn/xtdoc/dicts \ gtuit@giellatekno.uit.no:Sites/dicts echo "Done updating giellatekno:-)!"