FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Development

 
 
LinkBack Thread Tools
 
Old 09-19-2012, 10:00 AM
Micha艂 G贸rny
 
Default Generate python depstrings in python-r1.

---
gx86/eclass/python-distutils-ng.eclass | 20 ++------------------
gx86/eclass/python-r1.eclass | 28 ++++++++++++++++++++++++++--
2 files changed, 28 insertions(+), 20 deletions(-)

diff --git a/gx86/eclass/python-distutils-ng.eclass b/gx86/eclass/python-distutils-ng.eclass
index 5df965c..bffe563 100644
--- a/gx86/eclass/python-distutils-ng.eclass
+++ b/gx86/eclass/python-distutils-ng.eclass
@@ -74,24 +74,8 @@ _python-distutils-ng_get_binary_for_implementation() {
esac
}

-for impl in ${PYTHON_COMPAT[@]}; do
- dep_str="${impl/_/.}"
- case "${dep_str}" in
- python?.?)
- dep_str="dev-lang/python:${dep_str: -3}" ;;
- jython?.?)
- dep_str="dev-java/jython:${dep_str: -3}" ;;
- pypy?.?)
- dep_str="dev-python/pypy:${dep_str: -3}" ;;
- *)
- die "Unsupported implementation: ${impl}" ;;
- esac
- dep_str="python_targets_${impl}? ( ${dep_str} )"
-
- RDEPEND="${RDEPEND} ${dep_str}"
- DEPEND="${DEPEND} ${dep_str}"
- unset dep_str
-done
+RDEPEND=${PYTHON_DEPEND}
+DEPEND=${PYTHON_DEPEND}

_PACKAGE_SPECIFIC_S="${S#${WORKDIR}/}"

diff --git a/gx86/eclass/python-r1.eclass b/gx86/eclass/python-r1.eclass
index 18f9246..3017dd8 100644
--- a/gx86/eclass/python-r1.eclass
+++ b/gx86/eclass/python-r1.eclass
@@ -40,14 +40,38 @@ _PYTHON_ALL_IMPLS=(
# a package supports. It must be set before the `inherit' call.
# The default is to enable all implementations.
#
-# PYTHON_COMPAT can be either a scalar or an array. If it's a scalar, the eclass
-# will implicitly convert it to an array.
+# PYTHON_COMPAT can be either a scalar or an array. If it's a scalar,
+# the eclass will implicitly convert it to an array.
: ${PYTHON_COMPAT:=${_PYTHON_ALL_IMPLS[@]}}

+# @ECLASS-VARIABLE: PYTHON_DEPEND
+# @DESCRIPTION:
+# This is an eclass-generated Python dependency string for all
+# implementations listed in PYTHON_COMPAT.
+
PYTHON_COMPAT=( ${PYTHON_COMPAT[@]} )

_python_set_globals() {
IUSE=${PYTHON_COMPAT[@]/#/python_targets_}
REQUIRED_USE="|| ( ${IUSE} )"
+
+ PYTHON_DEPEND=
+ local i
+ for i in ${PYTHON_COMPAT[@]}; do
+ local d
+ case ${i} in
+ python*)
+ d='dev-lang/python';;
+ jython*)
+ d='dev-java/jython';;
+ pypy*)
+ d='dev-python/pypy';;
+ *)
+ die "Invalid implementation: ${i}"
+ esac
+
+ local v=${i##*[a-z]}
+ PYTHON_DEPEND+=" python_targets_${i}? ( ${d}:${v/_/.} )"
+ done
}
_python_set_globals
--
1.7.12
 
Old 09-19-2012, 01:00 PM
Ian Stakenvicius
 
Default Generate python depstrings in python-r1.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 19/09/12 06:00 AM, Micha? G髍ny wrote:
> --- gx86/eclass/python-distutils-ng.eclass | 20
> ++------------------ gx86/eclass/python-r1.eclass | 28
> ++++++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 20
> deletions(-)
>
> diff --git a/gx86/eclass/python-distutils-ng.eclass
> b/gx86/eclass/python-distutils-ng.eclass index 5df965c..bffe563
> 100644 --- a/gx86/eclass/python-distutils-ng.eclass +++
> b/gx86/eclass/python-distutils-ng.eclass @@ -74,24 +74,8 @@
> _python-distutils-ng_get_binary_for_implementation() { esac }
>
> -for impl in ${PYTHON_COMPAT[@]}; do - dep_str="${impl/_/.}" - case
> "${dep_str}" in - python?.?) -
> dep_str="dev-lang/python:${dep_str: -3}" ;; - jython?.?) -
> dep_str="dev-java/jython:${dep_str: -3}" ;; - pypy?.?) -
> dep_str="dev-python/pypy:${dep_str: -3}" ;; - *) - die
> "Unsupported implementation: ${impl}" ;; - esac -
> dep_str="python_targets_${impl}? ( ${dep_str} )" - -
> RDEPEND="${RDEPEND} ${dep_str}" - DEPEND="${DEPEND} ${dep_str}" -
> unset dep_str -done +RDEPEND=${PYTHON_DEPEND}
> +DEPEND=${PYTHON_DEPEND}
>
> _PACKAGE_SPECIFIC_S="${S#${WORKDIR}/}"
>
> diff --git a/gx86/eclass/python-r1.eclass
> b/gx86/eclass/python-r1.eclass index 18f9246..3017dd8 100644 ---
> a/gx86/eclass/python-r1.eclass +++ b/gx86/eclass/python-r1.eclass
> @@ -40,14 +40,38 @@ _PYTHON_ALL_IMPLS=( # a package supports. It
> must be set before the `inherit' call. # The default is to enable
> all implementations. # -# PYTHON_COMPAT can be either a scalar or
> an array. If it's a scalar, the eclass -# will implicitly convert
> it to an array. +# PYTHON_COMPAT can be either a scalar or an
> array. If it's a scalar, +# the eclass will implicitly convert it
> to an array. : ${PYTHON_COMPAT:=${_PYTHON_ALL_IMPLS[@]}}
>
> +# @ECLASS-VARIABLE: PYTHON_DEPEND +# @DESCRIPTION: +# This is an
> eclass-generated Python dependency string for all +#
> implementations listed in PYTHON_COMPAT. + PYTHON_COMPAT=(
> ${PYTHON_COMPAT[@]} )
>
> _python_set_globals() { IUSE=${PYTHON_COMPAT[@]/#/python_targets_}
> REQUIRED_USE="|| ( ${IUSE} )" + + PYTHON_DEPEND= + local i + for i
> in ${PYTHON_COMPAT[@]}; do + local d + case ${i} in + python*)
> + d='dev-lang/python';; + jython*) + d='dev-java/jython';;
> + pypy*) + d='dev-python/pypy';; + *) + die "Invalid
> implementation: ${i}" + esac + + local v=${i##*[a-z]} +
> PYTHON_DEPEND+=" python_targets_${i}? ( ${d}:${v/_/.} )" + done }
> _python_set_globals


I think we really need to use a different variable than
"PYTHON_DEPEND". There are ebuilds that inherit both python.eclass
and python-distutils-ng.eclass and so this will obviously break those
cases.. (that said, I do think that python-r1.eclass should gain
whatever bits it is missing so said inherit on python.eclass isn't
necessary, but that's beside the point)


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)

iF4EAREIAAYFAlBZwgEACgkQ2ugaI38ACPAYCQD/UP8eEcsQygtNdNaXR6fXF1Ef
p4IYbkg/S16F372FM7MBAJkib9wdbK+3Txbvwxik5xxgtfTNmKh9iQl5DH mXRiSC
=Djl7
-----END PGP SIGNATURE-----
 
Old 09-19-2012, 05:37 PM
Micha艂 G贸rny
 
Default Generate python depstrings in python-r1.

On Wed, 19 Sep 2012 09:00:49 -0400
Ian Stakenvicius <axs@gentoo.org> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> On 19/09/12 06:00 AM, Micha? G贸rny wrote:
> > --- gx86/eclass/python-distutils-ng.eclass | 20
> > ++------------------ gx86/eclass/python-r1.eclass | 28
> > ++++++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 20
> > deletions(-)
> >
> > diff --git a/gx86/eclass/python-distutils-ng.eclass
> > b/gx86/eclass/python-distutils-ng.eclass index 5df965c..bffe563
> > 100644 --- a/gx86/eclass/python-distutils-ng.eclass +++
> > b/gx86/eclass/python-distutils-ng.eclass @@ -74,24 +74,8 @@
> > _python-distutils-ng_get_binary_for_implementation() { esac }
> >
> > -for impl in ${PYTHON_COMPAT[@]}; do - dep_str="${impl/_/.}"
> > - case "${dep_str}" in - python?.?) -
> > dep_str="dev-lang/python:${dep_str: -3}" ;; -
> > jython?.?) - dep_str="dev-java/jython:${dep_str: -3}" ;;
> > - pypy?.?) - dep_str="dev-python/pypy:${dep_str:
> > -3}" ;; - *) - die
> > "Unsupported implementation: ${impl}" ;; - esac -
> > dep_str="python_targets_${impl}? ( ${dep_str} )" - -
> > RDEPEND="${RDEPEND} ${dep_str}" - DEPEND="${DEPEND}
> > ${dep_str}" - unset dep_str -done +RDEPEND=${PYTHON_DEPEND}
> > +DEPEND=${PYTHON_DEPEND}
> >
> > _PACKAGE_SPECIFIC_S="${S#${WORKDIR}/}"
> >
> > diff --git a/gx86/eclass/python-r1.eclass
> > b/gx86/eclass/python-r1.eclass index 18f9246..3017dd8 100644 ---
> > a/gx86/eclass/python-r1.eclass +++ b/gx86/eclass/python-r1.eclass
> > @@ -40,14 +40,38 @@ _PYTHON_ALL_IMPLS=( # a package supports. It
> > must be set before the `inherit' call. # The default is to enable
> > all implementations. # -# PYTHON_COMPAT can be either a scalar or
> > an array. If it's a scalar, the eclass -# will implicitly convert
> > it to an array. +# PYTHON_COMPAT can be either a scalar or an
> > array. If it's a scalar, +# the eclass will implicitly convert it
> > to an array. : ${PYTHON_COMPAT:=${_PYTHON_ALL_IMPLS[@]}}
> >
> > +# @ECLASS-VARIABLE: PYTHON_DEPEND +# @DESCRIPTION: +# This is an
> > eclass-generated Python dependency string for all +#
> > implementations listed in PYTHON_COMPAT. + PYTHON_COMPAT=(
> > ${PYTHON_COMPAT[@]} )
> >
> > _python_set_globals() { IUSE=${PYTHON_COMPAT[@]/#/python_targets_}
> > REQUIRED_USE="|| ( ${IUSE} )" + + PYTHON_DEPEND= +
> > local i + for i in ${PYTHON_COMPAT[@]}; do +
> > local d + case ${i} in +
> > python*)
> > + d='dev-lang/python';;
> > + jython*) +
> > d='dev-java/jython';;
> > + pypy*) +
> > d='dev-python/pypy';; + *)
> > + die "Invalid implementation: ${i}"
> > + esac + + local v=${i##*[a-z]} +
> > PYTHON_DEPEND+=" python_targets_${i}? ( ${d}:${v/_/.} )" +
> > done } _python_set_globals
>
>
> I think we really need to use a different variable than
> "PYTHON_DEPEND". There are ebuilds that inherit both python.eclass
> and python-distutils-ng.eclass and so this will obviously break those
> cases.. (that said, I do think that python-r1.eclass should gain
> whatever bits it is missing so said inherit on python.eclass isn't
> necessary, but that's beside the point)

I'm not sure if we shouldn't forbid inheriting both eclasses. That's
a bit risky, at least. And it's very likely that someone is doing
something very wrong and not noticing the failure yet.

--
Best regards,
Micha艂 G贸rny
 
Old 09-19-2012, 05:58 PM
Ian Stakenvicius
 
Default Generate python depstrings in python-r1.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 19/09/12 01:37 PM, Micha艂 G贸rny wrote:
> On Wed, 19 Sep 2012 09:00:49 -0400 Ian Stakenvicius
> <axs@gentoo.org> wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
>>
>> On 19/09/12 06:00 AM, Micha? G贸rny wrote:
>>> --- gx86/eclass/python-distutils-ng.eclass | 20
>>> ++------------------ gx86/eclass/python-r1.eclass |
>>> 28 ++++++++++++++++++++++++++-- 2 files changed, 28
>>> insertions(+), 20 deletions(-)
>>>
>>> diff --git a/gx86/eclass/python-distutils-ng.eclass
>>> b/gx86/eclass/python-distutils-ng.eclass index
>>> 5df965c..bffe563 100644 ---
>>> a/gx86/eclass/python-distutils-ng.eclass +++
>>> b/gx86/eclass/python-distutils-ng.eclass @@ -74,24 +74,8 @@
>>> _python-distutils-ng_get_binary_for_implementation() { esac }
>>>
>>> -for impl in ${PYTHON_COMPAT[@]}; do - dep_str="${impl/_/.}" -
>>> case "${dep_str}" in - python?.?) -
>>> dep_str="dev-lang/python:${dep_str: -3}" ;; - jython?.?) -
>>> dep_str="dev-java/jython:${dep_str: -3}" ;; - pypy?.?) -
>>> dep_str="dev-python/pypy:${dep_str: -3}" ;; - *) - die
>>> "Unsupported implementation: ${impl}" ;; - esac -
>>> dep_str="python_targets_${impl}? ( ${dep_str} )" - -
>>> RDEPEND="${RDEPEND} ${dep_str}" - DEPEND="${DEPEND} ${dep_str}"
>>> - unset dep_str -done +RDEPEND=${PYTHON_DEPEND}
>>> +DEPEND=${PYTHON_DEPEND}
>>>
>>> _PACKAGE_SPECIFIC_S="${S#${WORKDIR}/}"
>>>
>>> diff --git a/gx86/eclass/python-r1.eclass
>>> b/gx86/eclass/python-r1.eclass index 18f9246..3017dd8 100644
>>> --- a/gx86/eclass/python-r1.eclass +++
>>> b/gx86/eclass/python-r1.eclass @@ -40,14 +40,38 @@
>>> _PYTHON_ALL_IMPLS=( # a package supports. It must be set before
>>> the `inherit' call. # The default is to enable all
>>> implementations. # -# PYTHON_COMPAT can be either a scalar or
>>> an array. If it's a scalar, the eclass -# will implicitly
>>> convert it to an array. +# PYTHON_COMPAT can be either a scalar
>>> or an array. If it's a scalar, +# the eclass will implicitly
>>> convert it to an array. :
>>> ${PYTHON_COMPAT:=${_PYTHON_ALL_IMPLS[@]}}
>>>
>>> +# @ECLASS-VARIABLE: PYTHON_DEPEND +# @DESCRIPTION: +# This is
>>> an eclass-generated Python dependency string for all +#
>>> implementations listed in PYTHON_COMPAT. + PYTHON_COMPAT=(
>>> ${PYTHON_COMPAT[@]} )
>>>
>>> _python_set_globals() {
>>> IUSE=${PYTHON_COMPAT[@]/#/python_targets_} REQUIRED_USE="|| (
>>> ${IUSE} )" + + PYTHON_DEPEND= + local i + for i in
>>> ${PYTHON_COMPAT[@]}; do + local d + case ${i} in + python*) +
>>> d='dev-lang/python';; + jython*) + d='dev-java/jython';; +
>>> pypy*) + d='dev-python/pypy';; + *) + die "Invalid
>>> implementation: ${i}" + esac + + local v=${i##*[a-z]} +
>>> PYTHON_DEPEND+=" python_targets_${i}? ( ${d}:${v/_/.} )" + done
>>> } _python_set_globals
>>
>>
>> I think we really need to use a different variable than
>> "PYTHON_DEPEND". There are ebuilds that inherit both
>> python.eclass and python-distutils-ng.eclass and so this will
>> obviously break those cases.. (that said, I do think that
>> python-r1.eclass should gain whatever bits it is missing so said
>> inherit on python.eclass isn't necessary, but that's beside the
>> point)
>
> I'm not sure if we shouldn't forbid inheriting both eclasses.
> That's a bit risky, at least. And it's very likely that someone is
> doing something very wrong and not noticing the failure yet.
>

We can forbid a double-inherit, but that doesn't mean we should allow
PYTHON_DEPEND to be overloaded with two different meanings.

I would recommend instead to use 'PYTHON_DEPS'; it's different, and is
a more generic name which would seem to fit better when appended to
either/both DEPEND and RDEPEND.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)

iF4EAREIAAYFAlBaB74ACgkQ2ugaI38ACPD4mwD/e++PURTyeBoeFZodadFVDBYh
tBIuTaDFeuR7+PKNgPwA/1WFz8urK1ErpDLWTVsLqIUZra0L0RFG5/d+8jr3DPVQ
=bZPZ
-----END PGP SIGNATURE-----
 
Old 09-19-2012, 06:40 PM
Micha艂 G贸rny
 
Default Generate python depstrings in python-r1.

On Wed, 19 Sep 2012 13:58:22 -0400
Ian Stakenvicius <axs@gentoo.org> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> On 19/09/12 01:37 PM, Micha艂 G贸rny wrote:
> > On Wed, 19 Sep 2012 09:00:49 -0400 Ian Stakenvicius
> > <axs@gentoo.org> wrote:
> >
> >> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
> >>
> >> On 19/09/12 06:00 AM, Micha? G贸rny wrote:
> >>> --- gx86/eclass/python-distutils-ng.eclass | 20
> >>> ++------------------ gx86/eclass/python-r1.eclass |
> >>> 28 ++++++++++++++++++++++++++-- 2 files changed, 28
> >>> insertions(+), 20 deletions(-)
> >>>
> >>> diff --git a/gx86/eclass/python-distutils-ng.eclass
> >>> b/gx86/eclass/python-distutils-ng.eclass index
> >>> 5df965c..bffe563 100644 ---
> >>> a/gx86/eclass/python-distutils-ng.eclass +++
> >>> b/gx86/eclass/python-distutils-ng.eclass @@ -74,24 +74,8 @@
> >>> _python-distutils-ng_get_binary_for_implementation() { esac }
> >>>
> >>> -for impl in ${PYTHON_COMPAT[@]}; do -
> >>> dep_str="${impl/_/.}" - case "${dep_str}" in -
> >>> python?.?) - dep_str="dev-lang/python:${dep_str: -3}" ;; -
> >>> jython?.?) - dep_str="dev-java/jython:${dep_str: -3}" ;;
> >>> - pypy?.?) - dep_str="dev-python/pypy:${dep_str:
> >>> -3}" ;; - *) - die
> >>> "Unsupported implementation: ${impl}" ;; - esac -
> >>> dep_str="python_targets_${impl}? ( ${dep_str} )" - -
> >>> RDEPEND="${RDEPEND} ${dep_str}" - DEPEND="${DEPEND}
> >>> ${dep_str}"
> >>> - unset dep_str -done +RDEPEND=${PYTHON_DEPEND}
> >>> +DEPEND=${PYTHON_DEPEND}
> >>>
> >>> _PACKAGE_SPECIFIC_S="${S#${WORKDIR}/}"
> >>>
> >>> diff --git a/gx86/eclass/python-r1.eclass
> >>> b/gx86/eclass/python-r1.eclass index 18f9246..3017dd8 100644
> >>> --- a/gx86/eclass/python-r1.eclass +++
> >>> b/gx86/eclass/python-r1.eclass @@ -40,14 +40,38 @@
> >>> _PYTHON_ALL_IMPLS=( # a package supports. It must be set before
> >>> the `inherit' call. # The default is to enable all
> >>> implementations. # -# PYTHON_COMPAT can be either a scalar or
> >>> an array. If it's a scalar, the eclass -# will implicitly
> >>> convert it to an array. +# PYTHON_COMPAT can be either a scalar
> >>> or an array. If it's a scalar, +# the eclass will implicitly
> >>> convert it to an array. :
> >>> ${PYTHON_COMPAT:=${_PYTHON_ALL_IMPLS[@]}}
> >>>
> >>> +# @ECLASS-VARIABLE: PYTHON_DEPEND +# @DESCRIPTION: +# This is
> >>> an eclass-generated Python dependency string for all +#
> >>> implementations listed in PYTHON_COMPAT. + PYTHON_COMPAT=(
> >>> ${PYTHON_COMPAT[@]} )
> >>>
> >>> _python_set_globals() {
> >>> IUSE=${PYTHON_COMPAT[@]/#/python_targets_} REQUIRED_USE="|| (
> >>> ${IUSE} )" + + PYTHON_DEPEND= + local i + for i in
> >>> ${PYTHON_COMPAT[@]}; do + local d + case ${i} in +
> >>> python*) + d='dev-lang/python';; +
> >>> jython*) + d='dev-java/jython';; + pypy*) + d='dev-python/pypy';;
> >>> + *) + die
> >>> "Invalid implementation: ${i}" + esac +
> >>> + local v=${i##*[a-z]} + PYTHON_DEPEND+="
> >>> python_targets_${i}? ( ${d}:${v/_/.} )" + done }
> >>> _python_set_globals
> >>
> >>
> >> I think we really need to use a different variable than
> >> "PYTHON_DEPEND". There are ebuilds that inherit both
> >> python.eclass and python-distutils-ng.eclass and so this will
> >> obviously break those cases.. (that said, I do think that
> >> python-r1.eclass should gain whatever bits it is missing so said
> >> inherit on python.eclass isn't necessary, but that's beside the
> >> point)
> >
> > I'm not sure if we shouldn't forbid inheriting both eclasses.
> > That's a bit risky, at least. And it's very likely that someone is
> > doing something very wrong and not noticing the failure yet.
> >
>
> We can forbid a double-inherit, but that doesn't mean we should allow
> PYTHON_DEPEND to be overloaded with two different meanings.
>
> I would recommend instead to use 'PYTHON_DEPS'; it's different, and is
> a more generic name which would seem to fit better when appended to
> either/both DEPEND and RDEPEND.

PYDEPEND :>.

--
Best regards,
Micha艂 G贸rny
 

Thread Tools




All times are GMT. The time now is 03:26 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org