From: Amos Jeffries Date: Mon, 19 Nov 2018 12:35:39 +0000 (+0000) Subject: Maintenance script updates (#334) X-Git-Tag: M-staged-PR330~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=14bf2426f73c3c72fad12b59886999c04dab4d8b;p=thirdparty%2Fsquid.git Maintenance script updates (#334) Fix/workaround some bugs and incorrect errors in the source-maintenance script. --- diff --git a/scripts/source-maintenance.sh b/scripts/source-maintenance.sh index 22520f29fd..ca35d97fd4 100755 --- a/scripts/source-maintenance.sh +++ b/scripts/source-maintenance.sh @@ -118,12 +118,12 @@ for FILENAME in `git ls-files`; do # # If a file includes openssl headers, then it must include compat/openssl.h # - if test "${FILENAME}" != "compat/openssl.h" && \ - (FI=`grep "#include.*openssl/" "${FILENAME}" 2>/dev/null`; \ - test "x${FI}" != "x") && \ - (FI=`grep "#include \"compat/openssl\.h\"" "${FILENAME}" 2>/dev/null`; \ - test "x${FI}" == "x"); then - echo "ERROR: ${FILENAME} includes openssl headers without including \"compat/openssl.h\"" + if test "${FILENAME}" != "compat/openssl.h"; then + FA=`grep "#include.*openssl/" "${FILENAME}" 2>/dev/null | head -1`; + FB=`grep '#include.*compat/openssl[.]h' "${FILENAME}" 2>/dev/null | head -1`; + if test "x${FA}" != "x" -a "x${FB}" = "x"; then + echo "ERROR: ${FILENAME} includes openssl headers without including \"compat/openssl.h\"" + fi fi # @@ -141,7 +141,7 @@ for FILENAME in `git ls-files`; do # sprintf() - not allowed anywhere. # STRDUP=`grep -e "[^x]strdup(" ${FILENAME}`; - if test "x${STRDUP}" != "x" -a "${FILENAME}" != "xstring.h"; then + if test "x${STRDUP}" != "x" -a "${FILENAME}" != "compat/xstring.h"; then echo "ERROR: ${FILENAME} contains unprotected use of strdup()" fi SPRINTF=`grep -e "[^v]sprintf(" ${FILENAME}`;