* Guillem Jover: " Re: Bug#767003: dpkg-maintscript-helper: mv_conffile fails, if new conffile does not exist" (Mon, 27 Oct 2014 16:35:20 +0100):
> Control: severity -1 wishlist > > Hi! > > On Mon, 2014-10-27 at 15:33:24 +0100, Mathias Behrle wrote: > > Package: dpkg > > Version: 1.17.13 > > Severity: important > > Tags: patch > > > with the package tryton-server I am encountering the following scenario: > > - the upstream package does no more include a configuration file for the > > server > > - the server now needs an additional logging configuration file > > > > To handle this I took the following steps: > > - created the two needed configuration files and installed them to > > /etc/tryton/ (the new configuration directory) > > - to keep the the old configuration file (/etc/trytond.conf) for the > > information of the user, I wanted to move it to the new configuration > > directory with > > mv_conffile /etc/trytond.conf /etc/tryton/trytond.conf.pre34 > > > This resulted in an upgrade error: > > > > Entpacken von tryton-server (3.4.0-1) über (3.2.3-1) ... > > tryton-server (3.4.0-1) wird eingerichtet ... > > Neue Version der Konfigurationsdatei /etc/init.d/tryton-server wird > > installiert ... > > Neue Version der Konfigurationsdatei /etc/default/tryton-server wird > > installiert ... > > Preserving user changes to /etc/tryton/trytond.conf.pre34 (renamed from > > /etc/trytond.conf)... > > mv: der Aufruf von stat für „/etc/tryton/trytond.conf.pre34“ ist nicht > > möglich: Datei oder Verzeichnis nicht gefunden > > ... > > > > The error is caused in finish_mv_conffile, where $NEWCONFFILE is > > expected to exist, which is not the case here. > > Right, because that's part of the invariant of moving a conffile. Here > we have a conffile that stopped being provided, and which gets renamed > for the user convenience. So why not just move the conffile manually? Whenever possible, I am trying to use generic tools instead of doing things manually. But you are right, I will just take this way. > The dpkg-maintscript-helper is here to help deal with modified conffiles > and to get a proper prompt, but that's not required here. > > > The attached patch solves the problem for me. > > > > Thanks for applying ASAP, > > Thanks for the patch! Although I don't see this being accepted for > jessie anyway, and because it's using an interface for something else > it was designed for, I'm not sure if it makes sense to support. But as > the patch is really trivial, I'm open to be convinced otherwise. I think, it makes sense, because the man page [1] at least for me gave the impression, that dpkg-maintscript-helper is a universal tool to rename a config file. Since the check really doesn't hurt and makes dpkg-maintsript-helper this more universal tool, I would propose to include the patch. Cheers, Mathias [1] http://man.cx/dpkg-maintscript-helper -- Mathias Behrle PGP/GnuPG key availabable from any keyserver, ID: 0x8405BBF6
signature.asc
Description: PGP signature