]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Source Maintenance: enforce #include statement block ordering
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 24 Oct 2013 17:45:00 +0000 (11:45 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 24 Oct 2013 17:45:00 +0000 (11:45 -0600)
This uses the include ordering sort script to enforce blocks of include
statements being in alphasymbolic order with squid.h at teh top if it is
present.

scripts/source-maintenance.sh

index 4004476265a894cbd4e5097851a9b7f80e91bcb2..0ecb756d986dcd214ef3a3a187e9073edd0b2584 100755 (executable)
@@ -67,6 +67,17 @@ for FILENAME in `ls -1`; do
                fi
        fi
 
+       ${ROOT}/scripts/sort-includes.pl ${FILENAME} >${FILENAME}.sorted
+       if test -e ${FILENAME} -a -e "${FILENAME}.sorted"; then
+               md51=`cat  ${FILENAME}| tr -d "\n \t\r" | $MD5`;
+               md52=`cat  ${FILENAME}.sorted| tr -d "\n \t\r" | $MD5`;
+
+               if test "$md51" != "$md52" ; then
+                       echo "NOTICE: File $PWD/${FILENAME} changed #include order"
+               fi
+               mv ${FILENAME}.sorted ${FILENAME}
+       fi
+
        #
        # REQUIRE squid.h first #include
        #