1 |
On Wed, 19 Sep 2012 09:00:49 -0400 |
2 |
Ian Stakenvicius <axs@g.o> wrote: |
3 |
|
4 |
> -----BEGIN PGP SIGNED MESSAGE----- |
5 |
> Hash: SHA256 |
6 |
> |
7 |
> On 19/09/12 06:00 AM, Micha? Górny wrote: |
8 |
> > --- gx86/eclass/python-distutils-ng.eclass | 20 |
9 |
> > ++------------------ gx86/eclass/python-r1.eclass | 28 |
10 |
> > ++++++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 20 |
11 |
> > deletions(-) |
12 |
> > |
13 |
> > diff --git a/gx86/eclass/python-distutils-ng.eclass |
14 |
> > b/gx86/eclass/python-distutils-ng.eclass index 5df965c..bffe563 |
15 |
> > 100644 --- a/gx86/eclass/python-distutils-ng.eclass +++ |
16 |
> > b/gx86/eclass/python-distutils-ng.eclass @@ -74,24 +74,8 @@ |
17 |
> > _python-distutils-ng_get_binary_for_implementation() { esac } |
18 |
> > |
19 |
> > -for impl in ${PYTHON_COMPAT[@]}; do - dep_str="${impl/_/.}" |
20 |
> > - case "${dep_str}" in - python?.?) - |
21 |
> > dep_str="dev-lang/python:${dep_str: -3}" ;; - |
22 |
> > jython?.?) - dep_str="dev-java/jython:${dep_str: -3}" ;; |
23 |
> > - pypy?.?) - dep_str="dev-python/pypy:${dep_str: |
24 |
> > -3}" ;; - *) - die |
25 |
> > "Unsupported implementation: ${impl}" ;; - esac - |
26 |
> > dep_str="python_targets_${impl}? ( ${dep_str} )" - - |
27 |
> > RDEPEND="${RDEPEND} ${dep_str}" - DEPEND="${DEPEND} |
28 |
> > ${dep_str}" - unset dep_str -done +RDEPEND=${PYTHON_DEPEND} |
29 |
> > +DEPEND=${PYTHON_DEPEND} |
30 |
> > |
31 |
> > _PACKAGE_SPECIFIC_S="${S#${WORKDIR}/}" |
32 |
> > |
33 |
> > diff --git a/gx86/eclass/python-r1.eclass |
34 |
> > b/gx86/eclass/python-r1.eclass index 18f9246..3017dd8 100644 --- |
35 |
> > a/gx86/eclass/python-r1.eclass +++ b/gx86/eclass/python-r1.eclass |
36 |
> > @@ -40,14 +40,38 @@ _PYTHON_ALL_IMPLS=( # a package supports. It |
37 |
> > must be set before the `inherit' call. # The default is to enable |
38 |
> > all implementations. # -# PYTHON_COMPAT can be either a scalar or |
39 |
> > an array. If it's a scalar, the eclass -# will implicitly convert |
40 |
> > it to an array. +# PYTHON_COMPAT can be either a scalar or an |
41 |
> > array. If it's a scalar, +# the eclass will implicitly convert it |
42 |
> > to an array. : ${PYTHON_COMPAT:=${_PYTHON_ALL_IMPLS[@]}} |
43 |
> > |
44 |
> > +# @ECLASS-VARIABLE: PYTHON_DEPEND +# @DESCRIPTION: +# This is an |
45 |
> > eclass-generated Python dependency string for all +# |
46 |
> > implementations listed in PYTHON_COMPAT. + PYTHON_COMPAT=( |
47 |
> > ${PYTHON_COMPAT[@]} ) |
48 |
> > |
49 |
> > _python_set_globals() { IUSE=${PYTHON_COMPAT[@]/#/python_targets_} |
50 |
> > REQUIRED_USE="|| ( ${IUSE} )" + + PYTHON_DEPEND= + |
51 |
> > local i + for i in ${PYTHON_COMPAT[@]}; do + |
52 |
> > local d + case ${i} in + |
53 |
> > python*) |
54 |
> > + d='dev-lang/python';; |
55 |
> > + jython*) + |
56 |
> > d='dev-java/jython';; |
57 |
> > + pypy*) + |
58 |
> > d='dev-python/pypy';; + *) |
59 |
> > + die "Invalid implementation: ${i}" |
60 |
> > + esac + + local v=${i##*[a-z]} + |
61 |
> > PYTHON_DEPEND+=" python_targets_${i}? ( ${d}:${v/_/.} )" + |
62 |
> > done } _python_set_globals |
63 |
> |
64 |
> |
65 |
> I think we really need to use a different variable than |
66 |
> "PYTHON_DEPEND". There are ebuilds that inherit both python.eclass |
67 |
> and python-distutils-ng.eclass and so this will obviously break those |
68 |
> cases.. (that said, I do think that python-r1.eclass should gain |
69 |
> whatever bits it is missing so said inherit on python.eclass isn't |
70 |
> necessary, but that's beside the point) |
71 |
|
72 |
I'm not sure if we shouldn't forbid inheriting both eclasses. That's |
73 |
a bit risky, at least. And it's very likely that someone is doing |
74 |
something very wrong and not noticing the failure yet. |
75 |
|
76 |
-- |
77 |
Best regards, |
78 |
Michał Górny |