From: Amos Jeffries Date: Thu, 24 Oct 2013 17:45:00 +0000 (-0600) Subject: Source Maintenance: enforce #include statement block ordering X-Git-Tag: SQUID_3_5_0_1~586 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=987ca90eb34e5c482bacfe752ef56b0095874f02;p=thirdparty%2Fsquid.git Source Maintenance: enforce #include statement block ordering 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. --- diff --git a/scripts/source-maintenance.sh b/scripts/source-maintenance.sh index 4004476265..0ecb756d98 100755 --- a/scripts/source-maintenance.sh +++ b/scripts/source-maintenance.sh @@ -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 #