2
0
mirror of https://github.com/HDFGroup/hdf5.git synced 2025-04-24 17:51:25 +08:00

[svn-r22594] Bug fix: HDFFV-8105

Description:
The test command in COPY_TESTFILES_TO_TESTDIR used the wrong operator -a which
means and. It is not sufficient to test mere existence as $tstfile could have
been a directory or other non-file things.  If the file is not readable, the
$CP command would fail but its return code was not checked.

Solution:
Get rid of the test command and go ahead to $CP it and then check its returned
code and report errors if detected.

Tested; committested. (note that ostrick still failed on errors committed by
other staff).
This commit is contained in:
Albert Cheng 2012-07-22 01:42:30 -05:00
parent 23d32fec25
commit 9e08a0d8c5
2 changed files with 5 additions and 4 deletions
release_docs
tools/h5diff

@ -702,6 +702,9 @@ Bug Fixes since HDF5-1.8.0 release
Tools
-----
- h5diff: Fixed the Function COPY_TESTFILES_TO_TESTDIR() of
testh5diff.sh to better report when there is an error in the file
copying. HDFFV-8105 (AKC -2012/07/22)
- h5diff: Fixed not to check and display dangling link status without
--follow-symlinks option. This also improved performance when
comparing lots of external links without the --follow-symlinks

@ -318,11 +318,9 @@ COPY_TESTFILES_TO_TESTDIR()
echo $tstfile | tr -d ' ' | grep '^#' > /dev/null
RET=$?
if [ $RET -eq 1 ]; then
if [ -a $tstfile ]; then
$CP -f $tstfile $TESTDIR
else
$CP -f $tstfile $TESTDIR
if [ $? -ne 0 ]; then
echo "Error: FAILED to copy $tstfile ."
echo " $tstfile doesn't exist!"
# Comment out this to CREATE expected file
exit $EXIT_FAILURE