#!/bin/sh set -e rm_conffile() { PKGNAME="$1" CONFFILE="$2" if [ -e "$CONFFILE" ]; then md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`" old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE's/.* //p\"`" if [ "$md5sum" != "$old_md5sum" ]; then echo "Obsolete conffile $CONFFILE has been modified by you." echo "Saving as $CONFFILE.dpkg-old ..." mv -f "$CONFFILE" "$CONFFILE".dpkg-old else echo "Removing obsolete conffile $CONFFILE ..." rm -f "$CONFFILE" fi fi } # Prepare to move a conffile without triggering a dpkg question. From # http://wiki.debian.org/DpkgConffileHandling prep_mv_conffile() { local PKGNAME="$1" local CONFFILE="$2" [ -e "$CONFFILE" ] || return 0 local md5sum="$(md5sum $CONFFILE | sed -e 's/ .*//')" local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PKGNAME | \ sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")" if [ "$md5sum" = "$old_md5sum" ]; then rm -f "$CONFFILE" fi } case "$1" in install) ;; upgrade) # Remove leftover directory from LTSP5 configuration if dpkg --compare-versions "$2" le "2.11.16" ; then rm -rf /etc/ltspfs fi # Move .keytab files from /etc/debian-edu/host-keytabs to # /var/lib/debian-edu/host-keytabs before dpkg-maintscript-helper moves # the /etc/debian-edu/host-keytabs dir and replaces it by a symlink... # We have to move the .keytab files manually, because they are not owned # by debian-edu-config. if dpkg --compare-versions "$2" le "2.12.17"; then if [ -d /etc/debian-edu/host-keytabs ] && \ [ ! -h /etc/debian-edu/host-keytabs ] && \ find /etc/debian-edu/host-keytabs/* 1>/dev/null 2>/dev/null; then mkdir -p /var/lib/debian-edu/host-keytabs/ mv /etc/debian-edu/host-keytabs/*.keytab /var/lib/debian-edu/host-keytabs/ fi fi ;; esac #DEBHELPER#