#!/bin/sh

set -e

[ -n "${DEBUG}" ] && set -o xtrace
PACKAGE=::package::
[ -n "${DEBUG}" ] && echo "PostInst Parameters: $@"

case $1 in
  configure)
      # Attempt to run the database upgrade script with default
      # settings, but ignore any possible failure.
      /usr/share/davical/dba/update-davical-database > /var/log/davical-upgrade.log 2>&1 || true
    ;;
esac

dpkg-maintscript-helper rm_conffile /etc/davical/.keep/keepme 1.1.4-1~ davical -- "$@"

#DEBHELPER#

# remove leftover /etc/davical/.keep directory, if empty (cf. #584185)
[ -d /etc/davical/.keep ] && rmdir --ignore-fail-on-non-empty /etc/davical/.keep

exit 0
