Skip to main content
Topic: Artix way to update configuration files (Read 1162 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Artix way to update configuration files

Hi all :-)

Apparently, when a package ships a configuration file, the existing one is not overwritten (maybe if it was changed?), but another one, with the extension .pacnew is created.

E.g. after the update a few days ago, /etc/locale.gen.pacnew emerged, leaving my modified /etc/locale.gen untouched.

I come from Gentoo. The approach is comparable there, however emerge tells me if some config file needs to be updated. Anyway, we have a tool called dispatch-conf (also one called etc-update) which checks for such files, shows the differences and lets me choose to use the new one, keep the old one or merge both.

What's the Artix way to handle such updated config files? And is there a way to see if config files want to be updated other than reading pacman's whole output or doing something like find /etc | grep '\.pacnew$'?

Thanks for all hints :-)

Re: Artix way to update configuration files

Reply #1
>What's the Artix way to handle such updated config files?

Manual to my knowledge, there isn't the need for a tool like etc-update since it's just a shell script that uses diff and mv.

Just run diff on .pacnew and the original file and decide for yourself.

Also it seems we have an etc-update package: https://archlinux.org/packages/community/any/etc-update/

Re: Artix way to update configuration files

Reply #2
Oh, I didn't expect Arch/Artix to have etc-update (it's even Gentoo's script!) … but it doesn't seem to work:
Code: [Select]
# etc-update 
etc-update: ERROR: missing portageq
Since portageq is a part of Gentoo's Portage, I don't think this would be very meaningful to use on an Artix system.

Okay, then it's manual management. I just thought there would be something comparable.

Thanks for the info!

Re: Artix way to update configuration files

Reply #3
Okay, one small patch makes it work on Artix:
Code: [Select]
--- etc-update.orig     2022-08-09 16:01:15.433432791 +0200
+++ etc-update  2022-08-09 16:03:01.427275425 +0200
@@ -37,7 +37,7 @@
 case ${OS_RELEASE_POSSIBLE_IDS} in
        *:suse:*|*:opensuse:*|*:opensuse-tumbleweed:*) OS_FAMILY='rpm';;
        *:fedora:*|*:rhel:*) OS_FAMILY='rpm';;
-       *:arch:*) OS_FAMILY='arch' NEW_EXT='pacnew';;
+       *:arch:*|*:artix:*) OS_FAMILY='arch' NEW_EXT='pacnew';;
        *) OS_FAMILY='gentoo';;
 esac
However, etc-update sucks ;-) That's why I have been using dispatch-conf for ages now.

Edit: I filed an upstream bug report about this at https://bugs.gentoo.org/864565 – maybe they patch it to make it work on Artix out of the box.

Re: Artix way to update configuration files

Reply #4
There is pacdiff from community/pacman-contrib. Pacdiff - "pacorig, pacnew and pacsave maintenance utility". Man pacdiff for more info.

 

Re: Artix way to update configuration files

Reply #5
This is something what already maked me crazy on gentoo, and so never "installed" the new configurations files.

The one last thing wich is missing to make this perfect, is to detect and know wich config or to be specific, wich lines a user have changed, and give the option to keep the changsd maked by user and only to merge the new added lines and lines wich differ from the old config, but didnt was changed by user.

Because if you use gentoo, especially with openbox (how i do), and so dont have and dont use any configurations gui's, you edit and change A LOT of configurations files.

I had already often the Situation in the past years ago, that i emerged against world again and after that i had over 10+ new configuration files where portage tells me what the difference are. often i needed over a hour to compare them all, and to think about if i set option_xyz=1 (and the new one is option_xyz=2), or if it was standard at 1, and changed to 2. Often i forgot where i have set something to make something to work (especially after months/years).

So, i simply dont care, and only merge the pacman mirrors from time to time.

Re: Artix way to update configuration files

Reply #6
There is pacdiff from community/pacman-contrib. Pacdiff - "pacorig, pacnew and pacsave maintenance utility". Man pacdiff for more info.
Thanks for the hint! Pacdiff looks good :-)