Support on how to use pacdiff

Since there seems to be more than me not knowing about pacdiff and the necessity to use it,
I thought it would be good to start a new thread asking for assistance so others like me who has problems with this can read as well.

I bit of a “pacdiff for dummies” so to say.

I just got an update on my computer and using pacdiff tells me there is a change to my sudoers file.

pacdiff -o

I happen to know that I have a few lines added at the end setting nano as the default editor.

If I run pacdiff -s I get a few choices. (-s so if needed, sudo credentials can be used to edit files)

pacdiff -s 
==> pacnew file found for /etc/sudoers
:: (V)iew, (M)erge, (S)kip, (R)emove pacnew, (O)verwrite with pacnew, (Q)uit: [v/m/s/r/o/q]

I want to first see the differences so I choose v as in view.

I am no vim user, but the arrow keys lets me scroll, but not the full file even though I know its way longer, but I DO se differences in what is shown on the screen. Does that mean that those are the only changes that will be made?
The left side is called pacnew, so I’m guessing these are the changes that will be made to the old file on the right?

I can not get copy paste to work with vim, I searched for how to do it but it It seems I have to learn vim completely to do that, so you have to go with a screenshot here, sorry. (as you can see I managed to “yank” them, but cant seem to figure out how to paste them here)

The blue text I get, that gets added, but what is the brown line about?

I know I can then press :qa to exit vim and I get back to the choices in pacdiff.
Since I have changes made (even though I could not see them in pacdiff) should I just merge the file?

Please talk to me like the complete noob I am. :hearts: :hearts:

Extra question:
If I don’t do anything (ie do not run pacdiff), does that mean no changes will ever be made, because I have never done this before. :open_mouth:
And I miiiight have done a stupid thing earlier, but I have backups (timeshift snapshots), so I can revert and redo everything if needed.

It was gone over more than a few times in the announcements thread …

Many people prefer something other than vim … Meld seems to be among the most preferred, and its what I use.

So … if you have meld you probably want to set it as DIFFPROG, but if unset you can still use in a single instance as usual:

DIFFPROG=meld pacdiff -s

Meld is much more intuitive, and unlike many others (kdiff3, etc) it allows for editing in place.

As to whats being shown … maybe there is some confusion here…
All its presenting are the 2 files.
You may, depending on your utility, also edit them in that view.
pacdiff also does all of this on temporary files … it does not apply changes until you save.
(this is also noticeable if you opened without the -s flag … you will be able to view, but not save)
Besides that temp nicety they function just like having the text files open.
When you are done editing (such as by merging in new lines or removing some), save and exit.
pacdiff will prompt you for the same pacnew as it still exist.
As you have just inspected the changes and made the ones you need … you can then hit r to remove the pacnew … and move on.

Thats usually the way you would handle it.
-pacdiff opens …
-view (and edit) the respective file X and X.pacnew
-remove X.pacnew
-next prompt for Y.pacnew or exit

Ok, I kinda wanted a crashcourse of vim JUST for this small instance. :frowning:
If you don’t have access to your desktop (for meld) f ex It could be nice with a crash-course with how to use it.

You mean “V” here right?

What would be the difference between using the merge option and editing myself (except for me not actually seeing with my own eyes what is changed) if I accept all changes?

Me, and it seems quite a few more than me has never used pacdiff before the removal of the community repository, and now this.
Does that mean I have lost quite a few changes somehow or are these the first 2 in about a year because these 2 are the only ones I got prompted by.

Phew, your answer told me that I did NOT make a mistake before, since each diff should prompt me. :slight_smile:

Sorry, I dont think I am able to give a vim crash course.
This might be an OK one though:

No, Y … as in X,Y,Z … in the example you had just removed X.pacnew … and you would move on to Y.pacnew if it exists.

Merge will automatically clobber the existing file with the changes it thinks are provided by the pacnew.
This is not often desirable … and trust in it may be akin to religious preference.
Personally … I would not ever use the merge function.

If pacdiff only reports 2 pacnews(or pacsaves or pacorigs) then thats all your system has generated … save some scenario where they were removed in the interim.

I think theres only been a few I’ve noticed in 2023, but it would be hard to guess at the real number.
And of course … it is entirely system-dependent … I have modified makepkg.conf … so whenever it gets an update I am faced with a pacnew.

Yeah, I kinda figured that much, I have started that darn tutorial so many times and every time I just quit after a few minutes thinking “I do this later”, and later never comes. But I DO get that it’s not really something you can explain in a few lines, just thought I ask anyway.

Oh, I see, I thought you meant “view or quit” next file, witch is what you mean but… yeah, I get it…

Hint taken. Always manually it is.

Ok, I interpret that as they are not THAT usual unless I do changes in a crapload of configuration files on my system.

I think that covers all.

Thank you for your time!

If you still think you could expand on vim

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.