]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Source Maintenance: fix various maintenance script issues
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 13 Sep 2014 16:46:45 +0000 (04:46 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 13 Sep 2014 16:46:45 +0000 (04:46 +1200)
* 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.

scripts/source-maintenance.sh

index 1d950866c9c3afb0629616a4146a391dd0d7e907..2f229f8f3a4779839e3b86a4469ced7f53838c9d 100755 (executable)
@@ -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}"