summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorGeorge Shapovalov <george@gentoo.org>2007-02-22 15:50:48 +0000
committerGeorge Shapovalov <george@gentoo.org>2007-02-22 15:50:48 +0000
commit92ed462c0deaefea122eb74fbabc25de68d29c98 (patch)
tree55ba0011e3943cc38af8fd0771ef58bc9a9d7b6a /eclass
parentudev-start,shop.sh now work with any shell (diff)
downloadgentoo-2-92ed462c0deaefea122eb74fbabc25de68d29c98.tar.gz
gentoo-2-92ed462c0deaefea122eb74fbabc25de68d29c98.tar.bz2
gentoo-2-92ed462c0deaefea122eb74fbabc25de68d29c98.zip
fixed utility funcs
Diffstat (limited to 'eclass')
-rw-r--r--eclass/gnat.eclass17
1 files 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 <george@gentoo.org>
# Belongs to: ada herd <ada@gentoo.org>
@@ -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-*}
}