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

Re: converted config file ?



In article <[🔎] 19981205151735.B3848@lathspell.westend.com>, Christian Hammers <ch@lathspell.westend.com> writes:
> Hi !  I have a problem with my wwwoffle package: it has a config
> file /etc/wwwoffle.conf.  When installing I try to convert existing
> config files with a shipped config file converter and only if that
> fails because it is the first install of wwwoffle, I copy the
> example conf file from the /usr/doc.

> The problem is now, that I have mark the /etc/wwwoffle.conf as
> "configfile" in the ...../debian/conffiles file. But when building,
> dpkg complains that the named conffile is not there, what is quit
> right, since while shipping, the file isn't in /etc, but in
> /usr/doc...

> What should I do now ?  simply let dpkg handle the
> overwriting/not-installing of the config file and mark the file in
> debian/conffiles or did not mark it in debian/conffiles and let
> postinst handle the file.

> Both will earn me some bug reports :-)

Ain't that the truth ;).

Well, I would just ship your new conffile in the std location,
/etc/wwwoffle.conf or whatever, and not bother with this /usr/doc
stuff.  In the preinst, before that file is replaced, check if there's
an old-style configfile and if so, copy it to a safe location (i.e.,
/etc/wwwoffle.conf.old-style).  Then, in the postinst, check for this
old-style config file in /etc/wwwoffle.conf.old-style or whatever, and
(maybe interactively, maybe automatically) deal with that in a
reasonable way.

Most package maintainers actually don't manage to automatically
convert conffiles from old styles to new ones; it's a pain and has
hidden pitfalls.  Consider the problem of package downgrade then
upgrade again.  Can be tricky stuff.

--
.....Adam Di Carlo....adam@onShore.com.....<URL:http://www.onShore.com/>


Reply to: