In the light of the latest events became clear, that a change in the conf files, respectively the generation of .pacnew files, is something that happens relatively rare, but when it happens is either overlooked from or confuses the less experienced users.
How about you automate the process a little bit? This can be integrated in MSM Notifier for example. Just like the check for new kernel or translation, it can periodically check for pacnew/old files. Then it can display a message for 2 cases.
Case 1: The user has a default old file.
In that case some function hashes the old file, compares with a databases with a default old file and if it sees the old one was a default file without any user customisation, asks the user it he wants to overwrite with the new one and for his sudo password and does it.
Case 2: The user has some customisation
Either just notify the user to deal with it, maybe showing a link to a tutorial, or automatically install a gui diff editor like meld and open it for inspection.
I see something similar here, with bash, but integrating into MSN or MSM gui will be another level.
Well then maybe hook/pacdiff and a popup at the end of the transaction in pamac, where the user can easily miss the creation of pacnew if not looking at the log: âThere are new versions of some configuration files, please inspect and merge/overwrite. For more info see this wiki page.â
Somewhere and sometime I found this tutorial here and copied it out. I would very much like to pay my respects to the person and name the source, but I didnât make a note of it:
This tutorial will teach you how to create a pacman hook to never miss any .pacnew files after an update.
Just create two files:
Create a script that weâll call later with the pacman hook, weâll name it `check-pacnew` and create it in `/etc/pacman.d/scripts/` with your favorite editor:
#!/bin/bash
#
# List .pacnew files when found
pacnews=($(/usr/bin/pacdiff --output|grep -v pacsave))
nb="${#pacnews[@]}"
if [[ $nb > 0 ]]; then
echo -e "\e[1;31m$nb .pacnew found in system \e[0m"
printf "%s\n" "${pacnews[@]}"
fi
Ensure /etc/pacman.d/scripts/check-pacnew is owned by root and is executable!
The actual pacman hook, will be named check-pacnew.hook and should be created in /etc/pacman.d/hooks/:
[Trigger]
Operation = Upgrade
Type = Package
Target = *
[Action]
Description = Looking for .pacnew files...
Exec = /etc/pacman.d/scripts/check-pacnew
When = PostTransaction
NeedsTargets
Thatâs it!
Thanks to the author unknown to me!
Edit: OK, @omano was the originator ⌠Thanks to him!
Would be the best and easiest solution I think. Otherwise, as recent events have shown, users who update via pamac gui may never learn that they need to deal with these files until something breaks.
Because the answer to your question was under your post
I didnât âthumb downâ your post, but I âindexedâ the post under yours
Unfortunately may be true, but what is more unfortunate is people installing Arch based distribution not understanding these derivative distributions, like Arch itself, require at least basic maintenance, which everything is explained in the WIKI, but also unfortunate these people will never open a WIKI until they are told to.
Exactly my point. The users using pamac. Which is every new user of the distro, until they become more advanced users. They should get some help to notice something is there to be handled.
Thanks to this and the other linked topics where there are many similar scripts to find, i made my own flavour. It checks 30 seconds after boot and notifies with popup if there are pacdiff files. Does not do anything alone (because that is how i like it, only a notification if i have forgot something).
#!/usr/bin/env bash
#
# pacnew checker
#
sleep 30
#check if libnotify is available
if ! [[ "$(which notify-send)" =~ (notify-send) ]]; then
echo ":: libnotify not found... sudo pacman -S libnotify"
exit 1
fi
#check for pacnew and notify
pacnews=($(/usr/bin/pacdiff -p --output|grep -v pacsave))
nb="${#pacnews[@]}"
if [[ $nb > 0 ]]; then
echo -e "\e[1;31m$nb .pacnew found in system \e[0m"
printf "%s\n" "${pacnews[@]}"
notify-send -u normal "Use DIFFPROG=meld pacdiff -s" "<span color='#ff1000' font='28px'><b>.PACNEW files found</b></span>"
fi
For the future visitors of the thread: @Ste74 Stefano Capitani made a GUI variant of a checking script here
p.s. In case the above topic is not visible to you since the project is very new and still in the development section of the forum for internal testing, here is the public gitlab page
and the package in the repos is of course manjaro-pacnew-checker