#! /bin/sh

set -e

case "$1" in
  triggered|configure)
    if test -x @XINE_LIST@; then
      {
	sed -e '/^MimeType=/ s/=.*$/=/' </usr/share/gxine/gxine.desktop
	@XINE_LIST@
	cat /usr/share/gxine/mime.extra
      } >/var/lib/xine/gxine.desktop.new
      echo "Updated the MIME types in gxine's menu file."
      mv /var/lib/xine/gxine.desktop.new /var/lib/xine/gxine.desktop
    else
      echo "Not updating the MIME types in gxine's menu file."
    fi
    ;;
esac

#DEBHELPER#
