On Tue, Oct 22, 2002 at 12:08:01AM +1000, Hamish Moffatt wrote: > > Hi, > > I want to move some conffiles from one directory to another in a package > upgrade. Can I simply move it in the preinst? I suppose I will possibly > have to create the target directory too unless I pre-depend on the > package which would own it (not desirable).
This is how I do it (or better, my predecessor maintainer of the
package, but I changed that a little bit):
$ cat debian/preinst
#!/bin/sh -e
##$DEBIAN_SCRIPT_DEBUG || set -v -x
if [ "$1" = "upgrade" ] ; then
if dpkg --compare-versions "$2" lt "0.1.6-1" ; then
# move config file to new location
if [ -e /etc/masqmail.conf ]; then
if [ ! -d /etc/masqmail ]; then
mkdir /etc/masqmail
mv -f /etc/masqmail.conf /etc/masqmail/
fi
fi
fi
fi
#DEBHELPER#
Mermgfurt,
Oliver
--
debian/rules http://zork.net/~nick/srom/
msg07531/pgp00000.pgp
Description: PGP signature

