UpdateIconCache()
{
        if [ -f /usr/bin/gtk-update-icon-cache ]
        then
                echo -n "updating hicolor icon cache..."
                if gtk-update-icon-cache -f -t /usr/share/icons/hicolor > /dev/null 2>&1 ; then
                        echo " done."
                else
                        echo " failed."
                fi
        fi
        if [ -f /usr/bin/gtk-update-icon-cache-3.0 ]
        then
                echo -n "updating hicolor icon cache gtk+3..."
                if gtk-update-icon-cache-3.0 -f -t /usr/share/icons/hicolor > /dev/null 2>&1 ; then
                        echo " done."
                else
                        echo " failed."
                fi
        fi
}

post_install()
{
	/sbin/ldconfig
        UpdateIconCache
	echo -n "loading schema glib entries... "
                glib-compile-schemas /usr/share/glib-2.0/schemas &>/dev/null
        echo "done."
}

post_upgrade()
{
        post_install $1
}

post_remove()
{
	UpdateIconCache
	echo -n "loading schema glib entries... "
                glib-compile-schemas /usr/share/glib-2.0/schemas &>/dev/null
        echo "done."
}

op=$1
shift

$op $*

# vim: ft=sh
