Contents of /branches/ports/maemo/debian/postinst

Parent Directory Parent Directory | Revision Log Revision Log


Revision 230 - (show annotations)
Thu Jul 16 19:56:23 2009 UTC (14 years, 10 months ago) by harbaum
File size: 1526 byte(s)
Diablo/chinook demo installation fix
1 #! /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 # there are two problems with the following approach:
15 # a) diablo/chinook units don't have these env variables
16 # accessible to the app installer. We thus check for
17 # /media/mmc2 explicitely but avoid this on scratchbox
18 # b) the installation may be done by the root user which
19 # would result in an installation in roots home dir
20 # if everything else fails
21
22 # determine path to use
23 if [ "$INTERNAL_MMC_MOUNTPOINT" != "" ]; then
24 echo "MMC-PATH: INTERNAL_MMC_MOUNTPOINT env"
25 MMC_PATH=$INTERNAL_MMC_MOUNTPOINT
26 elif [ "$_SBOX_DIR" == "" ] && [ -d /media/mmc2 ]; then
27 echo "MMC-PATH: non-sbox explicit /media/mmc2"
28 MMC_PATH=/media/mmc2
29 elif [ "$HOME" != "" ]; then
30 echo "MMC-PATH: HOME env"
31 MMC_PATH=$HOME
32 else
33 echo "MMC-PATH: /tmp"
34 MMC_PATH=/tmp
35 fi
36
37 # hide directory if we are working within a users home dir
38 if [ "`echo $MMC_PATH | cut -d / -f-2`" == "/home" ]; then
39 MMC_PATH=$MMC_PATH/.osm2go
40 else
41 MMC_PATH=$MMC_PATH/osm2go
42 fi
43
44 echo "Using data location at $MMC_PATH"
45
46 if [ -d $MMC_PATH ]; then
47 echo "$MMC_PATH already exists, doing nothing."
48 else
49 echo "$MMC_PATH doesn't exist yet. Installing demo project."
50 mkdir $MMC_PATH
51 mv /usr/share/osm2go/demo $MMC_PATH
52 fi
53
54 exit 0