View previous topic :: View next topic |
Author |
Message |
printf Tux's lil' helper
Joined: 02 Dec 2010 Posts: 123
|
Posted: Sat Nov 26, 2022 8:43 am Post subject: Keeping package.* files sorted and tidy |
|
|
After many years of use on my 2 gentoo machines, sometimes I stumble upon instances of duplicate configurations in packages.* files.
I'm thinking about manually sorting the files periodically using linux commands, but first i was curios, if there is any tool, that does that?
Or anyone has a nice sorting technique, that takes into account special characters too?
Once i tried briefly a GUI based emerge, but I'd rather keep it absolutely bare-bones, if possible.
On a different note, my /etc/portage looks like this:
Code: | ls -al /etc/portage/
total 56
drwxr-xr-x 4 root root 4096 Nov 24 10:23 .
drwxr-xr-x 83 root root 4096 Nov 26 08:42 ..
-rw-r--r-- 1 root root 1239 Sep 13 18:09 make.conf
-rw-r--r-- 1 root root 1101 Jun 4 2018 make.conf.bak
lrwxrwxrwx 1 root root 59 Jul 7 2019 make.profile -> ../../usr/portage/profiles/default/linux/amd64/17.1/desktop
-rw-r--r-- 1 root root 104 Nov 10 11:03 package.accept_keywords
-rw-r--r-- 1 root root 4464 Nov 24 10:23 package.keywords
-rw-r--r-- 1 root root 306 Nov 7 2019 package.license
-rw-r--r-- 1 root root 87 Nov 8 2020 package.mask
-rw-r--r-- 1 root root 180 Nov 9 23:13 package.unmask
-rw-r--r-- 1 root root 7993 Nov 24 10:23 package.use
drwxr-xr-x 2 root root 4096 May 31 16:06 repos.conf
drwxr-xr-x 3 root root 4096 Nov 27 2021 savedconfig
|
Is there any reason to organize differently? Like putting configurations for different overlays in subdirectories?
Also emerge is constantly complaining, that I'm using package.keywords, and should use only package.accept_keywords - any reason to abandon it? Or will it be removed in the future? |
|
Back to top |
|
|
CaptainBlood Advocate
Joined: 24 Jan 2010 Posts: 3625
|
Posted: Sat Nov 26, 2022 9:41 am Post subject: |
|
|
switching to package.accept_keywords would cancel portage complains.
Do you have any reason for not doing so? package.keywords based scripts maybe?
My personal liking there is directories instead of single file..
package.use & accept_keywords mostly contain package based file, e.g. one for clang, one for gcc and so on...
Remember that latest defined & read atomic package constrain will be taken into account.
So if you want # constraint depending where the ebuild is originated from, it would be advisable to deambiguate with final ::gentoo or ::overlay an the end of the package definition accordingly.
In shown configuration package.keywords will have the final word over package.accept_keywords.
Thks 4 ur attention, interest & support. _________________ USE="-* ..." in /etc/portage/make.conf here.
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. " |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54236 Location: 56N 3W
|
Posted: Sat Nov 26, 2022 11:28 am Post subject: |
|
|
printf,
eix has some options to find redundant entries.
That's a good start. Cleaning out the rubbish.
Using directories for package.* is a doubled edged sword. You get can got duplicate entries, sometimes doing different things. That's a mess.
will show the content in lexicographical order.
Code: | cat <dir>/* | sort | grep -v \# | will then remove comments, which helps see what's what.
If package.* are files, they are easy to manually keep sorted but some tools, like crossdev, won't work that way. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
CaptainBlood Advocate
Joined: 24 Jan 2010 Posts: 3625
|
Posted: Sun Nov 27, 2022 9:35 am Post subject: |
|
|
NeddySeagoon wrote: | eix has some options to find redundant entries. | Nice to know. NeddySeagoon wrote: |
Using directories for package.* is a doubled edged sword. | Files also can have double entries, easily detected once sorted indeed. NeddySeagoon wrote: | but some tools, like crossdev, won't work that way. | Likely the reason directories have been switched to in the first place here.
As file per package is concerned, I find it useful for having full of comments on the settings especially with package.use and package.env. They would be painful in single monolithic files.
Thks 4 ur attention, interest & support _________________ USE="-* ..." in /etc/portage/make.conf here.
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. " |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|