]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
Fix greedy debug grep
authorPatrick McHardy <kaber@trash.net>
Wed, 10 Jan 2007 13:56:05 +0000 (13:56 +0000)
committerPatrick McHardy <kaber@trash.net>
Wed, 10 Jan 2007 13:56:05 +0000 (13:56 +0000)
From Bugzilla #527:

if you have a kernel with say a '-g' in it, then KERNEL_DIR will include the
'-g' in it, CFLAGS will include the '-g' in it, and then the grep will think you
have -g in your CFLAGS

for example, if you use the grsec or gentoo patchset:
$ uname -r
2.6.19.1-grsec
$ uname -r
2.6.19-gentoo-r2

then your CFLAGS will look like:
-O2 -Wall -Wunused -I"/lib/modules/2.6.19.1-grsec/build"/include -Iinclude/
-DIPTABLES_VERSION=\"1.3.7\"

and the greedy check grep will incorrectly flag this:
egrep -e '-g|-pg|IPTC_DEBUG'

Makefile

index c3e2700782d63bfa26825e5cab2b78b403046a68..81e72d4c43aff25febf73c4c7c2d8945c9fbc9f1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -249,7 +249,7 @@ distrib: check distclean delrelease $(RELEASE_DIR)/iptables-$(IPTABLES_VERSION).
 # -g -pg -DIPTC_DEBUG
 .PHONY: check
 check:
-       @if echo $(CFLAGS) | egrep -e '-g|-pg|IPTC_DEBUG' >/dev/null; then echo Remove debugging flags; exit 1; else exit 0; fi
+       @if echo $(CFLAGS) | egrep -e '(^|[[:space:]])(-g|-pg|-DIPTC_DEBUG)([[:space:]]|$)' >/dev/null; then echo Remove debugging flags; exit 1; else exit 0; fi
 
 .PHONY: nowhitespace
 nowhitespace: