[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Moving conffiles



Kilian Krause <kilian@debian.org> writes:

>> >> In this case, I'd like to move /etc/schroot.conf to
>> >> /etc/schroot/schroot.conf.
>> >
>> > mv? Alternatively cp -a&&rm.
>> 
>> Yes, but I want to properly comply with policy.  I only want to do the
>> copy on upgrade if the conffile is (a) untouched and (b) the original
>> exists.  I'm not sure this is sufficient, though, and others must have
>> needed to do this in the past.
>
> well, see the debian policy about maintainer scripts, find the place
> where you have the upgrade path as described and do as you say.

OK, I'll do something like this.  There's not much point in asking the
user, because it always needs doing.


Thanks,
Roger


if [ "$1" = "configure" ]; then
  # Move the configuration file to the new location.
  if [ -f /etc/schroot.conf ]; then
    echo "Moving /etc/schroot.conf to new location /etc/schroot/schroot.conf"
    mv /etc/schroot.conf /etc/schroot/schroot.conf
  fi
elif [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-remove" ] || [ "$1" = "abort-deconfigure" ]; then
  :
else
  echo "postinst called with unknown argument \`$1'" >&2
  exit 0
fi

-- 
Roger Leigh
                Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
                Debian GNU/Linux        http://www.debian.org/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.



Reply to: