#! /bin/sh # preinst script for cvsweb # # see: dh_installdeb(1) set -e prep_mv_conffile() { # syntax: prep_mv_conffile $CONFFILE # # Check to make sure the conffile exists on the disk and whether the user has # changed it or not CONFFILE="$1" if [ -e "$CONFFILE" ]; then md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`" old_md5sum="`dpkg-query -W -f='${Conffiles}' cvsweb | grep $CONFFILE | awk '{print $2}'`" if [ "$md5sum" = "$old_md5sum" ]; then rm -f "$CONFFILE" fi fi } # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. # check for cvsweb.conf* files and move them to /etc/cvsweb. if [ "$1" = install ] || [ "$1" = upgrade ]; then if dpkg --compare-versions "$2" le "3:3.0.5-1"; then prep_mv_conffile "/etc/cvsweb.conf" fi fi exit 0