public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] new `usex` helper
@ 2011-09-13 21:56 Mike Frysinger
  2011-09-13 22:01 ` Alec Warner
                   ` (3 more replies)
  0 siblings, 4 replies; 35+ messages in thread
From: Mike Frysinger @ 2011-09-13 21:56 UTC (permalink / raw
  To: gentoo-dev

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

i keep writing little helpers like this in ebuilds:
usex() { use $1 && echo ${2:-yes} || echo ${3:-no} ; }

this is so i can do:
	export some_var=$(usex some_flag)
and get it set to "yes" or "no"

or if i want something a little different, i can do:
	export some_var=$(usex some_flag true false)
	export some_var=$(usex some_flag y n)

useful enough for EAPI ?  or should i just stick it into eutils.eclass ?  OR 
BOTH !?
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2011-09-23  1:16 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-13 21:56 [gentoo-dev] new `usex` helper Mike Frysinger
2011-09-13 22:01 ` Alec Warner
2011-09-13 22:13   ` Mike Frysinger
2011-09-13 23:08     ` Brian Harring
2011-09-14  2:45       ` Mike Frysinger
2011-09-14  3:04         ` Brian Harring
2011-09-14  3:43           ` Mike Frysinger
2011-09-14  3:56             ` Brian Harring
2011-09-14  6:02         ` Ulrich Mueller
2011-09-14 14:53           ` Mike Frysinger
2011-09-14  2:02 ` Donnie Berkholz
2011-09-14  2:14   ` Brian Harring
2011-09-14 19:16     ` Donnie Berkholz
2011-09-15  0:29       ` Brian Harring
2011-09-16  3:00         ` Donnie Berkholz
2011-09-16  9:06           ` Brian Harring
2011-09-16 12:30             ` Donnie Berkholz
2011-09-16 14:04               ` Michał Górny
2011-09-16 17:27                 ` Alec Warner
2011-09-16 20:43               ` Brian Harring
2011-09-18  3:59                 ` Donnie Berkholz
2011-09-18 11:22                   ` Brian Harring
2011-09-19  3:16                     ` Donnie Berkholz
2011-09-20 21:20                       ` Brian Harring
2011-09-21 13:11                         ` Donnie Berkholz
2011-09-21 16:37                           ` Alec Warner
2011-09-23  0:41                             ` Donnie Berkholz
2011-09-23  1:04                               ` Alec Warner
2011-09-23  1:15                                 ` Donnie Berkholz
2011-09-17 21:37             ` Zac Medico
2011-09-14  2:47   ` Mike Frysinger
2011-09-14  5:34   ` Ciaran McCreesh
2011-09-14 19:23     ` Donnie Berkholz
2011-09-14 15:03 ` Mike Frysinger
2011-09-21 19:25 ` Mike Frysinger

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