-
Notifications
You must be signed in to change notification settings - Fork 0
/
divvun2web
executable file
·69 lines (63 loc) · 2.03 KB
/
divvun2web
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
# $Id$
# This script is written by Børre Gaup <borre.gaup@uit.no> and
# Tomi Pieski <tomi.pieski@hum.uit.no>
# 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
# <just type enter to all questions>
# 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 <user>@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` <dir of forrest tree> <ssh destination>"
exit $E_BADARGS
else
build_and_copy_site $1 $2
fi
echo "Done updating giellatekno:-)!"