1 |
>>>>> On Wed, 4 Mar 2015, Robin H Johnson wrote: |
2 |
|
3 |
> On Tue, Mar 03, 2015 at 10:12:07PM +0100, Ulrich Mueller wrote: |
4 |
>> However, it turned out that some 10 packages are using the bindist |
5 |
>> flag only in REQUIRED_USE but nowhere else [2] (with foo being some |
6 |
>> feature flag): |
7 |
>> |
8 |
>> IUSE="bindist foo" |
9 |
>> REQUIRED_USE="bindist? ( !foo )" |
10 |
>> |
11 |
>> IMHO, the bindist USE flag is redundant in these cases. So we |
12 |
>> should get rid of the REQUIRED_USE and add a restriction instead: |
13 |
>> |
14 |
>> IUSE="foo" |
15 |
>> RESTRICT="foo? ( bindist )" |
16 |
|
17 |
> This covers the case where it's not used anywhere else. |
18 |
|
19 |
> 1. What about the cases where it IS used somewhere else? |
20 |
|
21 |
Obviously, if the bindist flag is used directly to disable some |
22 |
feature during the build, then we cannot remove it from IUSE. In these |
23 |
cases, ebuilds would need to do: |
24 |
|
25 |
RESTRICT="!bindist? ( bindist )" |
26 |
|
27 |
One can discuss if using a feature flag instead and inverting the |
28 |
logic would make more sense there. For example, as pointed out |
29 |
in the thread referred to by floppym, www-client/chromium could |
30 |
"use_enable h264" instead of "use_enable !bindist h264" (it's done |
31 |
differently in the ebuild, but use_enable better explains the idea). |
32 |
|
33 |
> 2. If you do USE='bindist foo', does portage still give a nice warning |
34 |
> that they are mutually incompatible (I thought this is what the |
35 |
> REQUIRED_USE was added for). |
36 |
|
37 |
Portage/quickpkg will output a short warning if the ebuild has |
38 |
RESTRICT="foo? ( bindist )" and you build a binary package with |
39 |
USE=foo. Besides, ebuild authors could put a more explicit warning |
40 |
into pkg_pretend(). |
41 |
|
42 |
> I'm wondering if we should just be really explicit and do: |
43 |
> IUSE="bindist foo" |
44 |
> REQUIRED_USE="^^ ( bindist foo )" |
45 |
> RESTRICT="foo? ( bindist )" |
46 |
|
47 |
This would work (with ?? instead of ^^ in REQUIRED_USE though, |
48 |
otherwise it would fail with USE="-bindist -foo"), but the two flags |
49 |
would be redundant with each other. And IMHO we shouldn't use |
50 |
REQUIRED_USE for such a purpose, since we have RESTRICT for this. |
51 |
Also the above cannot be used for packages where binary distribution |
52 |
is unconditionally forbidden. |
53 |
|
54 |
Finally, in all these examples the bindist USE flag is used like a |
55 |
"noblah" style flag which is discouraged by the devmanual [1]. |
56 |
|
57 |
Ulrich |
58 |
|
59 |
|
60 |
[1] http://devmanual.gentoo.org/general-concepts/use-flags/#noblah-use-flags |