------------------------------------------------------------ revno: 13651 revision-id: squid3@treenet.co.nz-20141030144830-8wh4cobaugpa6jqv parent: squid3@treenet.co.nz-20141030144426-do92q5fahousf4um committer: Amos Jeffries branch nick: 3.5 timestamp: Thu 2014-10-30 07:48:30 -0700 message: Source Maintenance: Add checks for copyright blurbs * Check for copyright blurbs in repository files. * Allow skipping of third-party and binary files. * Add copyright blurb to auto-generated files created by maintenance script. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20141030144830-8wh4cobaugpa6jqv # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 # testament_sha1: c16cfc63f2c27996a519d9e0652e556f441178ba # timestamp: 2014-10-30 14:49:39 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 # base_revision_id: squid3@treenet.co.nz-20141030144426-\ # do92q5fahousf4um # # Begin patch === modified file 'scripts/source-maintenance.sh' --- scripts/source-maintenance.sh 2014-10-16 18:45:09 +0000 +++ scripts/source-maintenance.sh 2014-10-30 14:48:30 +0000 @@ -54,6 +54,7 @@ # Scan for file-specific actions # for FILENAME in `bzr ls --versioned`; do + skip_copyright_check="" case ${FILENAME} in @@ -154,10 +155,20 @@ mv ${FILENAME}.styled ${FILENAME} ;; + */ChangeLog|*.list|*.png|*.po|*.pot|*.txt|*test-suite/squidconf/empty) + # we do not enforce copyright blurbs in: + # + # images, + # translation PO/POT + # auto-generated .list files, + # (imported) plain-text documentation files and ChangeLogs + # + skip_copyright_check=1 + ;; esac # check for Foundation copyright blurb - if test -f ${PWD}/${FILENAME}; then + if test -f ${PWD}/${FILENAME} -a "x$skip_copyright_check" = "x"; then BLURB=`grep "The Squid Software Foundation and contributors" ${FILENAME}`; if test "x${BLURB}" = "x"; then echo "CHECK COPYRIGHT for ${PWD}/${FILENAME}" @@ -176,20 +187,24 @@ } # Build XPROF types file from current sources -echo "#ifndef _PROFILER_XPROF_TYPE_H_" >${ROOT}/lib/profiler/list -echo "#define _PROFILER_XPROF_TYPE_H_" >>${ROOT}/lib/profiler/list -echo "/* AUTO-GENERATED FILE */" >>${ROOT}/lib/profiler/list -echo "#if USE_XPROF_STATS" >>${ROOT}/lib/profiler/list -echo "typedef enum {" >>${ROOT}/lib/profiler/list -echo "XPROF_PROF_UNACCOUNTED," >>${ROOT}/lib/profiler/list -grep -R -h "PROF_start.*" ./* | grep -v probename | sed -e 's/ //g; s/PROF_start(/XPROF_/; s/);/,/' | sort -u >>${ROOT}/lib/profiler/list -echo " XPROF_LAST } xprof_type;" >>${ROOT}/lib/profiler/list -echo "#endif" >>${ROOT}/lib/profiler/list -echo "#endif" >>${ROOT}/lib/profiler/list +( +cat scripts/boilerplate.h +echo "#ifndef _PROFILER_XPROF_TYPE_H_" +echo "#define _PROFILER_XPROF_TYPE_H_" +echo "/* AUTO-GENERATED FILE */" +echo "#if USE_XPROF_STATS" +echo "typedef enum {" +echo " XPROF_PROF_UNACCOUNTED," +grep -R -h "PROF_start.*" ./* | grep -v probename | sed -e 's/ //g; s/PROF_start(/XPROF_/; s/);/,/' | sort -u +echo " XPROF_LAST } xprof_type;" +echo "#endif" +echo "#endif" +) >${ROOT}/lib/profiler/list mv ${ROOT}/lib/profiler/list ${ROOT}/lib/profiler/xprof_type.h # Build icons install include from current icons available ( +sed -e 's%\ \*%##%' -e 's%/\*%##%' -e 's%##/%##%' ${ROOT}/icons/list +)| sed s%${ROOT}/icons/%%g >${ROOT}/icons/icon.list # Build templates install include from current templates available ( +sed -e 's%\ \*%##%' -e 's%/\*%##%' -e 's%##/%##%' ${ROOT}/doc/debug-sections.tmp srcformat || exit 1 -sort -u <${ROOT}/doc/debug-sections.tmp | sort -n >${ROOT}/doc/debug-sections.txt -rm ${ROOT}/doc/debug-sections.tmp +sort -u <${ROOT}/doc/debug-sections.tmp | sort -n >${ROOT}/doc/debug-sections.tmp2 +cat scripts/boilerplate.h ${ROOT}/doc/debug-sections.tmp2 >${ROOT}/doc/debug-sections.txt +rm ${ROOT}/doc/debug-sections.tmp ${ROOT}/doc/debug-sections.tmp2