Gentoo Archives: gentoo-portage-dev

From: Kent Fredric <kentfredric@×××××.com>
To: gentoo-dev@l.g.o, gentoo-portage-dev@l.g.o
Subject: [gentoo-portage-dev] Future EAPI feature Request/RFC: ^^( ) for [RP]?DEPEND
Date: Tue, 03 Jul 2012 06:15:38
Message-Id: CAATnKFCt3sY6VNd8AeMHP-pZEy_kK-034Nm+Ewsu8naftJjb-w@mail.gmail.com
1 Firstly, we already have a ^^( ) syntax for REQUIRED_USE , "one of,
2 but not more than one of".
3
4 However, to my knowledge, we don't have such for ebuilds.
5
6 Sure, there are ways of implementing this in ebuilds without this
7 notation, but they're a bit messy.
8
9 For instance, we seem to find the need for something like this in perl
10 virtuals,
11
12 || ( =dev-lang/perl-$A =perl-core/foo-$B )
13
14 However, this current form has its limitations:
15
16 1. If =perl-core/foo-$B was previously installed, satisfying the
17 condition, and =dev-lang/perl-$A becomes installed, perl-core/foo-$B
18 then gets ignored, but its still left installed, and not cleaned.
19
20 2. Due to the nature of how perl works, any version installed from
21 perl-core/ will "shadow" the version installed by dev-lang/perl , so
22 that, despite the virtual being satisfied, the version of the code you
23 get is unsatisfactory from time to time. ie:
24
25 dev-lang/perl-5.10 might provide 'quux-1.2.3' , as will
26 perl-core/quux-1.2.3
27
28 If you were previously on perl-5.8 , ( which only shipped quux-1.1 ) ,
29 and had installed =virtual/perl-quux-1.2.2 , you would have to
30 install =perl-core/quux-1.2.2 to get "quux-1.2.2"
31
32 Along comes 5.10, and quux-1.2.3 , so we release virtual/perl-quux-1.2.3
33
34 || ( =dev-lang/perl-5.10 =perl-core/quux-1.2.3 )
35
36 ^^ this does what we want most of the time, if you can install
37 perl-5.10, just do that to get quux 1.2.3, otherwise, install
38 quux-1.2.3 from perl-core .
39
40 However, in the above case, what happens is virtual/perl-quuux-1.2.3
41 is installed, which is satisfied by '=dev-lang/perl-5.10" , and
42 portage is happy with that.
43
44 And then you do 'perl -e 'use quux 1.2.3' # and it barfs saying 1.2.2
45 is still installed, which it is, because perl-core/quux-1.2.2 is still
46 installed, overshadowing the more recent one provided by dev-lang/perl
47
48 Ideally, what we want here is ^^( ), or something like it, so that if
49 the earlier part is satisfied, latter parts are then removed.
50
51 You *can* represent the same logic with other mechanisms, but its much
52 much more complex to do so.
53
54 || (
55 (
56 =dev-lang/perl-5.10
57 !<perl-core/quux-1.2.3
58 !>perl-core/quux-1.2.3
59 )
60 (
61 !dev-lang/perl-5.10
62 =perl-core/quux-1.2.3
63 )
64 )
65
66 And I *think* that will do the right thing, I really have no idea.
67
68 The other approach of course is to make the blockers happen in
69 dev-lang/perl and perl-core/quux , but this has its own problems.
70
71 For instance, =dev-lang/perl *cannot* specify which versions of
72 perl-core/quux can and cannot be installed. Because its not *perl*
73 that is trying to define what version is installed, but the virtual.
74
75 And perl-core/quux can't really block perl , because the whole point
76 of perl-core/quux is to be installed on perls other than the ones it
77 was shipped with.
78
79
80 ^^( ) seems to nicely help solve this problem, and it seems like an
81 oversight that we have OR , AND , and NOT dependency rules, but not
82 XOR.
83
84 P.S. Blame Patrick for this message.
85
86 --
87 Kent
88
89 perl -e "print substr( \"edrgmaM SPA NOcomil.ic\\@tfrken\", \$_ * 3,
90 3 ) for ( 9,8,0,7,1,6,5,4,3,2 );"