Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-dev
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-dev@g.o
From: Michał Górny <mgorny@g.o>
Subject: [PATCH eutils] Introduce has_iuse() for IUSE checks.
Date: Tue, 13 Sep 2011 12:21:31 +0200
Such checks are used at least in autotools-utils & kde* eclasses, and
are done wrong there. Thus, I've created a little reusable snippet
suitable for eutils.
---
 eclass/eutils.eclass |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass
index cd1f9ff..3d99f92 100644
--- a/eclass/eutils.eclass
+++ b/eclass/eutils.eclass
@@ -2028,3 +2028,18 @@ path_exists() {
 		-o) return $(( r == $# )) ;;
 	esac
 }
+
+# @FUNCTION: has_iuse
+# @USAGE: flag
+# @DESCRIPTION:
+# Determines whether the given flag is in IUSE. Strips IUSE default prefixes
+# as necessary.
+has_iuse() {
+	debug-print-function ${FUNCNAME} "$@"
+	[[ ${#} -eq 1 ]] || die 'Invalid args to has_iuse()'
+
+	local flag=${1}
+	local liuse=( ${IUSE} )
+
+	has "${flag}" "${liuse[@]#[+-]}"
+}
-- 
1.7.6.1



Replies:
Re: [PATCH eutils] Introduce has_iuse() for IUSE checks.
-- Ciaran McCreesh
Re: [PATCH eutils] Introduce has_iuse() for IUSE checks.
-- Michał Górny
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: [gentoo-commits] gentoo-x86 commit in net-analyzer/wireshark: wireshark-1.6.2.ebuild ChangeLog wireshark-1.4.9.ebuild wireshark-1.4.7.ebuild wireshark-1.6.0_rc1.ebuild wireshark-1.4.4.ebuild wireshark-1.4.6-r1.ebuild
Next by thread:
Re: [PATCH eutils] Introduce has_iuse() for IUSE checks.
Previous by date:
Re: Re: [gentoo-commits] gentoo-x86 commit in net-analyzer/wireshark: wireshark-1.6.2.ebuild ChangeLog wireshark-1.4.9.ebuild wireshark-1.4.7.ebuild wireshark-1.6.0_rc1.ebuild wireshark-1.4.4.ebuild wireshark-1.4.6-r1.ebuild
Next by date:
Re: [PATCH eutils] Introduce has_iuse() for IUSE checks.


Updated Jun 29, 2012

Summary: Archive of the gentoo-dev mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.