Is there a way to add to portage the possibility to configure a specific USE flag for a set of applications?
Today I have the problem: I want to enable doc USE flag for all KDE applications, but just KDE applications to avoid a huge files download for packages that I just don't want it. The only option that I found was add package by package (or create a script, or something) to packages.use.
I think that should be a mechanism to add a USE flag for a set. For example, in my case, it will be very useful if packages.use supports something like:
So every package in the set @kde-4.2 that has doc USE flag will be compiled with it, and the packages that don't have it won't be changed.
Take a look on qting-edge overlay sets. Portage already support this operation
I saw the set files on qting-edge overlay but I didn't see anything like what I am proposing here. Could you show me please?
(In reply to comment #1)
> Take a look on qting-edge overlay sets. Portage already support this operation
That's not what Ronan asked for. He wants to be able to set useflags for all packages belonging to a set in the same file he would do so for a single package too: portage.use. In the mentioned overlay a useflag is set for all packages belonging to that a set in the file where the set is defined by adding the useflag to each of the packages individually.
For the purpose this fullfills in the overlay this is very useful. (Essentially there are to sets containing the same packages but with different useflags.) However doing something like "set the flac useflag for all packages that are media players" also is a reasonable usecase. If you want that setting "@media-players flac in portage.use is what you would want.
At least I am interested in that feature too.
GLEP 21  talks about use flags in package.use for sets and why it is not a good idea. The first two reasons can be circumvented by a simple rule, like: "if an entry for a package exists in package.use, it takes precedence over what ever a set wants to set (similar for subsets). I don't understand the third argument. I can think of another problem. What happens if a package belongs to two sets and the sets have different use flags set? Or what if a subset of some set wants something else than another set. There is a clear rule needed to decide which setting takes precedence.
What about this:
final_list = , current_list = , temporary_list=
1) Read atoms and sets from package.use into current_list.
2) For atom in current_list:
if the atom is already in final_list
-add the new use-flags to it. If a new useflag contradicts with an old useflag, ignore the new useflag.
-remove atom from current_list
elif the atom is not in the final list
-If an atom has invalid use_flags (contains +use1 and -use1)
either A) error out and ignore both or B) choose what comes first
-Move atom from current_list to final_list.
3) Expand all sets in current_list to atoms and subsets into temporary_list;
5) if len(current_list)>0 goto 2
6) return final_list
Please tell me if I missed something and what you like better, A or B in step 2.
(I hope bugzi didn't screw the layout up too much)
And please explain what the third argument in GLEP 21 means.
I think it is a very interesting option, to make an entry for particular package in packages.use has a higher priority than the option specified for sets.
If you think it would mess up too much, maybe it will be more interesting for programming reasons to create another place to put sets use options, like /etc/portage/sets.use
In my opinion, if it was found conflicting sets option, like, a packages belongs two sets and one is setting -use1 an another +use1, than it has to show a message indicating the conflict but use the last (or first :D) option found in packages.use or sets.use.
Please take a look at bug 272488.
About conflicting USE flags on sets:
I think portage can follow same rules for packages use-flags.
E.g. package.use contain that:
category/package use1 -use2 use3
category/package -use1 use2
And result will be:
category/package -use1 use2 use3
Same rules for the sets.
About conflicting use flags on sets and packages:
There can be new "sets" layer in USE_ORDER variable.