public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] patch eutils.eclass for EAPI 5
@ 2012-09-27 16:49 Ulrich Mueller
  2012-09-27 17:07 ` Zac Medico
  0 siblings, 1 reply; 10+ messages in thread
From: Ulrich Mueller @ 2012-09-27 16:49 UTC (permalink / raw
  To: gentoo-dev

As far as I can see, only the definition of the usex function must be
disabled. Please review the patch included below.

Ulrich

--- eutils.eclass	15 Sep 2012 16:16:53 -0000	1.403
+++ eutils.eclass	27 Sep 2012 16:45:14 -0000
@@ -1373,7 +1373,9 @@
 # @DESCRIPTION:
 # If USE flag is set, echo [true output][true suffix] (defaults to "yes"),
 # otherwise echo [false output][false suffix] (defaults to "no").
+if has "${EAPI:-0}" 0 1 2 3 4; then
 usex() { use "$1" && echo "${2-yes}$4" || echo "${3-no}$5" ; } #382963
+fi
 
 # @FUNCTION: prune_libtool_files
 # @USAGE: [--all]


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] patch eutils.eclass for EAPI 5
  2012-09-27 16:49 [gentoo-dev] patch eutils.eclass for EAPI 5 Ulrich Mueller
@ 2012-09-27 17:07 ` Zac Medico
  2012-09-27 17:16   ` Ian Stakenvicius
  2012-09-27 17:23   ` Zac Medico
  0 siblings, 2 replies; 10+ messages in thread
From: Zac Medico @ 2012-09-27 17:07 UTC (permalink / raw
  To: gentoo-dev; +Cc: Ulrich Mueller

On 09/27/2012 09:49 AM, Ulrich Mueller wrote:
> As far as I can see, only the definition of the usex function must be
> disabled. Please review the patch included below.
> 
> Ulrich
> 
> --- eutils.eclass	15 Sep 2012 16:16:53 -0000	1.403
> +++ eutils.eclass	27 Sep 2012 16:45:14 -0000
> @@ -1373,7 +1373,9 @@
>  # @DESCRIPTION:
>  # If USE flag is set, echo [true output][true suffix] (defaults to "yes"),
>  # otherwise echo [false output][false suffix] (defaults to "no").
> +if has "${EAPI:-0}" 0 1 2 3 4; then
>  usex() { use "$1" && echo "${2-yes}$4" || echo "${3-no}$5" ; } #382963
> +fi
>  
>  # @FUNCTION: prune_libtool_files
>  # @USAGE: [--all]
> 

Looks good to me.

It may not work for unofficial EAPIs that don't include usex, but I
guess there's nothing we can do for those, and they can just be replaced
with newer EAPIs that include usex.
-- 
Thanks,
Zac


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] patch eutils.eclass for EAPI 5
  2012-09-27 17:07 ` Zac Medico
@ 2012-09-27 17:16   ` Ian Stakenvicius
  2012-09-27 17:30     ` Zac Medico
  2012-09-28 14:32     ` Jeroen Roovers
  2012-09-27 17:23   ` Zac Medico
  1 sibling, 2 replies; 10+ messages in thread
From: Ian Stakenvicius @ 2012-09-27 17:16 UTC (permalink / raw
  To: gentoo-dev

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

On 27/09/12 01:07 PM, Zac Medico wrote:
> On 09/27/2012 09:49 AM, Ulrich Mueller wrote:
>> As far as I can see, only the definition of the usex function
>> must be disabled. Please review the patch included below.
>> 
>> Ulrich
>> 
>> --- eutils.eclass	15 Sep 2012 16:16:53 -0000	1.403 +++
>> eutils.eclass	27 Sep 2012 16:45:14 -0000 @@ -1373,7 +1373,9 @@ #
>> @DESCRIPTION: # If USE flag is set, echo [true output][true
>> suffix] (defaults to "yes"), # otherwise echo [false
>> output][false suffix] (defaults to "no"). +if has "${EAPI:-0}" 0
>> 1 2 3 4; then usex() { use "$1" && echo "${2-yes}$4" || echo
>> "${3-no}$5" ; } #382963 +fi
>> 
>> # @FUNCTION: prune_libtool_files # @USAGE: [--all]
>> 
> 
> Looks good to me.
> 
> It may not work for unofficial EAPIs that don't include usex, but
> I guess there's nothing we can do for those, and they can just be
> replaced with newer EAPIs that include usex.

....i actually just committed the fix discussed in #gentoo-dev , using
'declare -F' instead (similar to the eqawarn conditional declaration
already in eutils.eclass)


Sorry..

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

iF4EAREIAAYFAlBkif0ACgkQ2ugaI38ACPDcvgEAudN0ErAB8aZkjtdiTK309NV0
01UWERp6vSQsvTmaVUwA/1LBd9ddbgGUpiqwvDCYzYR1rbgiA+7a6vzU9mmzZpil
=RdnN
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] patch eutils.eclass for EAPI 5
  2012-09-27 17:07 ` Zac Medico
  2012-09-27 17:16   ` Ian Stakenvicius
@ 2012-09-27 17:23   ` Zac Medico
  2012-09-28 15:28     ` [gentoo-dev] " Ulrich Mueller
  2012-09-29 15:57     ` [gentoo-dev] " Ciaran McCreesh
  1 sibling, 2 replies; 10+ messages in thread
From: Zac Medico @ 2012-09-27 17:23 UTC (permalink / raw
  To: gentoo-dev; +Cc: Ulrich Mueller

On 09/27/2012 10:07 AM, Zac Medico wrote:
> On 09/27/2012 09:49 AM, Ulrich Mueller wrote:
>> As far as I can see, only the definition of the usex function must be
>> disabled. Please review the patch included below.
>>
>> Ulrich
>>
>> --- eutils.eclass	15 Sep 2012 16:16:53 -0000	1.403
>> +++ eutils.eclass	27 Sep 2012 16:45:14 -0000
>> @@ -1373,7 +1373,9 @@
>>  # @DESCRIPTION:
>>  # If USE flag is set, echo [true output][true suffix] (defaults to "yes"),
>>  # otherwise echo [false output][false suffix] (defaults to "no").
>> +if has "${EAPI:-0}" 0 1 2 3 4; then
>>  usex() { use "$1" && echo "${2-yes}$4" || echo "${3-no}$5" ; } #382963
>> +fi
>>  
>>  # @FUNCTION: prune_libtool_files
>>  # @USAGE: [--all]
>>
> 
> Looks good to me.
> 
> It may not work for unofficial EAPIs that don't include usex, but I
> guess there's nothing we can do for those, and they can just be replaced
> with newer EAPIs that include usex.

Something like this would work with current versions of portage:

if ! declare -F usex >/dev/null ; then
	usex() { use "$1" && echo "${2-yes}$4" || echo "${3-no}$5" ; }
fi

However, it's probably not a good idea to assume that the package
manager defines usex prior to sourcing the eclass.
-- 
Thanks,
Zac


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] patch eutils.eclass for EAPI 5
  2012-09-27 17:16   ` Ian Stakenvicius
@ 2012-09-27 17:30     ` Zac Medico
  2012-09-27 17:53       ` Brian Harring
  2012-09-28 14:32     ` Jeroen Roovers
  1 sibling, 1 reply; 10+ messages in thread
From: Zac Medico @ 2012-09-27 17:30 UTC (permalink / raw
  To: gentoo-dev; +Cc: Ian Stakenvicius

On 09/27/2012 10:16 AM, Ian Stakenvicius wrote:
> On 27/09/12 01:07 PM, Zac Medico wrote:
>> On 09/27/2012 09:49 AM, Ulrich Mueller wrote:
>>> As far as I can see, only the definition of the usex function
>>> must be disabled. Please review the patch included below.
>>>
>>> Ulrich
>>>
>>> --- eutils.eclass	15 Sep 2012 16:16:53 -0000	1.403 +++
>>> eutils.eclass	27 Sep 2012 16:45:14 -0000 @@ -1373,7 +1373,9 @@ #
>>> @DESCRIPTION: # If USE flag is set, echo [true output][true
>>> suffix] (defaults to "yes"), # otherwise echo [false
>>> output][false suffix] (defaults to "no"). +if has "${EAPI:-0}" 0
>>> 1 2 3 4; then usex() { use "$1" && echo "${2-yes}$4" || echo
>>> "${3-no}$5" ; } #382963 +fi
>>>
>>> # @FUNCTION: prune_libtool_files # @USAGE: [--all]
>>>
> 
>> Looks good to me.
> 
>> It may not work for unofficial EAPIs that don't include usex, but
>> I guess there's nothing we can do for those, and they can just be
>> replaced with newer EAPIs that include usex.
> 
> ....i actually just committed the fix discussed in #gentoo-dev , using
> 'declare -F' instead (similar to the eqawarn conditional declaration
> already in eutils.eclass)
> 
> 
> Sorry..

It's fine with me, but some of the other package manager devs might
object, since it makes assumptions about implementation details.
-- 
Thanks,
Zac


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] patch eutils.eclass for EAPI 5
  2012-09-27 17:30     ` Zac Medico
@ 2012-09-27 17:53       ` Brian Harring
  0 siblings, 0 replies; 10+ messages in thread
From: Brian Harring @ 2012-09-27 17:53 UTC (permalink / raw
  To: gentoo-dev; +Cc: Ian Stakenvicius

On Thu, Sep 27, 2012 at 10:30:21AM -0700, Zac Medico wrote:
> On 09/27/2012 10:16 AM, Ian Stakenvicius wrote:
> > On 27/09/12 01:07 PM, Zac Medico wrote:
> >> On 09/27/2012 09:49 AM, Ulrich Mueller wrote:
> >>> As far as I can see, only the definition of the usex function
> >>> must be disabled. Please review the patch included below.
> >>>
> >>> Ulrich
> >>>
> >>> --- eutils.eclass	15 Sep 2012 16:16:53 -0000	1.403 +++
> >>> eutils.eclass	27 Sep 2012 16:45:14 -0000 @@ -1373,7 +1373,9 @@ #
> >>> @DESCRIPTION: # If USE flag is set, echo [true output][true
> >>> suffix] (defaults to "yes"), # otherwise echo [false
> >>> output][false suffix] (defaults to "no"). +if has "${EAPI:-0}" 0
> >>> 1 2 3 4; then usex() { use "$1" && echo "${2-yes}$4" || echo
> >>> "${3-no}$5" ; } #382963 +fi
> >>>
> >>> # @FUNCTION: prune_libtool_files # @USAGE: [--all]
> >>>
> > 
> >> Looks good to me.
> > 
> >> It may not work for unofficial EAPIs that don't include usex, but
> >> I guess there's nothing we can do for those, and they can just be
> >> replaced with newer EAPIs that include usex.
> > 
> > ....i actually just committed the fix discussed in #gentoo-dev , using
> > 'declare -F' instead (similar to the eqawarn conditional declaration
> > already in eutils.eclass)
> > 
> > 
> > Sorry..
> 
> It's fine with me, but some of the other package manager devs might
> object, since it makes assumptions about implementation details.

PMS isn't particular clear on the metadata sourcing env for EAPIs- 
especially after the requirement that we pull the EAPI out of the file 
on the fly was aded.

Point is, if it's EAPI5 the env should already export usex- even if 
it's disabled- so case/esac is better imo.
~harring


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] patch eutils.eclass for EAPI 5
  2012-09-27 17:16   ` Ian Stakenvicius
  2012-09-27 17:30     ` Zac Medico
@ 2012-09-28 14:32     ` Jeroen Roovers
  2012-09-28 17:08       ` Ian Stakenvicius
  1 sibling, 1 reply; 10+ messages in thread
From: Jeroen Roovers @ 2012-09-28 14:32 UTC (permalink / raw
  To: gentoo-dev

On Thu, 27 Sep 2012 13:16:45 -0400
Ian Stakenvicius <axs@gentoo.org> wrote:

> ....i actually just committed the fix discussed in #gentoo-dev , using
> 'declare -F' instead (similar to the eqawarn conditional declaration
> already in eutils.eclass)

You forgot to add an entry to eclass/ChangeLog.


     jer


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [gentoo-dev] Re: patch eutils.eclass for EAPI 5
  2012-09-27 17:23   ` Zac Medico
@ 2012-09-28 15:28     ` Ulrich Mueller
  2012-09-29 15:57     ` [gentoo-dev] " Ciaran McCreesh
  1 sibling, 0 replies; 10+ messages in thread
From: Ulrich Mueller @ 2012-09-28 15:28 UTC (permalink / raw
  To: gentoo-dev

>>>>> On Thu, 27 Sep 2012, Zac Medico wrote:

>>> --- eutils.eclass	15 Sep 2012 16:16:53 -0000	1.403
>>> +++ eutils.eclass	27 Sep 2012 16:45:14 -0000
>>> @@ -1373,7 +1373,9 @@
>>>  # @DESCRIPTION:
>>>  # If USE flag is set, echo [true output][true suffix] (defaults to "yes"),
>>>  # otherwise echo [false output][false suffix] (defaults to "no").
>>> +if has "${EAPI:-0}" 0 1 2 3 4; then
>>>  usex() { use "$1" && echo "${2-yes}$4" || echo "${3-no}$5" ; } #382963
>>> +fi
>>>  
>>>  # @FUNCTION: prune_libtool_files
>>>  # @USAGE: [--all]

>> Looks good to me.

>> It may not work for unofficial EAPIs that don't include usex, but I
>> guess there's nothing we can do for those, and they can just be
>> replaced with newer EAPIs that include usex.

> Something like this would work with current versions of portage:

> if ! declare -F usex >/dev/null ; then
>    usex() { use "$1" && echo "${2-yes}$4" || echo "${3-no}$5" ; }
> fi

> However, it's probably not a good idea to assume that the package
> manager defines usex prior to sourcing the eclass.

I agree, and I've replaced the declare -F by the explicit EAPI test
from the above patch.

Ulrich


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] patch eutils.eclass for EAPI 5
  2012-09-28 14:32     ` Jeroen Roovers
@ 2012-09-28 17:08       ` Ian Stakenvicius
  0 siblings, 0 replies; 10+ messages in thread
From: Ian Stakenvicius @ 2012-09-28 17:08 UTC (permalink / raw
  To: gentoo-dev

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

On 28/09/12 10:32 AM, Jeroen Roovers wrote:
> On Thu, 27 Sep 2012 13:16:45 -0400 Ian Stakenvicius
> <axs@gentoo.org> wrote:
> 
>> ....i actually just committed the fix discussed in #gentoo-dev ,
>> using 'declare -F' instead (similar to the eqawarn conditional
>> declaration already in eutils.eclass)
> 
> You forgot to add an entry to eclass/ChangeLog.
> 
> 
> jer
> 


..should have been one.. I ran echangelog and a blanket cvs commit to
submit it.  *shrug*

Will double-check the commit next time and fix the ChangeLog if it
didn't work.

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

iF4EAREIAAYFAlBl2XEACgkQ2ugaI38ACPCYwwD/WDVp/5Mm7QJqaKDJQ8QDKT2S
NciA/t5yzRXp7oMYdygA/0HxrtuIn6ju+OnSwv3r07X00HOMtH8l9wrRE3/jmjOU
=Nlqd
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] patch eutils.eclass for EAPI 5
  2012-09-27 17:23   ` Zac Medico
  2012-09-28 15:28     ` [gentoo-dev] " Ulrich Mueller
@ 2012-09-29 15:57     ` Ciaran McCreesh
  1 sibling, 0 replies; 10+ messages in thread
From: Ciaran McCreesh @ 2012-09-29 15:57 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 478 bytes --]

On Thu, 27 Sep 2012 10:23:50 -0700
Zac Medico <zmedico@gentoo.org> wrote:
> Something like this would work with current versions of portage:
> 
> if ! declare -F usex >/dev/null ; then
> 	usex() { use "$1" && echo "${2-yes}$4" || echo "${3-no}$5" ; }
> fi
> 
> However, it's probably not a good idea to assume that the package
> manager defines usex prior to sourcing the eclass.

It's also not a good idea to assume that usex is a function.

-- 
Ciaran McCreesh

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-09-29 16:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-27 16:49 [gentoo-dev] patch eutils.eclass for EAPI 5 Ulrich Mueller
2012-09-27 17:07 ` Zac Medico
2012-09-27 17:16   ` Ian Stakenvicius
2012-09-27 17:30     ` Zac Medico
2012-09-27 17:53       ` Brian Harring
2012-09-28 14:32     ` Jeroen Roovers
2012-09-28 17:08       ` Ian Stakenvicius
2012-09-27 17:23   ` Zac Medico
2012-09-28 15:28     ` [gentoo-dev] " Ulrich Mueller
2012-09-29 15:57     ` [gentoo-dev] " Ciaran McCreesh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox