Gentoo Archives: gentoo-dev

From: "Michael Sterrett -Mr. Bones.-" <msterret@××××.com>
To: Eldad Zack <eldad@g.o>
Cc: gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: CUSTOM cflags replacement snippet
Date: Sat, 20 Nov 2004 11:49:28
Message-Id: Pine.LNX.4.58.0411200646460.24610@rutrow.coat.com
In Reply to: Re: [gentoo-dev] CUSTOM cflags replacement snippet by Eldad Zack
1 On Sat, 20 Nov 2004, Eldad Zack wrote:
2
3 > for makefile in $(find -name "Makefile" .)
4 > do
5 > sed -i \
6 > -e "s:^CFLAGS.*:CFLAGS = ${CFLAGS}:" \
7 > -e "s:^CXXFLAGS.*:CXXFLAGS = ${CXXFLAGS}:" \
8 > ${makefile} \
9 > || die "Could not patch ${makefile} for custom CFLAGS"
10 > done
11
12 This stuff all fails if C*FLAGS has a ':' in it. There's a bug about
13 bad sed like this in bugzilla.
14
15 Also, sed takes a list. So never loop when you can just pass all the files
16 to sed. And don't forget about filenames with whitespace in the name...
17
18 Michael Sterrett
19 -Mr. Bones.-
20 mr_bones_@g.o
21
22 --
23 gentoo-dev@g.o mailing list