public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: ChIIph <chiiph@gmail.com>
To: gentoo-dev@lists.gentoo.org
Subject: [gentoo-dev] Changes to flag-o-matic's _filter-var
Date: Wed, 24 Feb 2010 17:27:21 -0300	[thread overview]
Message-ID: <4B858BA9.2070300@gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 378 bytes --]

Hello everyone,

Here are some minor changes I'd like to propose to flag-o-matic's
_filter-var() to work properly with LDFLAGS.
Without this, things like "-Wl,-O1,--as-needed" won't be affected by any
kind of filter since there are no spaces to separate each flag.

I don't know of any better way to do this, but here's a patch that works
just fine.

Regards,
Tomas

[-- Attachment #1.2: filter.patch --]
[-- Type: text/plain, Size: 649 bytes --]

--- /usr/portage/eclass/flag-o-matic.eclass.old	2010-02-17 16:36:55.000000000 -0300
+++ /usr/portage/eclass/flag-o-matic.eclass	2010-02-24 17:16:30.000000000 -0300
@@ -96,14 +96,20 @@
 	VAR=$1
 	shift
 	eval VAL=\${${VAR}}
-	for f in ${VAL}; do
-		for x in "$@"; do
+	for f in ${VAL//,/ }; do
+		for x in ${@//,/ }; do
 			# Note this should work with globs like -O*
 			[[ ${f} == ${x} ]] && continue 2
 		done
 		eval new\[\${\#new\[@]}]=\${f}
 	done
+
 	eval export ${VAR}=\${new\[*]}
+	
+	if [[ "${VAR}" == "LDFLAGS" ]]; then
+		eval VAL=\${${VAR}}
+		eval export ${VAR}=${VAL// /,}
+	fi
 }
 
 # @FUNCTION: filter-flags

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

             reply	other threads:[~2010-02-24 19:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-24 20:27 ChIIph [this message]
2010-02-24 22:49 ` [gentoo-dev] Re: Changes to flag-o-matic's _filter-var Duncan
2010-03-07  2:27 ` [gentoo-dev] " Mike Frysinger
2010-03-07 17:54   ` ChIIph
2010-03-07 17:50     ` Mike Frysinger
2010-03-07 18:59       ` ChIIph
2010-03-07 18:16         ` Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B858BA9.2070300@gmail.com \
    --to=chiiph@gmail.com \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox