On Mon, 31 Aug 2009 20:15:37 +0200 Mounir Lamouri <[email protected]> wrote: > > * at least one of a b c, possibly only if d > > > IUSE_REQUIREMENTS="d? ( || ( a b c ) )"
Moderately eww...
> > * exactly one of a b c, possibly only if d
> >
> IUSE_REQUIREMENTS="d? ( || ( a b c ) ) a ? ( -b -c ) b ? ( -a -c ) c?
> ( -a -b )"
Really eww...
> > * at most one of a b c, possibly only if d
> >
> IUSE_REQUIREMENTS="d? ( a? ( -b -c) b? ( -a -c ) c? ( -a -b) )"
Similarly eww.
> > From a package manager perspective, it's much easier to give good
> > advice to the user if we're told by the ebuild exactly what's going
> > on.
>
> So I think we can satisfy all use cases with the classic Gentoo syntax
> even if new operators could be appreciated ;)
How do we translate the above into nice friendly messages for the user?
Taking the "exactly one" case, it's much better to say to the user:
* If 'd' is enabled, exactly one of 'a', 'b' or 'c' must be enabled
Than:
* If 'd' is enabled, at least one of 'a', 'b' or 'bc' must be
enabled
Then when the user turns on all three:
* If 'd' is enabled, if 'a' is enabled, 'b' must not be enabled
* If 'd' is enabled, if 'a' is enabled, 'c' must not be enabled
* If 'd' is enabled, if 'b' is enabled, 'a' must not be enabled
* If 'd' is enabled, if 'b' is enabled, 'c' must not be enabled
* If 'd' is enabled, if 'c' is enabled, 'a' must not be enabled
* If 'd' is enabled, if 'c' is enabled, 'b' must not be enabled
And in the general case, there's no way of translating the latter into
the former.
Much easier for everyone if you just say what you mean rather than
converting it into some convoluted (but theoretically equivalent) less
expressive syntax.
--
Ciaran McCreesh
signature.asc
Description: PGP signature
