From d3490761e11ae308fbd8aaf02059653f579035c5 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 26 Aug 2013 21:15:29 -0400 Subject: [PATCH] Improve check-includes.sh --- src/check-includes.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/check-includes.sh b/src/check-includes.sh index 015f66342..5643c6973 100755 --- a/src/check-includes.sh +++ b/src/check-includes.sh @@ -10,12 +10,10 @@ test "x$HBHEADERS" = x && HBHEADERS=`cd "$srcdir"; find . -maxdepth 1 -name 'hb* test "x$HBSOURCES" = x && HBSOURCES=`cd "$srcdir"; find . -maxdepth 1 -name 'hb-*.cc' -or -name 'hb-*.hh'` -cd "$srcdir" - - echo 'Checking that public header files #include "hb-common.h" or "hb.h" first (or none)' for x in $HBHEADERS; do + test -f "$srcdir/$x" && x="$srcdir/$x" grep '#.*\' "$x" /dev/null | head -n 1 done | grep -v '"hb-common[.]h"' | @@ -28,6 +26,7 @@ grep . >&2 && stat=1 echo 'Checking that source files #include "hb-*private.hh" first (or none)' for x in $HBSOURCES; do + test -f "$srcdir/$x" && x="$srcdir/$x" grep '#.*\' "$x" /dev/null | head -n 1 done | grep -v '"hb-.*private[.]hh"' | @@ -36,7 +35,10 @@ grep . >&2 && stat=1 echo 'Checking that there is no #include ' -grep '#.*\.*<.*hb' $HBHEADERS $HBSOURCES >&2 && stat=1 +for x in $HBHEADERS $HBSOURCES; do + test -f "$srcdir/$x" && x="$srcdir/$x" + grep '#.*\.*<.*hb' "$x" /dev/null >&2 && stat=1 +done exit $stat