#!/bin/bash -e

${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2}

. /usr/share/debconf/confmodule

# Beware the user of doing something stupid.
if test -f /var/lib/mysql/debian-4.1.flag; then
  db_fset mysql-server/really_downgrade_from_41 seen false || true
  db_input high mysql-server/really_downgrade_from_41 || true
  db_go || true
  db_get mysql-server/really_downgrade_from_41 || true
  if [ "$RET" != "true" ]; then
    # Only preinst can abort the installation process but as it will
    # do so, we can skip further questions here.
    db_stop
    exit 0
  fi
fi

# Beware that there are two ypwhich one of them needs the 2>/dev/null!
if test -n "`which ypwhich 2>/dev/null`"  &&  ypwhich >/dev/null 2>&1; then
  db_input high mysql-server/nis_warning || true
  db_go
fi

# See debian/README.Maintainer.
# db_input medium mysql-server/start_on_boot || true
# db_go

db_input medium mysql-server/mysql_install_db_notes || true
db_go

# Show this only to upgraders.
if test -n "$2"  &&  dpkg --compare-versions "$2" lt "4.0.0"; then
  db_input medium mysql-server/mysql_update_hints1 || true
  db_go
fi
