summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2005-10-30 06:00:50 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2005-10-30 06:00:50 (GMT)
commit599b91eb199d878871c6ad9a847d0c28e1b454e2 (patch)
tree54a9d8ed6d9c2e145333033fc1f00c88494f0aa3
parentc5fc4530568bf60d7ca7d43ab98e29be72609eb0 (diff)
downloadhdf5-599b91eb199d878871c6ad9a847d0c28e1b454e2.zip
hdf5-599b91eb199d878871c6ad9a847d0c28e1b454e2.tar.gz
hdf5-599b91eb199d878871c6ad9a847d0c28e1b454e2.tar.bz2
[svn-r11627] Purpose:
improvement. Description: It records passed files and reports numbers of both passed and failed files.
-rwxr-xr-xbin/chkcopyright24
1 files changed, 18 insertions, 6 deletions
diff --git a/bin/chkcopyright b/bin/chkcopyright
index 00cf7ee..8df68d3 100755
--- a/bin/chkcopyright
+++ b/bin/chkcopyright
@@ -34,6 +34,7 @@ EXTRACTEDFILE=/tmp/h5chkright.extracted.$$
VERBOSE= # default no
DIRS=. # default current directory
NFAILEDFILES=0 # Number of failed files found.
+NPASSEDFILES=0 # Number of failed files found.
NUMBEGINLINES=60 # Copyright notice should be located within the
# this number of lines at the beginning of the file.
COPYRIGHTSTR="Copyright by the Board of Trustees of the University of Illinois"
@@ -275,6 +276,7 @@ C_SOURCE()
f=$1
case `MATCH_COPYRIGHT $C_COPYRIGHT $f` in
PASSED)
+ PASSED $f
return
;;
FAILED)
@@ -293,6 +295,7 @@ FORTRAN_SOURCE()
f=$1
case `MATCH_COPYRIGHT $FTN_COPYRIGHT $f` in
PASSED)
+ PASSED $f
return
;;
FAILED)
@@ -318,6 +321,8 @@ HTML_FILE()
# show the differences
FAILED $f
$DIFF ${EXTRACTEDFILE} ${COPYRIGHTFILE}
+ else
+ PASSED $f
fi
}
@@ -336,6 +341,8 @@ SHELL_FILE()
# show the differences with the preferred style.
FAILED $f
$DIFF ${EXTRACTEDFILE} ${SH_COPYRIGHT}
+ else
+ PASSED $f
fi
}
@@ -373,7 +380,7 @@ UNKNOWN_FILE()
# Passed checking.
# $1 file that has passed.
#
-PASS()
+PASSED()
{
if test X-$VERBOSE = X-yes; then
echo " PASSED"
@@ -383,7 +390,7 @@ PASS()
# Unknown file type. Considered a fail.
-# $1 file that is skipped.
+# $1 name of unknown file.
#
UNKNOWN_TYPE()
{
@@ -466,6 +473,9 @@ while read file; do
done
# check results
+if [ -f $PASSEDLOG ]; then
+ NPASSEDFILES=`wc -l < $PASSEDLOG`
+fi
if [ -f $FAILEDLOG ]; then
NFAILEDFILES=`wc -l < $FAILEDLOG`
fi
@@ -482,10 +492,12 @@ rm -f $PASSEDLOG $SKIPPEDLOG $FAILEDLOG
echo "*******************"
echo " REPORT"
echo "*******************"
+echo Number of passed files = $NPASSEDFILES
+echo Number of failed files = $NFAILEDFILES
+
if [ $NFAILEDFILES -gt 0 ]; then
- echo Number of failed files found = $NFAILEDFILES
- exit 1
+ exitcode=1
else
- echo No failed files found
- exit 0
+ exitcode=0
fi
+exit $exitcode