summaryrefslogtreecommitdiff
path: root/sources/potlatch/update.sh
blob: 748ff4a15ebc5fd37496e1036ffe654dcab0aee4 (plain)
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
#!/bin/sh
#
#  Taginfo source: Potlatch
#
#  update.sh DIR
#

set -e

DIR=$1

DATECMD='date +%Y-%m-%dT%H:%M:%S'

if [ "x" = "x$DIR" ]; then
    echo "Usage: update.sh DIR"
    exit 1
fi

echo "`$DATECMD` Start potlatch..."

DATABASE=$DIR/taginfo-potlatch.db

rm -f $DATABASE

echo "`$DATECMD` Updating resources..."
if [ -d $DIR/resources ]; then
    svn update $DIR/resources
else
    svn checkout http://svn.openstreetmap.org/applications/editors/potlatch2/resources $DIR/resources
fi

echo "`$DATECMD` Running init.sql..."
sqlite3 $DATABASE <../init.sql

echo "`$DATECMD` Running pre.sql..."
sqlite3 $DATABASE <pre.sql

echo "`$DATECMD` Running import..."
./import_potlatch.rb $DIR

echo "`$DATECMD` Running post.sql..."
sqlite3 $DATABASE <post.sql

echo "`$DATECMD` Done potlatch."