Parent Directory | Revision Log
Moved debian tree into trunk
1 | harbaum | 335 | #! /bin/sh |
2 | |||
3 | # Do we need to run this with -f ? The clock might be wrong, | ||
4 | # but forcing it slows the install... | ||
5 | gtk-update-icon-cache -f /usr/share/icons/hicolor | ||
6 | |||
7 | oldversion="$2" | ||
8 | if [ -z "$oldversion" ]; then | ||
9 | if [ -f /usr/bin/maemo-select-menu-location ]; then | ||
10 | maemo-select-menu-location osm2go.desktop | ||
11 | fi | ||
12 | fi | ||
13 | |||
14 | # determine path to use. Since the environment variables | ||
15 | # (INTERNAL_MMC_MOUNTPOINT etc) are too unreliable, we | ||
16 | # search for mountpoints ourselves | ||
17 | if [ "`mount | grep /home/user/MyDocs`" != "" ]; then | ||
18 | echo "MMC-PATH: mount /home/user/MyDocs" | ||
19 | MMC_PATH=/home/user/MyDocs | ||
20 | elif [ "`mount | grep /media/mmc2`" != "" ]; then | ||
21 | echo "MMC-PATH: mount /media/mmc2" | ||
22 | MMC_PATH=/media/mmc2 | ||
23 | elif [ "$HOME" != "" ]; then | ||
24 | echo "MMC-PATH: HOME env" | ||
25 | MMC_PATH=$HOME | ||
26 | else | ||
27 | echo "MMC-PATH: /tmp" | ||
28 | MMC_PATH=/tmp | ||
29 | fi | ||
30 | |||
31 | # hide directory if we are working within a users home dir | ||
32 | if [ "`echo $MMC_PATH | cut -d / -f-2`" == "/home" ]; then | ||
33 | MMC_PATH=$MMC_PATH/.osm2go | ||
34 | else | ||
35 | MMC_PATH=$MMC_PATH/osm2go | ||
36 | fi | ||
37 | |||
38 | echo "Using data location at $MMC_PATH" | ||
39 | |||
40 | if [ -d $MMC_PATH ]; then | ||
41 | echo "$MMC_PATH already exists, doing nothing." | ||
42 | else | ||
43 | echo "$MMC_PATH doesn't exist yet. Installing demo project." | ||
44 | mkdir $MMC_PATH | ||
45 | if [ -d /usr/share/osm2go/demo ]; then | ||
46 | mv /usr/share/osm2go/demo $MMC_PATH | ||
47 | elif [ -d /opt/osm2go/demo ]; then | ||
48 | mv /opt/osm2go/demo $MMC_PATH | ||
49 | else | ||
50 | echo "Cannot find demo project!" | ||
51 | fi | ||
52 | fi | ||
53 | |||
54 | exit 0 |