#!/bin/sh
# preinst script for ttf-mathematica4.1
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#        * <new-preinst> `install'
#        * <new-preinst> `install' <old-version>
#        * <new-preinst> `upgrade' <old-version>
#        * <old-preinst> `abort-upgrade' <new-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

if [ $1 = install -o $1 = upgrade ]; then

. /usr/share/debconf/confmodule
db_version 2.0
#db_capb backup

db_get ttf-mathematica4.1/accept_license
if [ "$RET" = "true" ]; then
    echo "The license has already been accepted" >&2
    exit 0
fi

#db_fset ttf-mathematica4.1/license seen false
#db_fset ttf-mathematica4.1/accept_license seen false

# confirm if user really refuses to accept
db_input critical ttf-mathematica4.1/license
db_input critical ttf-mathematica4.1/accept_license
db_go

db_get ttf-mathematica4.1/accept_license
if [ "$RET" != "true" ]; then
    # user refused to accept
    exit 2
fi

fi

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0

