From: George Shapovalov Date: Mon, 5 Feb 2007 11:02:09 +0000 (+0000) Subject: some enhansements necessary for extracting gnat locations for libs that need access... X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=54c0f4262c8624bf1ab186e3fb88ff64db44f44a;p=gentoo.git some enhansements necessary for extracting gnat locations for libs that need access to proper dirs --- diff --git a/eclass/gnat.eclass b/eclass/gnat.eclass index 63a87813355f..16c180897f0b 100644 --- a/eclass/gnat.eclass +++ b/eclass/gnat.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.19 2006/06/15 15:20:26 george Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.20 2007/02/05 11:02:09 george Exp $ # # Author: George Shapovalov # Belongs to: ada herd @@ -126,6 +126,7 @@ get_gnat_Arch() { # The purpose of this one is to remove all parts of the env entry specific to a # given lib. Usefull when some lib wants to act differently upon detecting # itself installed.. +# # params: # $1 - name of env var to process # $2 (opt) - name of the lib to filter out (defaults to ${PN}) @@ -143,6 +144,18 @@ filter_env_var() { echo ${env_str} } +# A simpler helper, for the libs that need to extract active gnat location +# Returns a first entry for a specified env var. Relies on the (presently true) +# convention that first gnat's entries are listed and then of the other +# installed libs. +# +# params: +# $1 - name of env var to process +get_gnat_value() { + local entries=(${!1//:/ }) + echo ${entries[0]} +} + # ------------------------------------ # Functions