summaryrefslogtreecommitdiff
path: root/eclass
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
commit5a2eca61035fd121a981e8bde52b13ab526d80c0 (patch)
tree418681bed17fd78e81e268b0a2080e650705d51f /eclass
parentchanged SRC_URI to be accurate (diff)
downloadhistorical-5a2eca61035fd121a981e8bde52b13ab526d80c0.tar.gz
historical-5a2eca61035fd121a981e8bde52b13ab526d80c0.tar.bz2
historical-5a2eca61035fd121a981e8bde52b13ab526d80c0.zip
Fix strip-flags to do greedy matching and not have duplicated matched flags
Diffstat (limited to '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