#! /bin/sh
# perl-5.005-base.preinst - called by dpkg before unpacking
# written by Darren Stalder (whooptidoo!)
# $Id: base.preinst,v 1.3 1999/07/06 14:41:36 torin Exp torin $
#

set -e

case "$1" in
    install|upgrade)
	dpkg --assert-support-predepends
	# finish up below
    ;;
    abort-upgrade)
	dpkg --assert-support-predepends
	exit 0
    ;;

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

if [ -z $2 ] || dpkg --compare-versions $2 lt 5.005;then

    echo "This version of Perl is using the newer Berkeley DB 2 files."
    echo "They are incompatible with the Berkeley DB 1.85 files that"
    echo "you have (probably) been using."
    echo
    echo "Please use perl-5.004 to work with these db's until you can"
    echo "convert them over."
    echo
    echo "You can use Perl-5.004 to dump these databases and reload"
    echo "them with Perl-5.005."
    echo "Or you can use db_dump185(1) and db_load(1) utilities that"
    echo "come with the libc6 package."
    echo
    echo -n "Please press enter: "
    read yorn || true

fi

exit 0

#
# end of perl-5.005-base.preinst
