From: Amos Jeffries Date: Sat, 13 Sep 2014 16:46:45 +0000 (+1200) Subject: Source Maintenance: fix various maintenance script issues X-Git-Tag: SQUID_3_5_0_1~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5fbc3e1ddf3728d511808815a97e63679de58f06;p=thirdparty%2Fsquid.git Source Maintenance: fix various maintenance script issues * ensure auto-generated .list are sorted, instead of ad-hoc system dependent ordering which can cause needless updates. * grep only paths with *.* (usually files) instead of all items in each directory. This avoids scanning sub-directory indexes with grep, which produces fatal errors on some systems. * add check for Squid Software Foundation copyright blurb and highlight files needing attention. --- diff --git a/scripts/source-maintenance.sh b/scripts/source-maintenance.sh index 1d950866c9..2f229f8f3a 100755 --- a/scripts/source-maintenance.sh +++ b/scripts/source-maintenance.sh @@ -46,7 +46,7 @@ PWD=`pwd` # # Scan for incorrect use of #ifdef/#ifndef # -grep -E "ifn?def .*_SQUID_" ./* | grep -v -E "_H$" | while read f; do echo "PROBLEM?: ${PWD} ${f}"; done +grep -E "ifn?def .*_SQUID_" ./*.* | grep -v -E "_H$" | while read f; do echo "PROBLEM?: ${PWD} ${f}"; done # # Scan for file-specific actions @@ -131,7 +131,7 @@ for FILENAME in `ls -1`; do # # DEBUG Section list maintenance # - grep " DEBUG: section" <${FILENAME} | sed -e 's/ \* DEBUG: //' >>${ROOT}/doc/debug-sections.tmp + grep " DEBUG: section" <${FILENAME} | sed -e 's/ \* DEBUG: //' -e 's%/\* DEBUG: %%' -e 's% \*/%%' | sort -u >>${ROOT}/doc/debug-sections.tmp # # File permissions maintenance. @@ -154,6 +154,14 @@ for FILENAME in `ls -1`; do esac + # check for Foundation copyright blurb + if test -f ${PWD}/${FILENAME}; then + BLURB=`grep "The Squid Software Foundation and contributors" ${FILENAME}`; + if test "x${BLURB}" = "x"; then + echo "CHECK COPYRIGHT for ${PWD}/${FILENAME}" + fi + fi + if test "$FILENAME" = "libltdl" ; then : elif test -d $FILENAME ; then @@ -181,7 +189,7 @@ mv ${ROOT}/lib/profiler/list ${ROOT}/lib/profiler/xprof_type.h # Build icons install include from current icons available ( echo -n "ICONS=" -for f in `ls -1 ${ROOT}/icons/silk/*` +for f in `ls -1 ${ROOT}/icons/silk/* | sort -u` do echo " \\" echo -n " ${f}" @@ -192,7 +200,7 @@ echo " " # Build templates install include from current templates available ( echo -n "ERROR_TEMPLATES=" -for f in `ls -1 ${ROOT}/errors/templates/ERR_*` +for f in `ls -1 ${ROOT}/errors/templates/ERR_* | sort -u` do echo " \\" echo -n " ${f}" @@ -203,7 +211,7 @@ echo " " # Build errors translation install include from current .PO available ( echo -n "TRANSLATE_LANGUAGES=" -for f in `ls -1 ${ROOT}/errors/*.po` +for f in `ls -1 ${ROOT}/errors/*.po | sort -u` do echo " \\" echo -n " ${f}" @@ -214,7 +222,7 @@ echo " " # Build manuals translation install include from current .PO available ( echo -n "TRANSLATE_LANGUAGES=" -for f in `ls -1 ${ROOT}/doc/manuals/*.po` +for f in `ls -1 ${ROOT}/doc/manuals/*.po | sort -u` do echo " \\" echo -n " ${f}" @@ -225,7 +233,7 @@ echo " " # Build STUB framework include from current stub_* available ( echo -n "STUB_SOURCE= tests/STUB.h" -for f in `ls -1 ${ROOT}/src/tests/stub_*.cc` +for f in `ls -1 ${ROOT}/src/tests/stub_*.cc | sort -u` do echo " \\" echo -n " ${f}"