From e1bb9c14e50844cf3449a3f5c62ef3e8c1fde1e8 Mon Sep 17 00:00:00 2001 From: George Shapovalov Date: Thu, 22 Feb 2007 15:50:48 +0000 Subject: [PATCH] fixed utility funcs --- eclass/gnat.eclass | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/eclass/gnat.eclass b/eclass/gnat.eclass index 9b366422250f..254e9d3306d9 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.21 2007/02/05 13:21:57 george Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.22 2007/02/22 15:50:48 george Exp $ # # Author: George Shapovalov # Belongs to: ada herd @@ -83,15 +83,15 @@ expand_BuildEnv() { # may be moved to a seperate eclas, if enough accumulated inthis one and in # gnatbuild.eclass.. -# get_all_profile_components splits gnat profile and returns array of its components: -# x86_64-pc-linux-gnu-gnat-gcc-4.1 -> x86_64-pc-linux-gnu-gnat gcc 4.1 +# get_all_profile_components splits gnat profile and returns pace separated list of its components: +# x86_64-pc-linux-gnu-gnat-gcc-4.1 -> x86_64-pc-linux-gnu gcc 4.1 # params: # $1 - the string to split get_all_profile_components() { local GnatSLOT=${1##*-} local remainder=${1%-*} - local GnatPkg=${reminder##*-} - remainder=${1%-*} + local GnatPkg=${remainder##*-} + remainder=${remainder%-gnat-*} echo "${remainder} ${GnatPkg} ${GnatSLOT}" } @@ -108,8 +108,8 @@ get_gnat_SLOT() { # params: # $1 - the string to extract the slot from get_gnat_Pkg() { - local items=(get_all_profile_components $1) - echo ${items[1]} + local remainder=${1%-*} + echo "${remainder##*-}" } # returns only Arch component: @@ -117,8 +117,7 @@ get_gnat_Pkg() { # params: # $1 - the string to extract the slot from get_gnat_Arch() { - local items=(get_all_profile_components $1) - echo ${items[0]} + echo ${1%-gnat-*} } -- 2.26.2