1 |
On Tue, 3 Jul 2012 15:44:04 +1200 |
2 |
Kent Fredric <kentfredric@×××××.com> wrote: |
3 |
|
4 |
> Firstly, we already have a ^^( ) syntax for REQUIRED_USE , "one of, |
5 |
> but not more than one of". |
6 |
> |
7 |
> However, to my knowledge, we don't have such for ebuilds. |
8 |
> |
9 |
> Sure, there are ways of implementing this in ebuilds without this |
10 |
> notation, but they're a bit messy. |
11 |
> |
12 |
> For instance, we seem to find the need for something like this in perl |
13 |
> virtuals, |
14 |
> |
15 |
> || ( =dev-lang/perl-$A =perl-core/foo-$B ) |
16 |
> |
17 |
> However, this current form has its limitations: |
18 |
> |
19 |
> 1. If =perl-core/foo-$B was previously installed, satisfying the |
20 |
> condition, and =dev-lang/perl-$A becomes installed, perl-core/foo-$B |
21 |
> then gets ignored, but its still left installed, and not cleaned. |
22 |
|
23 |
--depclean? |
24 |
|
25 |
> 2. Due to the nature of how perl works, any version installed from |
26 |
> perl-core/ will "shadow" the version installed by dev-lang/perl , so |
27 |
> that, despite the virtual being satisfied, the version of the code you |
28 |
> get is unsatisfactory from time to time. ie: |
29 |
> |
30 |
> dev-lang/perl-5.10 might provide 'quux-1.2.3' , as will |
31 |
> perl-core/quux-1.2.3 |
32 |
> |
33 |
> If you were previously on perl-5.8 , ( which only shipped quux-1.1 ) , |
34 |
> and had installed =virtual/perl-quux-1.2.2 , you would have to |
35 |
> install =perl-core/quux-1.2.2 to get "quux-1.2.2" |
36 |
> |
37 |
> Along comes 5.10, and quux-1.2.3 , so we release |
38 |
> virtual/perl-quux-1.2.3 |
39 |
> |
40 |
> || ( =dev-lang/perl-5.10 =perl-core/quux-1.2.3 ) |
41 |
> |
42 |
> ^^ this does what we want most of the time, if you can install |
43 |
> perl-5.10, just do that to get quux 1.2.3, otherwise, install |
44 |
> quux-1.2.3 from perl-core . |
45 |
> |
46 |
> However, in the above case, what happens is virtual/perl-quuux-1.2.3 |
47 |
> is installed, which is satisfied by '=dev-lang/perl-5.10" , and |
48 |
> portage is happy with that. |
49 |
|
50 |
Doesn't perl-cleaner handle perl upgrades for this? And the tested |
51 |
ABI_SLOTs should help with that too. |
52 |
|
53 |
> And then you do 'perl -e 'use quux 1.2.3' # and it barfs saying 1.2.2 |
54 |
> is still installed, which it is, because perl-core/quux-1.2.2 is still |
55 |
> installed, overshadowing the more recent one provided by dev-lang/perl |
56 |
> |
57 |
> Ideally, what we want here is ^^( ), or something like it, so that if |
58 |
> the earlier part is satisfied, latter parts are then removed. |
59 |
> |
60 |
> You *can* represent the same logic with other mechanisms, but its much |
61 |
> much more complex to do so. |
62 |
> |
63 |
> || ( |
64 |
> ( |
65 |
> =dev-lang/perl-5.10 |
66 |
> !<perl-core/quux-1.2.3 |
67 |
> !>perl-core/quux-1.2.3 |
68 |
> ) |
69 |
> ( |
70 |
> !dev-lang/perl-5.10 |
71 |
> =perl-core/quux-1.2.3 |
72 |
> ) |
73 |
> ) |
74 |
> |
75 |
> And I *think* that will do the right thing, I really have no idea. |
76 |
|
77 |
This is a really fragile approach, and is mostly a workaround |
78 |
to the real issue. You want to say «I need *only* one of my |
79 |
dependencies satisfied» while you actually get «if I'm installed, then |
80 |
let every my dependency in those blocks actually block each other». |
81 |
|
82 |
That's just impossible to achieve. Think of ^^ ( foo bar ). When |
83 |
the package gets installed, foo is installed and bar is not. Then you |
84 |
want to emerge bar. What should happen? |
85 |
|
86 |
a) you want portage to refuse to do that. Why would it? AFAIU this |
87 |
would no longer be a problem actually. |
88 |
|
89 |
b) you want portage to do that. But you just forced it unmerge it? It |
90 |
will install the previously made binary package and it's back... |
91 |
|
92 |
c) you want portage to unmerge foo because the dep will now be |
93 |
satisfied by bar. Wait... unmerge perl? |
94 |
|
95 |
> The other approach of course is to make the blockers happen in |
96 |
> dev-lang/perl and perl-core/quux , but this has its own problems. |
97 |
> |
98 |
> For instance, =dev-lang/perl *cannot* specify which versions of |
99 |
> perl-core/quux can and cannot be installed. Because its not *perl* |
100 |
> that is trying to define what version is installed, but the virtual. |
101 |
> |
102 |
> And perl-core/quux can't really block perl , because the whole point |
103 |
> of perl-core/quux is to be installed on perls other than the ones it |
104 |
> was shipped with. |
105 |
> |
106 |
> |
107 |
> ^^( ) seems to nicely help solve this problem, and it seems like an |
108 |
> oversight that we have OR , AND , and NOT dependency rules, but not |
109 |
> XOR. |
110 |
> |
111 |
> P.S. Blame Patrick for this message. |
112 |
> |
113 |
|
114 |
|
115 |
|
116 |
-- |
117 |
Best regards, |
118 |
Michał Górny |