#!/bin/sh
## ----------------------------------------------------------------------
## debian/postinst : postinstallation script for sharepy
## ----------------------------------------------------------------------

## ----------------------------------------------------------------------
set -e

#Configuration files for SharePy 0.2
OLD_SETTINGS_FILE=~/.sharepy/accounts
OLD_CHANNELS_FILE=~/.sharepy/channels

if [ -f $OLD_SETTINGS_FILE ]
then 
  rm $OLD_SETTINGS_FILE
  echo "Deleting old configuration file."
fi

if [ -f $OLD_CHANNELS_FILE ]
then 
  rm $OLD_CHANNELS_FILE
  echo "Deleting old configuration file."
fi

chmod +x /usr/bin/sharepy

oldversion="$2"
if [ -z "$oldversion" ]; then
  maemo-select-menu-location sharepy.desktop
  gtk-update-icon-cache -f /usr/share/icons/hicolor  
fi

exit 0
