1 |
Old-style virtuals are extremely messy and introduce an awful lot of |
2 |
complexity. They were supposed to be on the way out several years ago, |
3 |
with GLEP 37, but that seems to have stalled. |
4 |
|
5 |
Is there anything in particular holding back replacing most or all of |
6 |
the remaining old-style virtuals with new 'package' virtuals? |
7 |
|
8 |
There are a few possible issues: |
9 |
|
10 |
Doing per-profile virtual defaults is a bit messy. If the desired |
11 |
default for a given subprofile is different, and the 'normal' default |
12 |
is masked, then || ( ) dependencies are fine. But otherwise you need to |
13 |
use use flags. That's ok if you can do something like: |
14 |
|
15 |
kernel_linux? ( || ( a b c ) ) |
16 |
!kernel_linux? ( || ( d e f ) ) |
17 |
|
18 |
(being careful to keep the flags outside of the || ( ) because |
19 |
otherwise crazy stuff happens) but there might not be obvious flags for |
20 |
certain cases. In the worst case, a new USE_EXPAND_HIDDEN thing could |
21 |
be introduced to cover it. |
22 |
|
23 |
There's still that stupid !virtual/blah thing to deal with. Old style |
24 |
virtual providers are allowed to block their own virtual to mean "there |
25 |
must not be any other provider of this installed" (although it's not |
26 |
clear what that means if anything other than a simple !virtual/pkg is |
27 |
used). Anything doing that would now have to explicitly list its own |
28 |
blocks. Arguably, this is a good thing, since you'd have to say exactly |
29 |
what you do and don't work with. |
30 |
|
31 |
There's mention of package.prefer in the GLEP. It's probably not |
32 |
necessary, thanks to the "if something's already installed, go with |
33 |
that" behaviour of || ( ) dependencies -- to 'prefer' a provider, you |
34 |
could just install it first. |
35 |
|
36 |
However, I strongly suspect that all of these are less of a problem |
37 |
than the cost of educating developers in all the weird oddities of how |
38 |
old-style virtuals behave, and how dependencies on old-style virtuals |
39 |
are nothing like normal dependencies... |
40 |
|
41 |
-- |
42 |
Ciaran McCreesh |