summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonnie Berkholz <spyderous@gentoo.org>2004-02-23 04:45:39 +0000
committerDonnie Berkholz <spyderous@gentoo.org>2004-02-23 04:45:39 +0000
commit4dc06232f23c917473c66c0a38efd615776c985c (patch)
tree01aa9b45ba9fd4b61220d1a1b6353a7f9f7d0dc0 /eclass/xfree.eclass
parentver bump (diff)
downloadgentoo-2-4dc06232f23c917473c66c0a38efd615776c985c.tar.gz
gentoo-2-4dc06232f23c917473c66c0a38efd615776c985c.tar.bz2
gentoo-2-4dc06232f23c917473c66c0a38efd615776c985c.zip
Make arch() more robust. Basically copied from use() in ebuild.sh.
Diffstat (limited to 'eclass/xfree.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
}