#! /bin/sh # postinst script for cvsweb # # see: dh_installdeb(1) set -e mv_conffile() { # syntax: prep_mv_conffile $OLDCONFFILE $NEWCONFFILE # # Check to make sure the old conffile still exists on the disk. If the file # still exists, we know that there were changes to it we want to preserve # (see preinst script). We move the new conffile as unpacked by dpkg to a # file the user can compare it with if they wish and move the old conffile # into the new place. OLDCONFFILE="$1" NEWCONFFILE="$2" if [ -e "$OLDCONFFILE" ]; then echo "Preserving user changes to $NEWCONFFILE ..." mv -f "$NEWCONFFILE" "$NEWCONFFILE".dpkg-dist mv -f "$OLDCONFFILE" "$NEWCONFFILE" fi } mv_custom_conffile() { # syntax: prep_mv_conffile $OLDCONFFILE $NEWCONFFILE # # Check to make sure the custom conffile exists on the disk. We move the old # conffile into the new place. OLDCONFFILE="$1" NEWCONFFILE="$2" if [ -e "$OLDCONFFILE" ]; then echo "Preserving custom config file $NEWCONFFILE ..." mv -f "$OLDCONFFILE" "$NEWCONFFILE" 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" = configure ]; then if dpkg --compare-versions "$2" le "3:3.0.5-1"; then mv_conffile "/etc/cvsweb.conf" "/etc/cvsweb/cvsweb.conf" find /etc -maxdepth 1 -name "cvsweb.conf-*" -printf "%f\n" | while read conffile ; do mv_custom_conffile "/etc/$conffile" "/etc/cvsweb/$conffile" done fi fi exit 0