Re: [gentoo-dev] huse: new helper for low level eclass writers

2011-10-26 Thread Mike Frysinger
hopefully i didn't break anything before i go to sleep ;D
http://sources.gentoo.org/eclass/toolchain.eclass?r1=1.474r2=1.475
http://sources.gentoo.org/eclass/eutils.eclass?r1=1.366r2=1.367
-mike



Re: [gentoo-dev] huse: new helper for low level eclass writers

2011-10-20 Thread Donnie Berkholz
On 01:26 Thu 20 Oct , Mike Frysinger wrote:
 On Wednesday 19 October 2011 15:40:50 Brian Harring wrote:
  Name's a bit off though considering if the host was amd64, `huse amd64`
  would return 1 since it's not in IUSE.
 
 good point.  how about iuse_use ?  or use_iuse ?
 -mike

use_in_iuse ?

-- 
Thanks,
Donnie

Donnie Berkholz
Council Member / Sr. Developer
Gentoo Linux
Blog: http://dberkholz.com


pgpZNI8F46o3g.pgp
Description: PGP signature


Re: [gentoo-dev] huse: new helper for low level eclass writers

2011-10-20 Thread Mike Frysinger
On Thursday 20 October 2011 11:58:44 Donnie Berkholz wrote:
 On 01:26 Thu 20 Oct , Mike Frysinger wrote:
  On Wednesday 19 October 2011 15:40:50 Brian Harring wrote:
   Name's a bit off though considering if the host was amd64, `huse amd64`
   would return 1 since it's not in IUSE.
  
  good point.  how about iuse_use ?  or use_iuse ?
 
 use_in_iuse ?

to me, that sounds like is the use flag in iuse.  but maybe i'm over thinking 
things.
-mike


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-dev] huse: new helper for low level eclass writers

2011-10-20 Thread Donnie Berkholz
On 12:22 Thu 20 Oct , Mike Frysinger wrote:
 On Thursday 20 October 2011 11:58:44 Donnie Berkholz wrote:
  On 01:26 Thu 20 Oct , Mike Frysinger wrote:
   On Wednesday 19 October 2011 15:40:50 Brian Harring wrote:
Name's a bit off though considering if the host was amd64, `huse amd64`
would return 1 since it's not in IUSE.
   
   good point.  how about iuse_use ?  or use_iuse ?
  
  use_in_iuse ?
 
 to me, that sounds like is the use flag in iuse.  but maybe i'm over 
 thinking 
 things.

alright, use_if_iuse. That's my last bikeshed for today.


-- 
Thanks,
Donnie

Donnie Berkholz
Council Member / Sr. Developer
Gentoo Linux
Blog: http://dberkholz.com


pgpdYd1xNOUgU.pgp
Description: PGP signature


Re: [gentoo-dev] huse: new helper for low level eclass writers

2011-10-20 Thread Paweł Hajdan, Jr.
On 10/20/11 9:22 PM, Donnie Berkholz wrote:
 alright, use_if_iuse. That's my last bikeshed for today.

I think this is the best one. I didn't really like any of the previously
proposed names, but this one is good.



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-dev] huse: new helper for low level eclass writers

2011-10-20 Thread Mike Frysinger
On Thursday 20 October 2011 16:01:01 Paweł Hajdan, Jr. wrote:
 On 10/20/11 9:22 PM, Donnie Berkholz wrote:
  alright, use_if_iuse. That's my last bikeshed for today.
 
 I think this is the best one. I didn't really like any of the previously
 proposed names, but this one is good.

yeah, this works for me too

i'll commit this later if there's no more feedback
-mike


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-dev] huse: new helper for low level eclass writers

2011-10-19 Thread Mike Frysinger
On Wednesday 19 October 2011 14:05:50 Mike Frysinger wrote:
 now that we have in_iuse in eutils.eclass (with all the caveats), i'll be
 adding huse:
   huse() {
   in_iuse $1 || return 1
   use $1
   }

actually, after posting this, iuse is probably a better name.  huse came 
up because the code constructs i was using before was like:
has foo ${IUSE}  use foo  .
which collapses into:
h[as foo ${IUSE}  ]use foo  ...
huse foo  ...

so new proposal for those who love 1 liners:
iuse() { in_iuse $1  use $1 || return 1 ; }
-mike


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-dev] huse: new helper for low level eclass writers

2011-10-19 Thread Brian Harring
On Wed, Oct 19, 2011 at 02:05:50PM -0400, Mike Frysinger wrote:
 i wrote a new func for toolchain.eclass: huse.  this is because the 
 toolchain.eclass supports multiple versions in parallel, and the IUSE value 
 can vary greatly between them.  so doing `use foo` without checking IUSE 
 first 
 doesn't work.  since i got a request to use this in other eclasses (for the 
 same reason), i figured i'd move it to eutils.eclass so more people can 
 benefit.
 
 now that we have in_iuse in eutils.eclass (with all the caveats), i'll be 
 adding huse:
   huse() {
   in_iuse $1 || return 1
   use $1
   }
 
 any comments before i publish ?

Call it safe_use.
~brian



Re: [gentoo-dev] huse: new helper for low level eclass writers

2011-10-19 Thread Mike Frysinger
On Wednesday 19 October 2011 14:53:07 Brian Harring wrote:
 On Wed, Oct 19, 2011 at 02:05:50PM -0400, Mike Frysinger wrote:
  i wrote a new func for toolchain.eclass: huse.  this is because the
  toolchain.eclass supports multiple versions in parallel, and the IUSE
  value can vary greatly between them.  so doing `use foo` without
  checking IUSE first doesn't work.  since i got a request to use this in
  other eclasses (for the same reason), i figured i'd move it to
  eutils.eclass so more people can benefit.
  
  now that we have in_iuse in eutils.eclass (with all the caveats), i'll
  be
  
  adding huse:
  huse() {
  
  in_iuse $1 || return 1
  use $1
  
  }
  
  any comments before i publish ?
 
 Call it safe_use.

safe for who ?  that implies to me much more vagueness than iuse ...
-mike


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-dev] huse: new helper for low level eclass writers

2011-10-19 Thread Brian Harring
On Wed, Oct 19, 2011 at 03:26:21PM -0400, Mike Frysinger wrote:
 On Wednesday 19 October 2011 14:53:07 Brian Harring wrote:
  On Wed, Oct 19, 2011 at 02:05:50PM -0400, Mike Frysinger wrote:
   i wrote a new func for toolchain.eclass: huse.  this is because the
   toolchain.eclass supports multiple versions in parallel, and the IUSE
   value can vary greatly between them.  so doing `use foo` without
   checking IUSE first doesn't work.  since i got a request to use this in
   other eclasses (for the same reason), i figured i'd move it to
   eutils.eclass so more people can benefit.
   
   now that we have in_iuse in eutils.eclass (with all the caveats), i'll
   be
   
   adding huse:
 huse() {
 
 in_iuse $1 || return 1
 use $1
 
 }
   
   any comments before i publish ?
  
  Call it safe_use.
 
 safe for who ?  that implies to me much more vagueness than iuse ...

Safe in the sense it does basic IUSE checks prior, so it doesn't 
trigger QA warnings for when the ebuild doesn't support the flag.

Name's a bit off though considering if the host was amd64, `huse amd64`
would return 1 since it's not in IUSE.

Either way, the 'iuse' naming rather sucks imo; that implies the 
equivalent of `use` (is this flag in iuse?) rather than is this flag 
in iuse and use.

If you're primarily doing this to bypass the QA warnings, than jam 
safe into the name, and/or while making sure the docs are clear about 
it.

Either way, go nuts- rather not get into a bikeshedding discussion on 
this one. ;)
~harring



Re: [gentoo-dev] huse: new helper for low level eclass writers

2011-10-19 Thread Michał Górny
On Wed, 19 Oct 2011 11:53:07 -0700
Brian Harring ferri...@gmail.com wrote:

 On Wed, Oct 19, 2011 at 02:05:50PM -0400, Mike Frysinger wrote:
  i wrote a new func for toolchain.eclass: huse.  this is because the 
  toolchain.eclass supports multiple versions in parallel, and the
  IUSE value can vary greatly between them.  so doing `use foo`
  without checking IUSE first doesn't work.  since i got a request to
  use this in other eclasses (for the same reason), i figured i'd
  move it to eutils.eclass so more people can benefit.
  
  now that we have in_iuse in eutils.eclass (with all the caveats),
  i'll be adding huse:
  huse() {
  in_iuse $1 || return 1
  use $1
  }
  
  any comments before i publish ?
 
 Call it safe_use.

Maybe something off 'default' instead? It could be made a little like
USE defaults, falling back to the default value when USE isn't declared.

-- 
Best regards,
Michał Górny


signature.asc
Description: PGP signature


Re: [gentoo-dev] huse: new helper for low level eclass writers

2011-10-19 Thread Mike Frysinger
On Wednesday 19 October 2011 15:40:50 Brian Harring wrote:
 Name's a bit off though considering if the host was amd64, `huse amd64`
 would return 1 since it's not in IUSE.

good point.  how about iuse_use ?  or use_iuse ?
-mike


signature.asc
Description: This is a digitally signed message part.