]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Maintenance script updates (#334)
authorAmos Jeffries <yadij@users.noreply.github.com>
Mon, 19 Nov 2018 12:35:39 +0000 (12:35 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Tue, 20 Nov 2018 08:46:44 +0000 (08:46 +0000)
Fix/workaround some bugs and incorrect errors in the
source-maintenance script.

scripts/source-maintenance.sh

index 22520f29fda8c983a09c2f94ae96c3ee5275736d..ca35d97fd46d3187d733e875fae624dc9c3a4f15 100755 (executable)
@@ -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}`;