When I run pacdiff, I would typically do the following:
Run it with “sudo pacdiff”
View the differences with “V”. This opens the current file and the pacnew file with vimdiff
Usually, merge the differences with “M”. This opens the results of the merge (I think?) with vimdiff
Accept or reject the merge
Repeat with the next pacnew file
This is really just a very small question, and forgive me if it is stupid, but I’m simply unsure: after merging, the app opens two files. The first file is the actual file, and the second is /tmp/pacdiff*/*.merged.cak
Which one is the actual merged file? Which is the one i should be inspecting?
Also, am I doing it right? Is there a better way of doing things with pacdiff?
The correct approach is to use pacdiff -s which will call sudo -e as needed.
This can be controlled via the env var DIFFPROG. ex;
DIFFPROG=meld pacdiff -s
Use the merge function at your own risk.
Usually folks perform the ‘merges’ by hand during the (V)iew portion.
[ If the whole thing could be automatic … why would we have the pacnew? ]
The file you need to be affecting is the regular one without extra extensions.
If its /etc/nsswitch.conf and nsswitch.conf.pacnew or similar … the nsswitch.conf is the active file and the pacnew file is the one with ostensibly new defaults from upstream for you to inspect and merge as needed.
Well I’m used to doing git merges and resolving conflicts if there are any, so I assume that the merge here works in the same way. Indeed after using merge, I do sometimes get merge conflicts (you’d see <<<<, ==== and >>> in the merge file, which you’ll need to modify), and this is a good thing that I expect.
What confused me though is that sometimes I would a merge, and the result of the merge is not what I expected. Before doing the merge, I look at the differences, and the pacnew file would specify something that would clearly result in a merge conflict, which I expect to occur. But after using the merge command, I woudl see that the config file remained the same as before, without any conflicts. So I feel like I’m doing something wrong, or I understood the command in the wrong way.
As mentioned elsewhere;
It is rather odd for this script to use pacdiff to print the files, but not use pacdiff -s (and therefor sudo -e) … as well as actively skip pacsave files.
For these reasons I would not generally recommend it.