On Jo, 25 mar 21, 04:39:53, Michael Grant wrote:
> When I apt-update, sometimes I update something for which I modified a config file and I get this menu:
>
> Configuration file '/etc/matrix-synapse/homeserver.yaml'
> ==> Modified (by you or by a script) since installation.
> ==> Package distributor has shipped an updated version.
> What would you like to do about it ? Your options are:
> Y or I : install the package maintainer's version
> N or O : keep your currently-installed version
> D : show the differences between the versions
> Z : start a shell to examine the situation
> The default action is to keep your current version.
> *** homeserver.yaml (Y/I/N/O/D/Z) [default=N]
This is provided by dpkg.
> Sometimes, rarely, I get a 5th option offering to try to merge the
> files. I don't know what causes the merge option to be available or
> not.
The package is using ucf.
> If this is a file which I indeed modified, what I inevitably end up
> doing is using the Z option, popping into a shell, then presents me 2
> variables (without $ in front of them) which give me 2 files: current
> and new.
>
> So what I do is manually echo the two variables out (putting a $ in
> front of them) and run emacs and emerge them together. This is fine,
> it's usually pretty easy.
Hmm, with vim something like 'vimdiff $current $new' should work, there
is no need to echo the variables firsts, and I would be surprised if
emacs couldn't do something similar.
> Is there some way I can at minimum add a 5th option to the above menu
> to run emacs in emerge mode with those files as args? This would save
> lazy me the steps of echoing the vars and starting emacs manually.
That would have to be implemented in dpkg and ucf.
> I run etckeeper, it would be really sweet if this was smart enough to
> attempt a 3-way merge (merge with an ancestor file).
Recently more and more packages have been adding support for
conf.d-style directories. That way you can keep your local
customizations completely separate from the default configuration and
there is no prompt from dpkg or ucf.
Kind regards,
Andrei
--
http://wiki.debian.org/FAQsFromDebianUser