Re: Using etcupdate resolve, was Re: Surprise null root password
- In reply to: bob prohaska : "Using etcupdate resolve, was Re: Surprise null root password"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 15 Jun 2023 17:57:26 UTC
On 15 Jun 2023, at 19:26, bob prohaska <fbsd@www.zefox.net> wrote: > > Here's an example of the puzzles faced when using etcupdate > that have so far proved baffling: > > On running etcupdate resolve, the system reports > > Resolving conflict in '/etc/mtree/BSD.tests.dist': > Select: (p) postpone, (df) diff-full, (e) edit, > (h) help for more options: df > --- /etc/mtree/BSD.tests.dist 2023-05-29 08:29:48.174762000 -0700 > +++ /var/db/etcupdate/conflicts/etc/mtree/BSD.tests.dist 2023-06-13 22:55:04.284491000 -0700 > @@ -442,6 +442,16 @@ > .. > ifconfig > .. > +<<<<<<< yours > +||||||| original > + md5 > + .. > +======= > + ipfw > + .. > + md5 > + .. > +>>>>>>> new > mdconfig > .. > nvmecontrol > Select: (p) postpone, (df) diff-full, (e) edit, > (h) help for more options: e Apparently etcupdate has concluded that you have modified BSD.tests.dist from its original version. If you know for sure that you never modified that file, it is easier to simply accept the "upstream" changes, by typing "tf" (for "theirs-full") in the Select: prompt. NOTE: NEVER do that for /etc/master.passwd and other important files in /etc, at least not without backing them up! In any case, like other three-way merging tools, it tries to piece together three parts: 1) the version of the file you actually have on disk 2) the old version from upstream 3) the new version from upstream The 1) part is displayed from "<<<<<<<" onwards, the 2) part is displayed from "|||||||" onwards, and the 3) part is displayed from "=======" until the final ">>>>>>>". As long as 1) and 2) are exactly equal, etcupdate can simply apply the diff between 2) and 3) without any problems, and you don't have to do anything However, once you start editing 1), it can not always automatically apply the diff between 2) and 3), specifically when you have edited the part(s) affected by that diff. In that case, it shows the type of prompt you listed above. Typically, a human has to look at the 'yours' (1), 'original' (2) and 'new' (3) sections, and figure out what the result should be. For example, in the above case, it seems that you deleted the "md5" and ".." lines from the BSD.tests.dist file, and since the update tries to add new "ipfw" and ".." lines just above that, it does not know what to do. If you intentionally got rid of the "md5' and ".." lines, you can remove those from the 'new' section, and leave only the 'new' section. Resulting in: .. ifconfig .. ipfw .. mdconfig .. nvmecontrol And then this particular conflict has been resolved. If you use git a lot, you get *very* familiar with this process. :-) There are also lots of third-party tools to help you graphically resolve these so-called three-way merges, see for example <https://stackoverflow.com/questions/572237/whats-the-best-three-way-merge-tool>. -Dimitry