View previous topic :: View next topic |
Author |
Message |
Anard Apprentice
Joined: 01 Oct 2020 Posts: 216
|
Posted: Sat Dec 03, 2022 8:16 am Post subject: How to split my world file ? |
|
|
Hi.
I'd like to clean and comment my world file, to remember which package is used for which usage.
As for my specific USE flags, I'd like to split this /var/lib/portage/world in multiple files, sorted by themes. I don't use 1 package.use file but a folder :
Code: | $ ls /etc/portage/package.use/
32bit elementary kodi midi qemu-cross-compiler steam
TEMP games lamp misc redshift system
cairo-dock gparted libreoffice mplab rhythmbox xfce
children image media network scan zeroconf
|
I feel it easier to maintain, but not sure it's possible to do the same with world file and how ? _________________ "iMack" : GA-H97M-D3H, Intel i5 4460, 16Go DDR3, Intel HD4600, 2x SSD 256Go, HDD 500Go+2To / Clover - macOS Mojave / Gentoo-Xfce
"Portable" : HP 350G3, HDD 500Go / rEFInd - Xubuntu 20.04 / Windows 10 |
|
Back to top |
|
|
FilthyPitDog Apprentice
Joined: 12 Jan 2021 Posts: 186 Location: South Pacific
|
|
Back to top |
|
|
Anard Apprentice
Joined: 01 Oct 2020 Posts: 216
|
Posted: Sat Dec 03, 2022 8:59 am Post subject: |
|
|
Yes I read this and did the trick. I also tried to add comments and sort packages by theme in this file, but it seems that and Code: | emerge --deselect PACKAGE | edited my sorted world file, re-sorting it by name and removing all commented lines
It's 200 lines long and I feel it difficult to read in this format. A /etc/portage/package.use like system should be nice : an option for a /var/lib/portage/world folder where you can divide list in multiple files. _________________ "iMack" : GA-H97M-D3H, Intel i5 4460, 16Go DDR3, Intel HD4600, 2x SSD 256Go, HDD 500Go+2To / Clover - macOS Mojave / Gentoo-Xfce
"Portable" : HP 350G3, HDD 500Go / rEFInd - Xubuntu 20.04 / Windows 10 |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 4148 Location: Bavaria
|
Posted: Sat Dec 03, 2022 9:54 am Post subject: |
|
|
Anard wrote: | It's 200 lines long and I feel it difficult to read in this format. A /etc/portage/package.use like system should be nice : an option for a /var/lib/portage/world folder where you can divide list in multiple files. |
You can work with user defined sets: https://wiki.gentoo.org/wiki/Package_sets#User_defined_sets |
|
Back to top |
|
|
FilthyPitDog Apprentice
Joined: 12 Jan 2021 Posts: 186 Location: South Pacific
|
Posted: Sat Dec 03, 2022 9:56 am Post subject: |
|
|
pietinger wrote: | Anard wrote: | It's 200 lines long and I feel it difficult to read in this format. A /etc/portage/package.use like system should be nice : an option for a /var/lib/portage/world folder where you can divide list in multiple files. |
You can work with user defined sets: https://wiki.gentoo.org/wiki/Package_sets#User_defined_sets |
holy this is awesome! i can make my clang-toolchain set finally no aliases for that! _________________ Gentoo is a way of life... |
|
Back to top |
|
|
Ionen Developer
Joined: 06 Dec 2018 Posts: 2719
|
Posted: Sat Dec 03, 2022 2:54 pm Post subject: |
|
|
Who needs a world file anyway. Code: | $ wc -l /var/lib/portage/world
0 /var/lib/portage/world
$ cat /var/lib/portage/world_sets
@local
$ portageq envvar EMERGE_DEFAULT_OPTS
-1av |
|
|
Back to top |
|
|
FilthyPitDog Apprentice
Joined: 12 Jan 2021 Posts: 186 Location: South Pacific
|
Posted: Sat Dec 03, 2022 2:56 pm Post subject: |
|
|
Ionen wrote: | Who needs a world file anyway. Code: | $ wc -l /var/lib/portage/world
0 /var/lib/portage/world
$ cat /var/lib/portage/world_sets
@local
$ portageq envvar EMERGE_DEFAULT_OPTS
-1av |
|
lmao! what in Gentoo's name?? _________________ Gentoo is a way of life... |
|
Back to top |
|
|
Zucca Moderator
Joined: 14 Jun 2007 Posts: 3345 Location: Rasi, Finland
|
Posted: Sat Dec 03, 2022 3:12 pm Post subject: |
|
|
Ionen wrote: | Who needs a world file anyway. Code: | $ wc -l /var/lib/portage/world
0 /var/lib/portage/world
$ cat /var/lib/portage/world_sets
@local
$ portageq envvar EMERGE_DEFAULT_OPTS
-1av |
| Interesting approach... Thanks. I might experiment with this... _________________ ..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote: | I am NaN! I am a man! |
|
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21633
|
Posted: Sat Dec 03, 2022 4:32 pm Post subject: |
|
|
FilthyPitDog wrote: | Ionen wrote: | Who needs a world file anyway. Code: | $ wc -l /var/lib/portage/world
0 /var/lib/portage/world
$ cat /var/lib/portage/world_sets
@local
$ portageq envvar EMERGE_DEFAULT_OPTS
-1av |
| lmao! what in Gentoo's name?? | I am unsure whether this question is serious, but in case it is:- No packages are listed in @world.
- One user-defined set, named local is listed in the world sets, so all packages in that set are implicitly required by @world, without listing them in the Portage-maintained file named world. That user-defined set, not shown, is curated by hand using typical text editing tools, and is presumably able to retain its comments since it is never rewritten by Portage.
- Default options include --oneshot to ensure that @world stays empty. This does burden the user with manually adding packages to the set @local when they should be kept, but that is an acceptable tradeoff for being able to document each entry's purpose. The --ask --verbose is a personal preference and unrelated to the problem at hand.
|
|
Back to top |
|
|
FilthyPitDog Apprentice
Joined: 12 Jan 2021 Posts: 186 Location: South Pacific
|
Posted: Sat Dec 03, 2022 4:34 pm Post subject: |
|
|
Hu wrote: | I am unsure whether this question is serious |
yes i was serious hehe but i understand very clearly now thank you _________________ Gentoo is a way of life... |
|
Back to top |
|
|
Anard Apprentice
Joined: 01 Oct 2020 Posts: 216
|
Posted: Sat Dec 03, 2022 6:47 pm Post subject: |
|
|
Thanks so much, it's exactly what I was searching.
I'd seen these world sets before, but without understanding how does it work. I feel a little strange that these sets are placed in /etc/portage/sets which is separated to /var/lib/portage/world, but it works well.
I just created a "games" set, now I have to do the same for other "themes" to finish cleaning my world.
I don't use the default --one-shot option because it's not a problem for me that portage still write in world file. As it, portage continues to work as now, but I can extract some packages from world file to integrate it in a sorted set.
Thx u all. _________________ "iMack" : GA-H97M-D3H, Intel i5 4460, 16Go DDR3, Intel HD4600, 2x SSD 256Go, HDD 500Go+2To / Clover - macOS Mojave / Gentoo-Xfce
"Portable" : HP 350G3, HDD 500Go / rEFInd - Xubuntu 20.04 / Windows 10 |
|
Back to top |
|
|
mike155 Advocate
Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
Posted: Sat Dec 03, 2022 10:03 pm Post subject: Re: How to split my world file ? |
|
|
Anard wrote: | I'd like to clean and comment my world file, to remember which package is used for which usage. |
I fully agree. I have added a comment to https://bugs.gentoo.org/145838. Unfortunately, I cannot re-open this bug. |
|
Back to top |
|
|
Goverp Advocate
Joined: 07 Mar 2007 Posts: 2007
|
Posted: Sun Dec 04, 2022 12:14 pm Post subject: |
|
|
Ooh, I like that approach; thanks Ionen. Now all I need do is remember why I installed all those packages!
I used to use a random password generator script that uses uuencode on a random number. Every so often I'd tidy my world file and it would stop working until I found which otherwise-irrelevant package provided it (app-arch/sharutils in this case). Turns out it's gone again; never mind, I let firefox generate passwords now. _________________ Greybeard |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54237 Location: 56N 3W
|
Posted: Sun Dec 04, 2022 12:30 pm Post subject: |
|
|
mike155,
The bug works for me but its RESOLVED WONTFIX.
The last comment is bug 145838 wrote: | I certainly don't think we want to encourage people to manually edit the world file. | on 04-Dec-22.
I have a lot of sympathy for that view. We occasionally get users here who have damaged their world file and given portage a lobotomy.
It's not something that should be encouraged. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9530 Location: beyond the rim
|
Posted: Sun Dec 04, 2022 6:42 pm Post subject: Re: How to split my world file ? |
|
|
mike155 wrote: | Anard wrote: | I'd like to clean and comment my world file, to remember which package is used for which usage. |
I fully agree. I have added a comment to https://bugs.gentoo.org/145838. Unfortunately, I cannot re-open this bug. |
Well, my 15 year old comment when closing this still applies, though of course I don't have any say in the matter anymore. Any file should either be auto-generated or user-edited, not both. The latter is just asking for things to become messy in the long run.
If you REALLY need that comment support you're free to override @selected in your local /etc/portage/sets.conf with a module that does support comments (you'll probably have to write it yourself though). |
|
Back to top |
|
|
Goverp Advocate
Joined: 07 Mar 2007 Posts: 2007
|
Posted: Mon Dec 05, 2022 9:09 am Post subject: |
|
|
I've just posted a suggestion to the bug to suggest:
Code: | emerge foo --blame='I use foo to frobnicate my thingamajig' |
and appropriate display in unmerge and depclean, to be implemented with inline comments in the world file.
Would that do?
It's an ideal solution - meaning someone else has to implement it _________________ Greybeard |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54237 Location: 56N 3W
|
Posted: Mon Dec 05, 2022 10:29 am Post subject: |
|
|
Goverp,
Just use sets.
Portage already has a variable to override some insanity checks. :)
I suppose that could be pressed into service without creating a new one. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
grknight Retired Dev
Joined: 20 Feb 2015 Posts: 1660
|
Posted: Mon Dec 05, 2022 2:15 pm Post subject: |
|
|
I will caution on the use of the --unmerge option with user sets. Don't do it!
unmerge is potentially a system killer with user sets as the contents are not checked for critical importance or use elsewhere.
When a set is no longer necessary, always use --deselect and follow up with a --depclean. |
|
Back to top |
|
|
Anard Apprentice
Joined: 01 Oct 2020 Posts: 216
|
Posted: Tue Dec 13, 2022 8:32 pm Post subject: |
|
|
Since this discussion, I've tried an improve of Feng's script that you can find there :
clean-world.sh
Use carefully as it's still a testing script, for security, it asks before editing your world files and first back up all files found in your system as /etc/portage/sets/FILE.bak and /var/lib/portage/world.bak
You're of course all welcome for corrections and improvements.
Thanks _________________ "iMack" : GA-H97M-D3H, Intel i5 4460, 16Go DDR3, Intel HD4600, 2x SSD 256Go, HDD 500Go+2To / Clover - macOS Mojave / Gentoo-Xfce
"Portable" : HP 350G3, HDD 500Go / rEFInd - Xubuntu 20.04 / Windows 10 |
|
Back to top |
|
|
|