[cairo-commit] src/check-includes.sh

Behdad Esfahbod behdad at kemper.freedesktop.org
Sat Sep 20 12:40:27 PDT 2008


 src/check-includes.sh |   34 ++++++++++++++++++++++------------
 1 file changed, 22 insertions(+), 12 deletions(-)

New commits:
commit e00565fa3c9579566abb31b71af3f13f44c45139
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Sep 20 15:38:29 2008 -0400

    [src/check-includes.sh] Check that there is no #include <cairo.*.h>
    
    The correct syntax to include cairo headers from other cairo headers and
    sources is using "...", not <...>.  Check that.

diff --git a/src/check-includes.sh b/src/check-includes.sh
index ead88ef..8cfa260 100755
--- a/src/check-includes.sh
+++ b/src/check-includes.sh
@@ -7,12 +7,19 @@ cd "$srcdir"
 stat=0
 
 
-echo 'Checking that public header files #include "cairo.h" first (or none)'
+HEADERS=$all_cairo_headers
+test "x$HEADERS" = x && HEADERS=`find . -name 'cairo*.h' ! -name 'cairo*-private.h' ! -name 'cairoint.h'`
+
+PRIVATE=$all_cairo_private
+test "x$PRIVATE" = x && PRIVATE=`find . -name 'cairo*-private.h' -or -name 'cairoint.h'`
 
-FILES=$all_cairo_headers
-test "x$FILES" = x && FILES=`find . -name 'cairo*.h' ! -name 'cairo*-private.h' ! -name 'cairoint.h'`
+SOURCES=$all_cairo_sources
+test "x$SOURCES" = x && SOURCES=`find . -name 'cairo*.c' -or -name 'cairo*.cpp'`
 
-for x in $FILES; do
+
+echo 'Checking that public header files #include "cairo.h" first (or none)'
+
+for x in $HEADERS; do
 	grep '\<include\>' "$x" /dev/null | head -n 1
 done |
 grep -v '"cairo[.]h"' |
@@ -22,10 +29,7 @@ grep . && stat=1
 
 echo 'Checking that private header files #include "some cairo header" first (or none)'
 
-FILES=$all_cairo_private
-test "x$FILES" = x && FILES=`find . -name 'cairo*-private.h'`
-
-for x in $FILES; do
+for x in $PRIVATE; do
 	grep '\<include\>' "$x" /dev/null | head -n 1
 done |
 grep -v '"cairo.*[.]h"' |
@@ -35,14 +39,20 @@ grep . && stat=1
 
 echo 'Checking that source files #include "cairoint.h" first (or none)'
 
-FILES=$all_cairo_sources
-test "x$FILES" = x && FILES=`find . -name 'cairo*.c' -or -name 'cairo*.cpp'`
-
-for x in $FILES; do
+for x in $SOURCES; do
 	grep '\<include\>' "$x" /dev/null | head -n 1
 done |
 grep -v '"cairoint[.]h"' |
 grep . && stat=1
 
 
+echo 'Checking that there is no #include <cairo.*.h>'
+
+for x in $HEADERS $PRIVATE $SOURCES; do
+	grep '\<include\>.*<.*cairo' "$x" /dev/null
+done |
+grep . && stat=1
+
+
+
 exit $stat


More information about the cairo-commit mailing list