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. | \----------------------------------------------------------------------/
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.
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.
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.
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.
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.
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.
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.
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
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?
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,
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
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
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
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/
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!
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.
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.
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.
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.
Dear Customer, We could not deliver your item. Delivery Label is attached to this email. Sincerely, Joel Richards, Operation Manager.
Dear Customer, We could not deliver your item. Shipment Label is attached to this email. Regards, Lewis Nixon, FedEx Support Manager.
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.
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.
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.
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.
Sent from my iPhone
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
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