>>>>> On Wed, 4 Mar 2015, Robin H Johnson wrote:

> On Tue, Mar 03, 2015 at 10:12:07PM +0100, Ulrich Mueller wrote:
>> However, it turned out that some 10 packages are using the bindist
>> flag only in REQUIRED_USE but nowhere else [2] (with foo being some
>> feature flag):
>> 
>> IUSE="bindist foo"
>> REQUIRED_USE="bindist? ( !foo )"
>> 
>> IMHO, the bindist USE flag is redundant in these cases. So we
>> should get rid of the REQUIRED_USE and add a restriction instead:
>> 
>> IUSE="foo"
>> RESTRICT="foo? ( bindist )"

> This covers the case where it's not used anywhere else.

> 1. What about the cases where it IS used somewhere else?

Obviously, if the bindist flag is used directly to disable some
feature during the build, then we cannot remove it from IUSE. In these
cases, ebuilds would need to do:

   RESTRICT="!bindist? ( bindist )"

One can discuss if using a feature flag instead and inverting the
logic would make more sense there. For example, as pointed out
in the thread referred to by floppym, www-client/chromium could
"use_enable h264" instead of "use_enable !bindist h264" (it's done
differently in the ebuild, but use_enable better explains the idea).

> 2. If you do USE='bindist foo', does portage still give a nice warning
>    that they are mutually incompatible (I thought this is what the
>    REQUIRED_USE was added for).

Portage/quickpkg will output a short warning if the ebuild has
RESTRICT="foo? ( bindist )" and you build a binary package with
USE=foo. Besides, ebuild authors could put a more explicit warning
into pkg_pretend().

> I'm wondering if we should just be really explicit and do:
> IUSE="bindist foo"
> REQUIRED_USE="^^ ( bindist foo )"
> RESTRICT="foo? ( bindist )"

This would work (with ?? instead of ^^ in REQUIRED_USE though,
otherwise it would fail with USE="-bindist -foo"), but the two flags
would be redundant with each other. And IMHO we shouldn't use
REQUIRED_USE for such a purpose, since we have RESTRICT for this.
Also the above cannot be used for packages where binary distribution
is unconditionally forbidden.

Finally, in all these examples the bindist USE flag is used like a
"noblah" style flag which is discouraged by the devmanual [1].

Ulrich


[1] http://devmanual.gentoo.org/general-concepts/use-flags/#noblah-use-flags

Attachment: pgpGrYOx97ERn.pgp
Description: PGP signature

Reply via email to