From: Scott Kostyshak Date: Fri, 3 May 2013 05:41:43 +0000 (-0400) Subject: header_check.sh: allow exclusion of common headers X-Git-Tag: 2.1.0beta1~308 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=33b0cff2f32691dbb4d6279cf9afbb087c74d4d0;p=lyx.git header_check.sh: allow exclusion of common headers Continuing to address #6305 --- diff --git a/development/tools/header_check.sh b/development/tools/header_check.sh index f80fa72612..88fec324b9 100644 --- a/development/tools/header_check.sh +++ b/development/tools/header_check.sh @@ -28,6 +28,10 @@ LOG_FILE="$(basename $0).log" # For all headers: # PATTERN='^#include' +# Exclude common headers with regex +# (e.g. 'debug.h' will exclude 'support/debug.h') +EXCLUDE='\(debug.h\|cstdio\)' + function BUILD_FN () { # This is not a clean make. @@ -48,10 +52,12 @@ do grep "${PATTERN}" "${FILE_}" | \ while read INCLUDE do - cp "${FILE_COPY}" "${FILE_}" \ - || { echo "ERROR: restore copy failed" >&2; exit 1; } - sed -i "s@${INCLUDE}@@" "${FILE_}" - ( BUILD_FN ) &>/dev/null && echo "${FILE_}::${INCLUDE}" >> "${LOG_FILE}" + if echo "${INCLUDE}" | grep -q -v "${EXCLUDE}"; then + cp "${FILE_COPY}" "${FILE_}" \ + || { echo "ERROR: restore copy failed" >&2; exit 1; } + sed -i "s@${INCLUDE}@@" "${FILE_}" + ( BUILD_FN ) &>/dev/null && echo "${FILE_}::${INCLUDE}" >> "${LOG_FILE}" + fi done cp "${FILE_COPY}" "${FILE_}" done