From f70640457be1cb6159bbcca4c1f082b8c72a3e5f Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Wed, 9 Nov 2005 17:23:58 -0500 Subject: [svn-r11696] Purpose: Improvement Description: The previous HTML files strategy was to expect the very first comment block is the copyright notice. That did not work well as more and more other comments appear now. Solution: Changed the strategy to look for the only the essential body of copyright notice. This no longer verifies this body of text is a comment block. But the previous strategy is not really bullet-proof either. Platforms tested: tested in heping. --- bin/chkcopyright | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/bin/chkcopyright b/bin/chkcopyright index cdc308a..b79b8ff 100755 --- a/bin/chkcopyright +++ b/bin/chkcopyright @@ -107,8 +107,6 @@ EOF # HTML file Copyright notice cat > ${HTM_COPYRIGHT} << \EOF - EOF # Shell style Copyright notice @@ -354,19 +350,17 @@ FORTRAN_SOURCE() HTML_FILE() { f=$1 - COPYRIGHTFILE=$HTM_COPYRIGHT - # Must use stdin for wc to prevent filename from popping up. - nlines=`wc -l < ${COPYRIGHTFILE}| tr -d ' '` - sed -n -e '/^/p' < $f | head -${nlines} > ${EXTRACTEDFILE} - RINSE ${EXTRACTEDFILE} - $DIFF ${EXTRACTEDFILE} ${COPYRIGHTFILE} >/dev/null 2>&1 - if test $? -ne 0; then - # show the differences - FAILED $f - $DIFF ${EXTRACTEDFILE} ${COPYRIGHTFILE} - else + case `MATCH_COPYRIGHT $HTM_COPYRIGHT $f` in + PASSED) PASSED $f - fi + return + ;; + FAILED) + # show the difference + FAILED $f + $DIFF ${EXTRACTEDFILE} ${HTM_COPYRIGHT} + ;; + esac } -- cgit v0.12