some enhansements necessary for extracting gnat locations for libs that need access...
authorGeorge Shapovalov <george@gentoo.org>
Mon, 5 Feb 2007 11:02:09 +0000 (11:02 +0000)
committerGeorge Shapovalov <george@gentoo.org>
Mon, 5 Feb 2007 11:02:09 +0000 (11:02 +0000)
eclass/gnat.eclass

index 63a87813355f4f6468773636a9464cf94f50261c..16c180897f0bcc9a0f9594e2f555b4975a978194 100644 (file)
@@ -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 <george@gentoo.org>
 # Belongs to: ada herd <ada@gentoo.org>
@@ -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