OS ID addition

Hello,

Today I had some “*.pacnew” files within my garuda (through normal updates). So, I remembered that I had at some point a nice script for that (it's very useful). It's called "etc-update" and originally comes from gentoo. Nevertheless, it also does the job for Arch based distros. Sadly within the script they have a check to estimate which "base" OS is in use. And here come my trouble.

Apparently all the other arch based distros (at least most of them) have an ‘ID_LIKE’ attribute in their "/etc/os-release"-file which is filled with "arch". Garuda Linux has here just ‘ID’ which is filled with "garuda". So scripts which make a check for the origin (in this case arch) will run into errors here. In this example it expects to run on "gentoo" and therefor they expect some off their own tooling.

It would be great to have here (/etc/os-release) an additional attribute ‘ID_LIKE=arch’.
Thank you!

For more info about "etc-update" you can have a look here -->
https://github.com/gentoo/portage/commits/master/bin/etc-update

All the best,
Pamalosebi

1 Like

Adding a data point here...
One of the scripts which has issues without the "ID_LIKE=arch" is the build script for snapd. I know that snapd is not popular here but it does seem to work so long as you edit /etc/os-release before building it.

Minor additional note:
There appears to be some confusion in the community as to what should be the value in the ID_LIKE attribute. EndeavourOS, for instance, uses "archlinux" instead of "arch".

1 Like

It is fixed with a pacman hook.
I don't know why it doesn't work on your side...
It needs a fix @dr460nf1r3 , Arch os-release (IIRC fixed with hook as well), does not include ID_LIKE which is correct. Your sed cmd replaces, but does not add, when not present.

2 Likes

In reply to the OP while your request may be legit you are playing with fire if you attempt to use Gentoo's solution to automate merging pacnew files. If it was easy to do this safely there would be a dedicated Arch tool for this already.

3 Likes

Forwarding to @librewish :grin:

2 Likes

It's a well known tool and showcased in Archwiki IIRC.

2 Likes

I have also read more than a few posts on the Arch forum cautioning against using this tool.

I guess like using bleachbit, some will say it's handy automation. Others such as myself will caution it has the potential to cause serious damage with its automation.

2 Likes

I think you are right. I've just checked Gentoo wiki on this and it looks like pacdiff.
What I was referring to was another package/method which uses git to track /etc/* changes.
Memory issues... :frowning_face:


Got it!
https://wiki.archlinux.org/index.php/Etckeeper

4 Likes

Yes Etckeeper sounds like a great tool and I've considered installing it myself a few times before. Gentoo's tool, not so much.

3 Likes

fixed

i took it from endeavouros

8 Likes

Yes, I am with you on that (on the main part). I see the danger with those tools. Two years ago I accidentally destroyed my "shadows"-file with such a tool (didn't happen with etc-update yet).

Afterwards I searched and found this one (etc-update) with the Arch wiki and it worked great, too.
--> https://wiki.archlinux.org/index.php/Pacman/Pacnew_and_Pacsave#Third-party_utilities
And I see, that it is still there. While most of the other utilities didn't work properly.

But I am very glad I could help you and point out a small thing to fix. :blush:
And also I am always thankful for great new tools and tips. I will try out Etckeeper next time I have to take care about some ".pacnew"-files.

4 Likes

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