summaryrefslogtreecommitdiffstats
path: root/bin/runtest
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2005-10-31 03:23:33 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2005-10-31 03:23:33 (GMT)
commitb24462f54376a8d291574be024c563c139d39372 (patch)
treea29b835be135efe29fbfa63122390863c534908b /bin/runtest
parent599b91eb199d878871c6ad9a847d0c28e1b454e2 (diff)
downloadhdf5-b24462f54376a8d291574be024c563c139d39372.zip
hdf5-b24462f54376a8d291574be024c563c139d39372.tar.gz
hdf5-b24462f54376a8d291574be024c563c139d39372.tar.bz2
[svn-r11632] Purpose:
Bug fix. Description: chkcopyright has been changed to return an exit code whether it passes or not. Changed the detection accordingly. Platforms tested: heping.
Diffstat (limited to 'bin/runtest')
-rwxr-xr-xbin/runtest23
1 files changed, 15 insertions, 8 deletions
diff --git a/bin/runtest b/bin/runtest
index f502a27..f595ec5 100755
--- a/bin/runtest
+++ b/bin/runtest
@@ -755,9 +755,7 @@ if [ -z "$NOCVS" ]; then
# Check Copyright notice
# ======================
PRINT Checking Copyrights notices ...
- (cd $SNAPYARD/current; bin/chkcopyright) > $TMPFILE 2>&1
- if [ ! -s $TMPFILE ]; then
- # No output means all is well.
+ if (cd $SNAPYARD/current; bin/chkcopyright) > $TMPFILE 2>&1 ; then
echo Passed.
else
# Save the output and report some of it.
@@ -766,14 +764,23 @@ if [ -z "$NOCVS" ]; then
# Need fixes/cleanup later.
echo "Failed. See detail in another report mail"
cp $TMPFILE $COPYRIGHT_ERR
- (
- nlines=300
+ nheadlines=300
+ ntaillines=5 # Number of lines in report summary.
+ (
echo =========================
- echo "Copyright checking failed. Showing first $nlines lines of output."
+ echo "Copyright checking failed. Showing first $nheadlines lines of output."
echo "Complete output is in file $COPYRIGHT_ERR"
echo =========================
- head -$nlines $COPYRIGHT_ERR
- echo ...
+ nreportlines=`wc -l < $COPYRIGHT_ERR`
+ if [ $nreportlines -le `expr $nheadlines + $ntaillines` ]; then
+ # Just print the whole file.
+ cat $COPYRIGHT_ERR
+ else
+ # Show the first $nheadlines plus report summary
+ head -$nheadlines $COPYRIGHT_ERR
+ echo ...
+ tail -$ntaillines $COPYRIGHT_ERR
+ fi
) | Mail -s "${H5VERSION} Copyrights check Failed" hdf5lib
fi
rm $TMPFILE