Gentoo Archives: gentoo-dev

From: Jerome Brown <jerome@×××××××.nz>
To: gentoo-dev@××××××××××××.org
Subject: Re: [gentoo-dev] GLEP 29 (USE groups) and negatives
Date: Tue, 08 Mar 2005 19:14:08
Message-Id: 422DF989.3090206@hub.net.nz
In Reply to: [gentoo-dev] GLEP 29 (USE groups) and negatives by Ciaran McCreesh
1 Ciaran McCreesh wrote:
2 > http://www.gentoo.org/proj/en/glep/glep-0029.html
3 >
4 > We need to decide upon a solution to the -flags problem. The proposed
5 > solutions are:
6 >
7 > 1) Disallow all negatives. Disadvantages: we don't tend to disallow
8 > things just because users could shoot themselves in the foot with them.
9 >
10 > 2) Allow negatives, and document how to use them correctly.
11 > Disadvantages: sooner or later, some developer isn't going to read the
12 > docs, and will really really screw things up with a misunderstanding.
13 >
14 > 3) Reorder USE flags. Disadvantages: can't disable flags set by a group.
15 > Breaks existing USE lines.
16 >
17 > 4) Have portage warn on dodgy USE flag lines. Disadvantages: tricky,
18 > hard for the end user to figure out.
19 >
20 > 5) Use some weird tristate notation. Disadvantages: not everyone has the
21 > slightest clue what set theory is.
22 >
23 > I'm in favour of 2) personally, but others disagree. I'd like a proper
24 > discussion on this before trying to get the GLEP through.
25 >
26 How about another option?
27
28 6) Disallow -USE within groups, but allow -@GROUP
29
30 Looking through the GLEP, I notice that the examples of where problems
31 of allowing -USE flags in a group could be resolved by not allowing the
32 -USE but allowing -@GROUP. For example, the usage of @KDE and @GNOME
33 groups in the glep looks like this:
34
35 <quote glep>
36 If, for example, the KDE group turned off GNOME things and the GNOME
37 group turned off KDE things:
38
39 KDE X kde qt -gtk -gnome
40 GNOME X gtk gtk2 gnome -kde -qt
41
42 And a user wished to use both KDE and GNOME on a system, and so had USE
43 flags as follows:
44
45 USE="@KDE @GNOME"
46
47 They would end up with:
48
49 USE="X kde qt -gtk -gnome X gtk gtk2 gnome -kde -qt"
50
51 Which simplifies:
52
53 USE="X gtk gtk2 gnome -kde -qt"
54
55 This is clearly not the desired effect.
56 </quote>
57
58 If, however we disallowed negatives in the group, you would define them as:
59
60 KDE X kde qt
61 GNOME X gtk gtk2 gnome
62
63 Therefore to get the desired effect of the originally suggested @KDE or
64 @GNOME the user would put:
65
66 USE="@KDE -@GNOME" or
67 USE="@GNOME -@KDE"
68
69 and to get both would have
70
71 USE="@KDE @GNOME"
72
73 which would resolve correctly.
74
75 The issue comes with resolving the individual (@KDE -@GNOME or vice
76 versa) as both define X, and a -X comes from the other. I guess that
77 this could be resolved by defining that if a USE flag is defined in a
78 group, and another group negates it, that portage ignores the negation,
79 however if the negation is specified by the user in their USE line then
80 the negation is allowed: Therefore
81
82 USE="@GNOME -@KDE"
83
84 would resolve to
85
86 USE="X gtk gtk2 gnome -kde -qt"
87
88 and
89
90 USE="@GNOME -X"
91
92 would resolve to
93
94 USE="gtk gtk2 gnome -X"
95
96 Just my 0.02 Universal Currency
97 --
98 Jerome Brown
99 Technology Architect
100 Hub.Net
101
102 P: +64 3 961-5116
103 M: +64 29 453 7663
104 F: +64 3 961-5129
105 E: jerome@×××××××.nz
106 W: http://www.hub.net.nz/
107 O: Level 4, 818 Colombo St, Christchurch, New Zealand
108 S: PO Box 1879, Christchurch, New Zealand
109 --
110 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] GLEP 29 (USE groups) and negatives Chris Gianelloni <wolf31o2@g.o>
Re: [gentoo-dev] GLEP 29 (USE groups) and negatives Luca Barbato <lu_zero@g.o>