From 33ca3b67bfb5d9ae4e490c796c93793a7e03ef2c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 25 Oct 2017 12:09:11 -0400 Subject: [PATCH] Check for headers in builddir first, in check-*.sh Fixes https://bugs.freedesktop.org/show_bug.cgi?id=103346 --- src/check-c-linkage-decls.sh | 4 ++-- src/check-externs.sh | 2 +- src/check-header-guards.sh | 2 +- src/check-includes.sh | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/check-c-linkage-decls.sh b/src/check-c-linkage-decls.sh index b10310f53..cd550867a 100755 --- a/src/check-c-linkage-decls.sh +++ b/src/check-c-linkage-decls.sh @@ -11,14 +11,14 @@ test "x$HBSOURCES" = x && HBSOURCES=`cd "$srcdir"; find . -maxdepth 1 -name 'hb* for x in $HBHEADERS; do - test -f $srcdir/$x && x=$srcdir/$x + test -f "$srcdir/$x" -a ! -f "$x" && x="$srcdir/$x" if ! grep -q HB_BEGIN_DECLS "$x" || ! grep -q HB_END_DECLS "$x"; then echo "Ouch, file $x does not have HB_BEGIN_DECLS / HB_END_DECLS, but it should" stat=1 fi done for x in $HBSOURCES; do - test -f $srcdir/$x && x=$srcdir/$x + test -f "$srcdir/$x" -a ! -f "$x" && x="$srcdir/$x" if grep -q HB_BEGIN_DECLS "$x" || grep -q HB_END_DECLS "$x"; then echo "Ouch, file $x has HB_BEGIN_DECLS / HB_END_DECLS, but it shouldn't" stat=1 diff --git a/src/check-externs.sh b/src/check-externs.sh index 7f0e3218b..a6de37535 100755 --- a/src/check-externs.sh +++ b/src/check-externs.sh @@ -13,7 +13,7 @@ test "x$EGREP" = x && EGREP='grep -E' echo 'Checking that all public symbols are exported with HB_EXTERN' for x in $HBHEADERS; do - test -f "$srcdir/$x" && x="$srcdir/$x" + test -f "$srcdir/$x" -a ! -f "$x" && x="$srcdir/$x" $EGREP -B1 -n '^hb_' /dev/null "$x" | $EGREP -v '(^--|:hb_|-HB_EXTERN )' -A1 done | diff --git a/src/check-header-guards.sh b/src/check-header-guards.sh index 09c5ea8b2..355d81b52 100755 --- a/src/check-header-guards.sh +++ b/src/check-header-guards.sh @@ -10,7 +10,7 @@ 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'` for x in $HBHEADERS $HBSOURCES; do - test -f "$srcdir/$x" && x="$srcdir/$x" + test -f "$srcdir/$x" -a ! -f "$x" && x="$srcdir/$x" echo "$x" | grep -q '[^h]$' && continue; xx=`echo "$x" | sed 's@.*/@@'` tag=`echo "$xx" | tr 'a-z.-' 'A-Z_'` diff --git a/src/check-includes.sh b/src/check-includes.sh index 902f2357e..37e372d51 100755 --- a/src/check-includes.sh +++ b/src/check-includes.sh @@ -13,7 +13,7 @@ test "x$HBSOURCES" = x && HBSOURCES=`cd "$srcdir"; find . -maxdepth 1 -name 'hb- 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" + test -f "$srcdir/$x" -a ! -f "$x" && x="$srcdir/$x" grep '#.*\' "$x" /dev/null | head -n 1 done | grep -v '"hb-common[.]h"' | @@ -26,7 +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" + test -f "$srcdir/$x" -a ! -f "$x" && x="$srcdir/$x" grep '#.*\' "$x" /dev/null | grep -v 'include _' | head -n 1 done | grep -v '"hb-.*private[.]hh"' |