Pacsave, pacnew - how to manage those reasonably?

OK, after some pacnew-chaser I come to conclusion:

Pacnew files cannot be easily determined as better in overall, because of various situations:

  • confs often contain important settings for current system and pacnew are just blank, for example pssdw or groups file, that contains just root entry and none of the system users/groups, it cannot be and shouldn't be merged in any circumstances
  • sometimes we used personal settings, like setting an unstable or testing branch for pacman-mirrors so default pacnew file doesn't reflect that
  • some pacnew files indeed have new options that come from new kernel features like with TLP, so it's important to update those and yet don't update personalized blacklisted devices and some other non-standard settings that were changed (often not directly in conf but by commands or different system tools)
  • some pacnew have just updated hashed descriptions so merge all the way
  • some pacnew lack of description and are in more raw form then the current ones, so it's good to keep old ones hashed lines for better understanding what is happening in given conf
  • and some more various sitiuations

It takes lot of time and sometimes research to asses whether I should change something or not and documentation is not always clear enough. Still, such tools as pacnew-chaser and meld help tremendously in that task. Previously I compared files by opening both of them, snapping them to the sides (left and right) on another virtual desktop and look trough. As you can imagine, this is troublesome and not well effective.

However, I found some issues with pacnew-chaser. Sometimes after editing files in meld, pacnew-chaser seems to be frozen and unresponsive and I have to shut it down forcefully. It happens pretty often. Will investigate what is happening.

I have found the above command can take a very long time if you have large drives mounted in fstab, as it searches everything. It will also return hits on pacsave files in your mounted drives where your backups are stored.

I find the command below is my favourite for listing the pacnew files. Find, list, and save a log of newly created pacnew & pacsave files - (mlocate must be installed for this command to work).

sudo updatedb && locate --existing --regex "\.pac(new|save)$" > ~/Desktop/pacnew.log

no pacoring since pacman 5.0 :wink:


pacnew-chaser find pacnew (not pacsave) only in pacman database

for pn in $(LANG=C pacman -Qii|awk '/^MODIFIED/ {print $2".pacnew"}'); do
        [ -f "$pn" ] && echo "$pn"
done

pacman create a pacnew only if the file is marked modified ; the list is short so quick search

1 Like

Oh well that explains why I had it edited out originally. When I went to post it I thought I'd made a mistake and added it back. The old memory fails me too often. Good catch thanks.

I will edit it to remove the orig search.

@papajoke, I noticed that pacnew-chaser hangs after closing meld. It may take couple seconds or even a minute or more. If I opened the program from terminal, usually switching focus to terminal and focus back on the pacnew-chaser, it is unblocked, alas not always. Or maybe is that only a time depended behavior? I don't see any error outputs in terminal during that freeze. Seems like waiting is solving that freeze eventually, although it's hard to tell how long it will take this time. It's a bit weird. Do you know anything about it?

Since 2 days, pacnew-chaser have 2 modes : modal or not for load editor. too young to get good feedback...
Default mode is modal: wait (freeze) the end of the edition for only (at the present time) send destop notify if md5 files are different

for pass "no modal" , in $HOME/.config/pacnew-chaser.ini

[EDITOR]
modal=0
2 Likes

I created another alias that will open the pacnew files in Kompare to merge them.

alias pacdiff='sudo -H DIFFPROG=kompare pacdiff'

When prompted in the terminal to edit the files simply select the "View" option and it will automatically open the 2 file versions side by side in Kompare for merging.

3 Likes

All roads lead to Rome. :slight_smile:

1 Like

I use pacui with the maintanance option.
It clears up old packages from cache, checks for broken symlinks AND calls pacdiff in the end.

I see pacdiff as great way to learn about new features about the software. Like hell I am going to follow every system components release logs. So new lines in configs = new features.

If you are not merging continuously, then after years the pacnew is changed so much that merge is difficult to navigate or understand.

System worked fine that is due programmers tend to keep their software work with legacy configs just because not everyone has time to merge or even wants to do so.

They can be major changes that breaks Arch or Manjaro so I do have time for merging just to be sure system crash in not my fault but the software's.

There are plenty of configs file that sits in $HOME that are never checked towards their recent counterparts. If anyone has an Idea (before I start to code something in python) how to check differences in your local configs with their etc originals, I would be greatful.

1 Like

Cool. This is ok for now, but I guess later some kind of progress bar or any notification that it is doing something would be nice, otherwise user get confused. Now I know I can just wait knowing what it does. At first I was force shutting it down ;P.

@papajoke, could be there a way to see easily configs last modification dates in gui? This would be sometimes helpful to determine how obsolete config is and if changes are because of the age or some recent setting changes.

It looks like my fun with pacnew files, especially with pulseaudio confs fixed my everlasting vlc sound issue on my main computer. That or some recent update ;).

as you probably know, this pacui option also uses "sudo pacdiff". you do not have to use it, though. instead, you can skip all files shown by "sudo pacdiff" and manually merge them after (or before you start ) pacui's "maintain system" option.

2 Likes

This thread made me want to learn vimdiff properly (I was using Midnight Commander's compare files up to now).

So here are some shortcuts for vimdiff

vimdiff usage

]c                      jump to next change
[c                      jump to previous change
do                      get change under cursor from other pane
dp                      put change under cursor into other pane
ctrl-ww                 toggle cursor between panes
ctrl-w <left>/<right>   move cursor to left or right pane
ctrl-wr                 move current pane to other side
zr or zo                remove folds/open folded text (show identical text)
zm or zc                make folds/close folded text (hide identical text)
u                       undo last change (keep pressing to undo all changes)
ctrl-r                  redo last undo
:diffoff                turn off difference
:diffthis               turn on difference 
:e!                     reload current file, force (discard changes)
:qa                     quit all
:qa!                    quit all, force (discard changes)
:wqa                    save and quit all

Long description:
do             diffget: (o => obtain). The change under the cursor is replaced
                        by the content of the other file making them identical.
dp             diffput: puts changes under the cursor into the other file
                        making them identical (thus removing the diff).

To call vimdiff manually, assuming .pacnew file is present.

For example:
sudo vimdiff /etc/lightdm/lightdm-gtk-greeter.conf{,.pacnew}

Happy diffing~! :dolphin:

4 Likes

This is magnificent -- thank you! Have just spent the last couple of hours pacnewing my way through my several Manjaro VMs, & just now finished Tower, using your innovative method. It helped a lot. Onya!!

Oh rats, just remembered, still gotta do Lappy. No rest for the whacked... [but not in the Goodfellas sense].

Glad someone appreciated that simple but very handy line. You're very welcome.

0.9.20 is the next version? Yes
I put hook=6 in .ini ? Yes
Fixed my missing [CONF] = Yes

➜  ~ pacnew-chaser                                                                                                                       
Tconfig.programName: pacnew-chaser
Tconfig.version: 0.9.20
Tconfig.ini: /etc/pacnew-chaser.ini
Tconfig.ini: /home/mint/.config/pacnew-chaser.ini
hook pacman: 6
FormShow:6

pacnew-chaser.ini

[2018-07-02 09:00] [ALPM] upgraded pacnew-chaser (0.9.19.1-1 -> 0.9.20-3)

[BACKUP]
file=/home/mint/.local/share/pacnew-chaser/backup-config-system.tar.gz

[POSITION]
h=454
w=650
x=1227
y=545
[CONF]
hook=6

new .20 introduce

  • dates in preview diff
  • after edit, if new active file is the same as pacnew.bak, propose to remove .pacnew
  • pacman hook notify (but not fotget [CONF] :wink:)
2 Likes

Second ago I found :smiley:
Thank you very much @papajoke

Reminder, learning copy&paste without mistakes :smiley:

Thanks @papajoke! Your program became my favorite way to deal with pacnew files. I installed it on other computer but forgot to install meld. To my surprise pacnew-chaser used kompare but since it wasn't as easy to use as meld, I installed the latter and the program started using it, nice!

There are few things that I noticed:

  1. From some weird reasons we get sometimes pacnew files for passwd, group or gshadow. This is wrong on so many levels. Pacnew's are almost empty and have default root entries. Those system configs should never be merged with pacnew. In fact, pacnew don't introduce anything new. The only reasonable action here is just to delete useless and completely unnecessary pacnew's.
  2. Some files have not enough permissions and rightly so, this triggers:

Screenshot-2018-07-02-06%3A28%3A14

There should be a bit more clear info on that. At the moment it looks like a bug, but in fact it's all right, this file shouldn't be edited and pacnew is bogus anyway.

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

Forum kindly sponsored by