#!/bin/sh
# -----------------------------------------------------------------------------
# First coded by Luca - De Whiskey's - De Vitis <luca@debian.org> on 26.09.2003
# -----------------------------------------------------------------------------
# $Id$
#
#   Copyright (C) 2003 Luca - De Whiskey's - De Vitis <luca@debian.org>
#
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program; if not, write to the Free Software
#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

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


case "$1" in
    install|upgrade)
        zopectl=/usr/sbin/zopectl
        zopectl_8=/usr/share/man/man8/zopectl
        if update-alternatives --list zopectl | grep -qs zopectl.py ; then
            update-alternatives --remove zopectl ${zopectl}.py
        fi
        if update-alternatives --list zopectl.8 | grep -qs zopectl.py.8 ; then
            update-alternatives --remove zopectl.8 ${zopectl_8}.py.8
        fi
    ;;

    abort-upgrade)
    ;;

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

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

#DEBHELPER#

exit 0
