#!/bin/sh -e

# The clock might be wrong and we know that we need to update the icon
# cache so we just force it.

gtk-update-icon-cache -f /usr/share/icons/hicolor

oldversion="$2"
if [ -z "$oldversion" ]; then
  maemo-select-menu-location enigma.desktop
fi

# make sure that there's enough free disk space
NEED=13000
FREE=`df /media/mmc2 | grep -vE '^Filesystem' | awk '{ print $4 }'`
if [ $FREE -ge $NEED ]; then
    if maemo-confirm-text "Memory usage" /usr/share/doc/enigma/install_memcard.txt; then
	echo "Moving data files from /usr/share to /media/mmc2"
	mv /usr/share/enigma /media/mmc2
    fi
fi

exit 0
