/[gentoo-x86]/eclass/flag-o-matic.eclass
Gentoo

Diff of /eclass/flag-o-matic.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.108 Revision 1.109
1# Copyright 1999-2006 Gentoo Foundation 1# Copyright 1999-2006 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.108 2006/06/15 14:45:59 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.109 2006/07/16 05:49:47 vapier Exp $
4# 4#
5# Maintainer: base-system@gentoo.org 5# Maintainer: base-system@gentoo.org
6 6
7# need access to emktemp() 7# need access to emktemp()
8inherit eutils toolchain-funcs multilib 8inherit eutils toolchain-funcs multilib
265 265
266filter-mfpmath() { 266filter-mfpmath() {
267 local orig_mfpmath new_math prune_math 267 local orig_mfpmath new_math prune_math
268 268
269 # save the original -mfpmath flag 269 # save the original -mfpmath flag
270 orig_mfpmath="`get-flag -mfpmath`" 270 orig_mfpmath=$(get-flag -mfpmath)
271 # get the value of the current -mfpmath flag 271 # get the value of the current -mfpmath flag
272 new_math=" `get-flag mfpmath | tr , ' '` " 272 new_math=$(get-flag mfpmath)
273 new_math=" ${new_math//,/ } "
273 # figure out which math values are to be removed 274 # figure out which math values are to be removed
274 prune_math="" 275 prune_math=""
275 for prune_math in "$@" ; do 276 for prune_math in "$@" ; do
276 new_math="${new_math/ ${prune_math} / }" 277 new_math=${new_math/ ${prune_math} / }
277 done 278 done
278 new_math="`echo ${new_math:1:${#new_math}-2} | tr ' ' ,`" 279 new_math=$(echo ${new_math})
280 new_math=${new_math// /,}
279 281
280 if [ -z "${new_math}" ] ; then 282 if [[ -z ${new_math} ]] ; then
281 # if we're removing all user specified math values are 283 # if we're removing all user specified math values are
282 # slated for removal, then we just filter the flag 284 # slated for removal, then we just filter the flag
283 filter-flags ${orig_mfpmath} 285 filter-flags ${orig_mfpmath}
284 else 286 else
285 # if we only want to filter some of the user specified 287 # if we only want to filter some of the user specified

Legend:
Removed from v.1.108  
changed lines
  Added in v.1.109

  ViewVC Help
Powered by ViewVC 1.1.20