On Tue, Jun 19, 2007 at 02:37:14PM +0200, Stefan Fritsch wrote:
> Hi,
> 
> I have a package with a config file that is created by postinst, and I 
> would like to convert this file into a conffile that is handled by dpkg.
> 
> Is there a way to achieve this in a way so that dpkg will silently replace 
> the postinst-created default version with the new conffile? I expect that 
> normally it will ask the user what to do if I just start shipping a 
> conffile.
I anticipate that you copied the config file into place from /u/share/
(not /u/s/doc/) if it doesn't exist, and if dpkg lists some relevent
version.

In this case, you can remove it in preinst if its MD5sum matches the
value of the initially copied file.  Don't touch it if it doesn't
match; this will cause the user to be prompted, as intended for a
conffile modified by both the admin and the maintainer.

You should then implement rollbacks in postrm to "unremove" the file
in case there's an error.  Actually the preinst should just mv
foo{,.old} then the postrm abort-upgrade mv foo{.old,} and the
postinst configure rm -f foo.old.

Further reading:
http://justinpryzby.com/debian/dpkg/
http://wiki.debian.org/DpkgConffileHandling

I believe UCF will also handle this (but I've never used it).

Justin


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to