summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorDonnie Berkholz <dberkholz@gentoo.org>2004-02-23 04:45:39 +0000
committerDonnie Berkholz <dberkholz@gentoo.org>2004-02-23 04:45:39 +0000
commit2217c6ba4ef8e7b9ebc450c07021fe7596076aa5 (patch)
tree0794f99c1b2fb81348f6795755e52a8824f6af17 /eclass
parentver bump (diff)
downloadhistorical-2217c6ba4ef8e7b9ebc450c07021fe7596076aa5.tar.gz
historical-2217c6ba4ef8e7b9ebc450c07021fe7596076aa5.tar.bz2
historical-2217c6ba4ef8e7b9ebc450c07021fe7596076aa5.zip
Make arch() more robust. Basically copied from use() in ebuild.sh.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/xfree.eclass32
1 files changed, 30 insertions, 2 deletions
diff --git a/eclass/xfree.eclass b/eclass/xfree.eclass
index cfad1b238aa1..8d86a989b734 100644
--- a/eclass/xfree.eclass
+++ b/eclass/xfree.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/xfree.eclass,v 1.17 2004/02/21 23:33:07 spyderous Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/xfree.eclass,v 1.18 2004/02/23 04:45:39 spyderous Exp $
#
# Author: Seemant Kulleen <seemant@gentoo.org>
#
@@ -107,5 +107,33 @@ strip_bins() {
}
arch() {
- [ "${ARCH}" = "${1}" ]
+ if archq ${1}; then
+ echo "${1}"
+ return 0
+ fi
+ return 1
+}
+
+archq() {
+ local u="${1}"
+ local neg=0
+ if [ "${u:0:1}" == "!" ]; then
+ u="${u:1}"
+ neg=1
+ fi
+ local x
+ for x in ${ARCH}; do
+ if [ "${x}" == "${u}" ]; then
+ if [ ${neg} -eq 1 ]; then
+ return 1
+ else
+ return 0
+ fi
+ fi
+ done
+ if [ ${neg} -eq 1 ]; then
+ return 0
+ else
+ return 1
+ fi
}