Gentoo Archives: gentoo-dev

From: Maurice van der Pot <griffon26@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] GLEP 29 (USE Flag Grouping) with -@GROUP goodness
Date: Sun, 24 Oct 2004 16:31:27
Message-Id: 20041024163118.GF7905@kfk4ever.com
In Reply to: [gentoo-dev] GLEP 29 (USE Flag Grouping) with -@GROUP goodness by Ciaran McCreesh
1 The problem with -something seems to be two-fold:
2 1) it's hard to realize the consequence of double negations
3 2) with -@GROUP1 and @GROUP2 where both groups share a use flag
4 it is order dependent whether or not the common use flag will
5 be in the end result
6
7 On Sun, Oct 24, 2004 at 04:06:22PM +0100, Ciaran McCreesh wrote:
8 > Groups may be preceded by a -sign to invert their contents (that is, all
9 > 'enable' use flags become -flags, and all -flags become enable flags). Be
10 > warned that this feature can cause confusion (see below). Example usage:
11 >
12 > ::
13 >
14 > # We have the following groups defined...
15 > GROUP1 foo bar
16 > GROUP2 -bar baz -fnord
17 > GROUP3 @GROUP1 -@GROUP2 -bar foo
18 > GROUP4 -foo -bar
19 >
20 > # And the following...
21 > USE="-@GROUP3 @GROUP4 bar"
22 >
23 > # which resolves to...
24 > USE="-@GROUP1 @GROUP2 bar -foo -foo -bar bar"
25 > USE="-foo -bar bar -baz fnord bar -foo -foo -bar bar"
26 > USE="-baz fnord -foo bar"
27
28 ... which is kind of hard to see at a glance.
29
30 Whether a use flag is specifically turned off for a group or it is
31 just not present in the group should make no difference for the meaning
32 of GROUP. The same holds for -@GROUP. In other words, -use and -@GROUP
33 should only be used in the definition of a group to filter flags out.
34
35 Assume MYGNOME="@GNOME -gtk", then USE="... -@MYGNOME ..." should
36 *not* be equivalent to USE="... -@GNOME gtk ...", instead it should
37 not influence the state of gtk at all.
38
39 > Issues with -flags and -@GROUPS
40 > -------------------------------
41 >
42 > Earlier drafts of this GLEP did not allow -use flags or -@GROUPS. However,
43 > because of feedback along the lines of "we shouldn't disallow features
44 > just because some users won't understand them" (for example, [3]_), these
45 > are now allowed but discouraged.
46 >
47 > The problems are best illustrated by example. Say we have the following
48 > groups defined:
49 >
50 > ::
51 >
52 > KDE X kde qt
53 > GNOME X gtk gtk2 gnome
54 >
55 > A user who wants a KDE desktop but no GNOME may do the following:
56 >
57 > ::
58 >
59 > USE="@KDE -@GNOME"
60 >
61 > However, this will not give the desired effect -- the ``X`` USE flag will
62 > end up being disabled.
63
64 The problem here is that there is no distinction between a group that
65 requires use flags and a group that contains use flags. If the syntax was
66 something like GNOME="$X gnome gtk", where $ indicated a requirement, then
67 specifying USE="@KDE -@GNOME" and USE="-@GNOME @KDE" would be equivalent
68 while the end result would still contain X.
69
70 > KDE X kde qt -gtk -gnome
71 > GNOME X gtk gtk2 gnome -kde -qt
72 >
73 > USE="@KDE @GNOME"
74 >
75 > They would end up with:
76 > USE="X gtk gtk2 gnome -kde -qt"
77
78 I would specify it like this:
79
80 KDE $X kde qt -gtk -gnome
81 GNOME $X gtk gtk2 gnome -kde -qt
82
83 USE="@KDE @GNOME"
84
85 That would result in:
86 USE="X kde qt gtk gtk2 gnome"
87
88 Exactly what the user wants.
89
90 Regards,
91 Maurice.
92
93 --
94 Maurice van der Pot
95
96 Gentoo Linux Developer griffon26@g.o http://www.gentoo.org
97 Creator of BiteMe! griffon26@××××××××.com http://www.kfk4ever.com

Replies

Subject Author
Re: [gentoo-dev] GLEP 29 (USE Flag Grouping) with -@GROUP goodness Ciaran McCreesh <ciaranm@g.o>