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 |