Gentoo Archives: gentoo-dev

From: Mike Gilbert <floppym@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Fix spurious dep to eselect-python
Date: Tue, 20 Mar 2012 21:33:58
Message-Id: CAJ0EP40=VRbC9Hjn5KOcM413njw0COo_9wSNcJFkwKvxxbLubA@mail.gmail.com
In Reply to: Re: [gentoo-dev] Fix spurious dep to eselect-python by Alexis Ballier
1 On Tue, Mar 20, 2012 at 5:20 PM, Alexis Ballier <aballier@g.o> wrote:
2 > On Tue, 20 Mar 2012 17:09:55 -0400
3 > Mike Gilbert <floppym@g.o> wrote:
4 >
5 >> On Tue, Mar 20, 2012 at 5:05 PM, Alexis Ballier <aballier@g.o>
6 >> wrote:
7 >> > On Tue, 20 Mar 2012 17:57:29 -0300
8 >> > Alexis Ballier <aballier@g.o> wrote:
9 >> >
10 >> >> On Tue, 20 Mar 2012 20:35:17 +0100
11 >> >> Arfrever Frehtes Taifersar Arahesis <arfrever@g.o> wrote:
12 >> >>
13 >> >> > 2012-03-20 17:53:56 Michał Górny napisał(a):
14 >> >> > > On Tue, 20 Mar 2012 17:41:39 +0100
15 >> >> > > Arfrever Frehtes Taifersar Arahesis <arfrever@g.o>
16 >> >> > > wrote:
17 >> >> > >
18 >> >> > > > 2012-03-20 05:29:20 Luca Barbato napisał(a):
19 >> >> > > > > Hi, I tried to avoid depending on eselect-python if the
20 >> >> > > > > useflag is disabled.
21 >> >> > > > >
22 >> >> > > > > Please test and review.
23 >> >> > > >
24 >> >> > > > The proper fix is to make python.eclass add dependency on
25 >> >> > > > app-admin/eselect-python only when ${CATEGORY}/${PN} is
26 >> >> > > > dev-lang/python, dev-java/jython or dev-python/pypy. See bug
27 >> >> > > > #341037.
28 >> >> > >
29 >> >> > > Couldn't we just push that dependency to the specific ebuilds?
30 >> >> >
31 >> >> > We want to control required version (>=20091230 in case of
32 >> >> > app-admin/eselect-python) in 1 place.
33 >> >> >
34 >> >>
35 >> >> this can be achieved by setting a variable that said ebuilds will
36 >> >> append to (R)DEPEND; no need for complex 'if then else' on CAT/PN
37 >> >> in an eclass for this.
38 >> >>
39 >> >
40 >> > or also by adding a new python-implementation.eclass instead of
41 >> > polluting an eclass used by hundreds of packages for only 3 special
42 >> > ones...
43 >> >
44 >>
45 >> A four-way if-then statement is not what I would call "complex". This
46 >> was already present in the eclass anyway, so there is no additional
47 >> "pollution".
48 >
49 > a four-way if-then with pattern matching / strcmp is slower than a
50 > constant variable assignment; it could matter when this is done
51 > everytime an ebuild inheriting it is sourced. it probably doesnt, but
52 > imho, its good practice to keep global scope code in eclasses as simple
53 > as possible.
54 >
55
56 Ah right. It is now being executed in global scope, so there is a
57 slight performance degradation there. Point taken.