summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Low <lostlogic@gentoo.org>2003-03-25 07:07:42 +0000
committerBrandon Low <lostlogic@gentoo.org>2003-03-25 07:07:42 +0000
commitf715da92c91344b00578be68160845579b18f9f1 (patch)
tree69d519e9f1610a7212a506d603148728546bc7a9 /eclass/flag-o-matic.eclass
parentchanged SRC_URI to be accurate (diff)
downloadgentoo-2-f715da92c91344b00578be68160845579b18f9f1.tar.gz
gentoo-2-f715da92c91344b00578be68160845579b18f9f1.tar.bz2
gentoo-2-f715da92c91344b00578be68160845579b18f9f1.zip
Fix strip-flags to do greedy matching and not have duplicated matched flags
Diffstat (limited to 'eclass/flag-o-matic.eclass')
-rw-r--r--eclass/flag-o-matic.eclass24
1 files changed, 9 insertions, 15 deletions
diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
index 2ea99921a833..56b0cc377610 100644
--- a/eclass/flag-o-matic.eclass
+++ b/eclass/flag-o-matic.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/flag-o-matic.eclass,v 1.13 2003/03/04 22:07:17 verwilst Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.14 2003/03/25 07:07:42 lostlogic Exp $
#
# Author Bart Verwilst <verwilst@gentoo.org>
@@ -80,14 +80,11 @@ strip-flags() {
do
for y in ${ALLOWED_FLAGS}
do
- if [ "${x/${y}}" != "${x}" ]
+ flag=${x%%=*}
+ if [ "${flag%%${y}}" = "" ]
then
- if [ -z "${NEW_CFLAGS}" ]
- then
- NEW_CFLAGS="${x}"
- else
- NEW_CFLAGS="${NEW_CFLAGS} ${x}"
- fi
+ NEW_CFLAGS="${NEW_CFLAGS} ${x}"
+ break
fi
done
done
@@ -96,14 +93,11 @@ strip-flags() {
do
for y in ${ALLOWED_FLAGS}
do
- if [ "${x/${y}}" != "${x}" ]
+ flag=${x%%=*}
+ if [ "${flag%%${y}}" = "" ]
then
- if [ -z "${NEW_CXXFLAGS}" ]
- then
- NEW_CXXFLAGS="${x}"
- else
- NEW_CXXFLAGS="${NEW_CXXFLAGS} ${x}"
- fi
+ NEW_CXXFLAGS="${NEW_CXXFLAGS} ${x}"
+ break
fi
done
done