#! /bin/sh
# postinst script for athens-jm11ml-config
#
# see: dh_installdeb(1)
#
# Copyright (C) 2009 Canonical Limited
# Author: Alberto Milone <alberto.milone@canonical.com>
#
set -e

# summary of how this script can be called:
#        * <postinst> `configure' <most-recently-configured-version>
#        * <old-postinst> `abort-upgrade' <new version>
#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
#          <new-version>
#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
#          <failed-install-package> <version> `removing'
#          <conflicting-package> <version>
# For details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
#

# At this point a diversion has been added on the xorg.conf
# and we can modify the xorg.conf directly through X-Kit
case "$1" in
    install|upgrade|configure)

    #if [ "$1" != "upgrade" ] && [ -f /usr/bin/xorgconfig.py ]; then
    # Brute force here as dexconf seems to be called twice.
    if [ -f /usr/bin/xorgconfig.py ]; then
        echo "Modifying xorg.conf through X-Kit..."
        python /usr/bin/xorgconfig.py -o /etc/X11/xorg.conf
    fi
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 0
    ;;
esac

exit 0
#DEBHELPER#

