After a long discussion on IRC (mostly between Michael and me) two
views on how general flags should behave have emerged. Since Michael
and me is of different opinions we would like some more input on this
topic.

Currently we have three levels of use flags, were each lower level
override an higher level: dist use flags (Data/DistUseFlags.conf),
system use flags (Settings/UseFlags.conf) and one off flags (USE="",
mostly for debugging). Flags are set by +foo and reset by -foo. A flag
can be set (on) or not set (off). There exists no state where the flag
is set to "off", it just isn't set when off.

For generic flags, they try to select the best available flag in a
group of flags. If we for example have "aaa: bbb ccc ddd", where "aaa"
is a generic flag and "bbb", "ccc" and "ddd" are specific flags, +bbb
is set if available in the recipe, else +ccc is selected if available,
else +ddd is set if available (and so on if the group is bigger) when
+aaa is set. But if any specific flag is set that overrides the group
selection in the generic flag, that is if +ccc is set by the user this
will override the group and will be used in the example above instead
of best available. This is so the user can select a specific
implementation.
Generic flags are applied after all user specified use flags, so that
any generic flag set by the user will be taken into account when
generic flags are parsed.

Now, I'd like that generic flags do not enable flags I've reset, or
more specifically turned off. If the flags available is the same as
above and I have "+aaa -bbb" I'd like that "bbb" is not set when
generic flags are parsed, instead "ccc" or "ddd" should be used. This
requires a state that remembers that I've reset the state for when
generic flags are parsed.
At the moment -bbb just resets the "bbb" flag (unsets it) and +aaa
enables the generic flags which will select from the "bbb ccc ddd"
group, but I think that specifying -bbb would remove "bbb" from the
selection group, so that the best from "ccc ddd" is set by the generic
flag instead.

A problem with this approach is that there's no way to reset a generic
flag to the default behaviour. If +bbb is set there is no way to reset
"aaa" to selecting from the full "bbb ccc ddd" group. Currently just
specifying -bbb resets that flag and "aaa" will return to default
behaviour but with "my" implementation specifying -bbb will remove
"bbb" from the selection group.
A solution to this would be that specifying +aaa in any level would
reset the "aaa" behavioiur and would quench any specific flags set in
earlier levels. So having "+aaa +bbb +aaa" would give normal
behavioiur for "aaa". A problem with this solution is what will happen
if a specific flag is present in multiple generic flags (for example
the specific flag "qt3" is part of both "qt" and "gui" generic flags).
Say that we, in addition to the above generic set, have "iii: bbb jjj
kkk", what will be the effect of "+foo -bbb +iii"? Will +foo set +ccc
(as "bbb" is removed from the selection) and +iii set +bbb (as +iii
was specified after "bbb" was removed with -bbb)? The result thus
being "+ccc +bbb", which means that from the "aaa" selection set two
flags will be set and is this a problem? A solution to this is to not
allow specific flags to be present in multiple generic flags.

Hope to get some input on this and in the end come to a consensus.

-- 
/Jonas
_______________________________________________
gobolinux-devel mailing list
gobolinux-devel@lists.gobolinux.org
http://lists.gobolinux.org/mailman/listinfo/gobolinux-devel

Reply via email to