#32877 [CONFFILE] Cleverer conffile merge

Package:
dpkg
Source:
dpkg
Description:
Debian package management system
Submitter:
Jules Bean
Date:
2021-09-22 04:43:01 UTC
Severity:
wishlist
Tags:
#32877#5
Date:
1999-02-04 15:04:25 UTC
From:
To:
When dpkg notices that a conffile has changed, it could rather helpfully
offer the option of using the merge command.

The command-line dpkg would use is

merge <conffile>.dpkg-new <conffile>.dpkg-dist <conffile>

Which, in merge speak, means

Check (linewise) for differences between <conffile>.dpkg-dist and
<conffile>.  Apply such differences to <conffile>.dpkg-new.

Dpkg could then use merge's exit code to find out whether there were any
conflicts, and recommend that the user check the file if there were - or
better still, launch $VISUAL for the user to do it themselves.

This won't work with all config files, but would definitely enhance dpkg's
usability.

The maintainer may wish to merge this bug with #1921.  #1921 claims that
dpkg doesn't keep the whole config file around - but when I was correcting
by hand, I found a <conffile>.dpkg-dist which did exactly this, so I don't
quite know the details here.

Jules Bean

/----------------+-------------------------------+---------------------\
|  Jelibean aka  | jules@jellybean.co.uk         |  6 Evelyn Rd	       |
|  Jules aka     | jules@debian.org              |  Richmond, Surrey   |
|  Julian Bean   | jmlb2@hermes.cam.ac.uk        |  TW9 2TF *UK*       |
+----------------+-------------------------------+---------------------+
|  War doesn't demonstrate who's right... just who's left.             |
|  When privacy is outlawed... only the outlaws have privacy.          |
\----------------------------------------------------------------------/

#32877#10
Date:
2000-06-03 21:58:37 UTC
From:
To:
I was just browsing the BTS to see if a bug report such as this had
been filed.  Since it has, I'll file my suggestions as an addition to
the existing report.  I've cc'd this to the original submitter of
#32877.

First, to restate the problem so that it's clear:  when you install a
package with conffiles which have been edited, dpkg will offer to let
you use the old or the new, or see the diffs.  What is notably lacking
is an option to merge the changes.

Now, the original report suggested using the merge program.  There are
two disadvantages to that:  1. merge is part of the rcs package, so
dpkg would have to pre-depend on rcs, which I don't think we want, and
2. merge isn't always successful, and resolving the matter when it
fails is something that requires experience and skill.  Dumping a
newbie into an editor with what is, essentially, a broken and probably
unusable config file, and expecting him or her to fix it is
unreasonable.

My suggested approach is as follows:

Allow the user to specify the action to take when there is a
conflict.  If the user specifies such an action, then a M]erge choice
will appear on the dpkg menu.  If the user does not specify such an
action, no such choice will appear (the menus will remain as they are
now).

Some people might like to just use their editor (esp. those who like
emacs's interactive merge tool).  Others might want to use patch, if
they have that but not rcs's merge.  Still others might just want the
freedom of the shell (^Z will get you there, but with no easy way to
find the old and new conffiles' names).

So, say, there could be a file /etc/dpkg/mergeconf.  If it doesn't
exist (or isn't executable), dpkg would ignore it and act the way it
does at present; otherwise, dpkg would offer the M]erge choice, and,
if chosen, would call /etc/dpkg/mergeconf with the names of the
relevent files as arguments.  The contents of /etc/dpkg/mergefile
would be user-defined, but we could offer some useful examples.

#32877#15
Date:
2001-12-23 17:29:01 UTC
From:
To:
dpkg doesn't have to depend on rcs. It could recommend or suggest it,
and only offer merging the conffiles if merge is available. I don't see
the need for a configuration option. (BTW how are the diffs handled? I
don't see any package relationship to diff)

Obviously, a conffile should never be in a corrupt state, which would
probably be the case if there are conflicts, so I think the merge should
go into a new file with e.g. a .dpkg-merge suffix, where the admin can
resolve any conflicts and then move it over. The conffile itself should
be left alone or optionally replaced with the new version from the
package if the admin wishes so.

I'll probably dig into the code sooner or later, but I suspect people
who know the code could do this much quicker and better than I.

#32877#20
Date:
2001-12-23 17:41:05 UTC
From:
To:
Previously Michel D?nzer wrote:

The plan is to keep the original conffile in the dpkg database so
we can do a more useful merge actually.

Wichert.

#32877#23
Date:
2001-12-23 17:55:24 UTC
From:
To:
So this is already in the works? Great, what's the ETA? :) Please let me
know if I can be of any help. If nothing else, I'd love to test anything
in this direction.

#32877#26
Date:
2001-12-23 17:56:44 UTC
From:
To:
Previously Michel D?nzer wrote:

Probably part of dpkg 1.10, which isn't soon I'm afraid. Too much
things we want to implement and verify and too little time.

conffile merging isn't all that difficult though so it'll probably
appear in CVS in the next month or so.

Wichert.

#32877#31
Date:
2002-07-25 18:50:23 UTC
From:
To:
I agree emphathically!!

It would be great if you can merge changes in configfiles on update.
(just like 'cvs update')

And if dpkg doesn't currently save unmolested config files somewhere,
just create a copy of every config file in /var/lib/dpkg/config/<path>
when packages are installed.  (perhaps compressed)

The extra diskspace would be worth it.  Or make it optional.

#32877#56
Date:
2005-06-22 12:11:45 UTC
From:
To:
Is there any forward progress on this feature?  I really, really would
love to have this.  Munging and merging conffiles is by far the most
painful part of any upgrade for me... and most of my changes are simple
enough that a 3-way merge would handle them trivially.

#32877#77
Date:
2011-03-23 09:58:27 UTC
From:
To:
Attached patch (for dpkg-1.15.8.10) adds '--conf-merge-cmd' command line
option, which adds user's favorite configuration files merging helper to
the menu.

Usage example:

# dpkg --conf-merge-cmd='V;Diff/Merge versions with VIM;vim -d %O %N'
install package.deb

or user can drop a file in /etc/dpkg/dpkg.cfg.d to permanently add
his/her favorite merge tool:

# echo 'conf-merge-cmd V;Diff/Merge versions with VIM;vim -d %O %N' >
/etc/dpkg/dpkg.cfg.d/50merge-vim

#32877#84
Date:
2014-07-12 19:39:05 UTC
From:
To:
I applied the patch from Vasily i. Redkin to version 1.17.10 (and moved a redundant part into an own function). BTW his patch works great.  I did this in preparation for a possible threeway merge improvement. Is there still any interest in such a feature? Is there any reason why this patch was never integrated?
#32877#89
Date:
2014-08-14 07:56:55 UTC
From:
To:
Hi,

Paul Wise pointed me at http://community.libelektra.org/wp/?p=145 and
http://community.libelektra.org/wp/?p=153 which in turn brought
me back to this email.

A few comments:
1/ your mail doesn't contain any help offer to bring the patch to a
   state where it can be merged so it was not obvious that you were
   willing to invest time into improving it
2/ your mail was not very well formatted (a single line) and it's easy
   to miss it in the flow of mails
3/ you need to seek the input of Guillem Jover who is the main dpkg
   developer and who already reviewed earlier attempts to bring this
   feature
4/ yes we are interested in the feature but dpkg is an important piece of
   software and we must get it right from the start, so extra caution is
   always a good idea

With a few more researches, you could have found our wiki page
https://wiki.debian.org/Teams/Dpkg
which then links to
https://wiki.debian.org/Teams/Dpkg/Proposals/ConffileDatabase
which contains the most recent attempt to bring this feature
to Dpkg. Sean Finney was working on this but unfortunately
he lost motivation due to lack of review by Guillem. Fortunately Guillem
is much more responsive nowadays so you might have more luck
to bring it to a mergeable state.

More links in the archive:
https://lists.debian.org/debian-dpkg/2009/09/msg00065.html
https://lists.debian.org/debian-dpkg/2009/10/msg00056.html
https://lists.debian.org/debian-dpkg/2009/12/msg00041.html

(5 years old already :-()

Cheers,

#32877#94
Date:
2014-08-14 08:42:57 UTC
From:
To:
Hi,

First off, thanks for your response!

Ok,  maybe I was a bit unclear in my mail. Yes, we actually are interested in bringing
the patch to a useful state.

Sorry, you are absolutely right. I didn't realise that the bugtracker would not
reflow my mail and when I did it was too late ;).

Ok, thanks for the hint.

Thanks for the links and the information. The reason why I started with the
bug tracker was that I wanted to see whether somebody would respond in time.
I wanted to contribute these changes to Ians GSOC project, but it has a deadline.
That’s why we changed to ucf very quickly. However, I still would be happy to
have this feature in dpkg and I also will tell Ian to point to the links in his blog post.

Best regards

Felix

#32877#99
Date:
2014-08-14 08:48:27 UTC
From:
To:
I noticed the initial blogs about elektra some time ago, and was
surprised (not in a positive way) that yet another time a GSoC had
been approved w/o any kind of previous interaction with a project it
supposedly required coordination with. Had pending sending myself a
mail to the gsoc list but had other stuff to do, and pretty much lost
the motivation after those blog posts… :/

I think I've mentioned before, in any case I'm planning on getting
the conffiledb stuff ready hopefully before the freeze. Which is a
requirement for this bug being fixed.

Err, that's not what happened… it got old pretty quick when it was
obvious that the reviews were being ignored, from both me an Jonathan,
and Jonathan said as much on the list after similar claims appeared
there…

Guillem

#32877#104
Date:
2014-08-14 10:14:41 UTC
From:
To:
Hello,

Sorry, that it went this way. The blog posts were a call that anybody
interested in the topic should contact us. The only one who did contact us was
Dominique Dumont. Most of the other work (except Config::Model) starved
several years ago.

We wanted something where most of it can go upstream during (or shortly after)
GSoC. The patches w/o or little reaction till years were not really a
invitation. (But we still tried it!) Dpkg is not the only place where it may
be done and it seems there is a good reason why several workarounds exist now.

However, I think bringing dpkg conffiles to our century would be an elegant
solution. But that unfortunately it still remains to be done.

This information would have been very useful earlier. A simple merge is
already possible with the patch Felix wrote (based on an earlier patch). That
would be already quite an improvement. However, if I understand you correctly,
the reason not to accept the patch is that you want the full solution (3-way)
or nothing. I understand that.

I wanted a proposal (based on ConffileDatabase and Config::Model approach, see
https://wiki.debian.org/PackageConfigUpgrade) before the beginning of GSoC
(later I wrote one, so that we have something to work with), unfortunately Ian
did not finish nor publish it.

best regards,
Markus

#32877#109
Date:
2015-02-15 10:01:45 UTC
From:
To:
Hello

For the record, a 3-way configuration file merge is currently deployed
with lcdproc package using dh_cme_upgrade (which uses Config::Model
and cme). [1] and [4]

Implementation details are provided in [2]

This approach can be applied to other packages even if cme is not a silver
bullet: some work is required to use cme upgrade on configuration files.

A lot of work was done for lcdproc to provide a complete configuration model
that provide both upgrade and a configuration editor [3]. I believe that work
can be reduced if only configuration upgrade is desired: such a model needs
less details.

Feel free to contact me for more details.

All the best

[1] https://ddumont.wordpress.com/2014/03/23/easier-lcdproc-package-upgrade-with-automatic-configuration-merge/
[2] https://wiki.debian.org/PackageConfigUpgrade
[3] https://ddumont.wordpress.com/2011/07/03/generate-a-configuration-editor-from-a-config-template-file-with-perl-lcdproc-example/
[4] https://ddumont.wordpress.com/2014/07/06/status-and-next-step-on-lcdproc-automatic-configuration-upgrade-with-perl-and-configmodel/

#32877#114
Date:
2015-10-28 16:53:40 UTC
From:
To:
New incoming fax document.



You can find your fax document in the attachment.



Date:                Wed, 28 Oct 2015 10:12:30 +0300

Scan duration:       35 seconds

From:                Karl Bentley

File name:           fax_000817971.doc

Pages scanned:       9

File size:           171 Kb

Quality:             400 DPI



Thanks for choosing Interfax!

#32877#119
Date:
2016-08-18 04:20:17 UTC
From:
To:
Dear Customer,

This is to confirm that one or more of your parcels has been shipped.
Please, download Delivery Label attached to this email.

Yours trully,
Tony Farmer,
Sr. Support Agent.

#32877#124
Date:
2016-08-18 21:20:31 UTC
From:
To:
Dear Customer,



Your parcel has arrived at August 18. Courier was unable to deliver the parcel to you.

You can review complete details of your order in the find attached.



Sincerely,

Victor Bridges,

Support Manager.

#32877#129
Date:
2016-09-19 03:23:44 UTC
From:
To:
Dear Customer,

Courier was unable to deliver the parcel to you.
You can review complete details of your order in the find attached.

Sincerely,
Bryan Cooke,
Delivery Agent.

#32877#134
Date:
2016-09-19 21:24:41 UTC
From:
To:
Dear Customer,



Courier was unable to deliver the parcel to you.

Please, open email attachment to print shipment label.



Kind regards,

Jamie Wagner,

FedEx Station Manager.

#32877#139
Date:
2016-09-21 03:44:55 UTC
From:
To:
Dear Customer,

We could not deliver your item.
Delivery Label is attached to this email.

Sincerely,
Joel Richards,
Operation Manager.

#32877#144
Date:
2016-09-21 14:18:34 UTC
From:
To:
Dear Customer,

We could not deliver your item.
Shipment Label is attached to this email.

Regards,
Lewis Nixon,
FedEx Support Manager.

#32877#149
Date:
2016-09-22 22:18:41 UTC
From:
To:
Dear Customer,

Courier was unable to deliver the parcel to you.
You can review complete details of your order in the find attached.

Sincerely,
Maurice Davis,
Operation Manager.

#32877#154
Date:
2016-09-23 08:35:41 UTC
From:
To:
Dear Customer,

We could not deliver your parcel.
Please, open email attachment to print shipment label.

Thanks and best regards,
Albert Hendricks,
Sr. Support Manager.

#32877#159
Date:
2016-09-25 07:51:21 UTC
From:
To:
Dear Customer,

Courier was unable to deliver the parcel to you.
Shipment Label is attached to this email.

Warm regards,
Adrian Haney,
FedEx Delivery Manager.

#32877#164
Date:
2016-09-26 03:41:58 UTC
From:
To:
Dear Customer,

This is to confirm that one or more of your parcels has been shipped.
You can review complete details of your order in the find attached.

Thanks and best regards,
Armando Baldwin,
Support Manager.

#32877#169
Date:
2021-02-18 13:48:55 UTC
From:
To:
Sent from my iPhone
#32877#174
Date:
2021-09-22 04:26:56 UTC
From:
To:
Hello,

Good morning,

We have gone through your samples from a partner and Here is our  Order
List. Please do bear in mind that we are very much in  need of this
order, quote your competitive prices.

Kindly send the Order confirmation.

Your early reply will be much appreciated.

Best Regards,

Maryanah Erwin.

PT FINDORA INTERNUSA

Jln Pahlawan 66 Kec. Arjawinangun

45162 CIREBON West-Java INDONESIA

tel : +62 231 357334

fax: +62 231 357260

email: marketing@findora.com

#32877#179
Date:
2021-09-22 04:26:56 UTC
From:
To:
Hello,

Good morning,

We have gone through your samples from a partner and Here is our  Order
List. Please do bear in mind that we are very much in  need of this
order, quote your competitive prices.

Kindly send the Order confirmation.

Your early reply will be much appreciated.

Best Regards,

Maryanah Erwin.

PT FINDORA INTERNUSA

Jln Pahlawan 66 Kec. Arjawinangun

45162 CIREBON West-Java INDONESIA

tel : +62 231 357334

fax: +62 231 357260

email: marketing@findora.com