summaryrefslogtreecommitdiffstats
path: root/tools/h5repack
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2012-08-06 19:42:49 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2012-08-06 19:42:49 (GMT)
commitcd3f42096b9a957e37c9df48aa0d31d9ed4bc537 (patch)
tree86a1672d114762d3aea872e44104e65d1bc09254 /tools/h5repack
parent434643dd4d14a841abdcc73ad7b3a0a8e06e4438 (diff)
downloadhdf5-cd3f42096b9a957e37c9df48aa0d31d9ed4bc537.zip
hdf5-cd3f42096b9a957e37c9df48aa0d31d9ed4bc537.tar.gz
hdf5-cd3f42096b9a957e37c9df48aa0d31d9ed4bc537.tar.bz2
[svn-r22636] Description:
Bring r22599:22634 from trunk to revise_chunks branch Tested on: Mac OSX/64 10.7.4 (amazon) w/gcc 4.7.x, C++ & FORTRAN (No need for h5committest yet on this branch)
Diffstat (limited to 'tools/h5repack')
-rw-r--r--tools/h5repack/h5repack.sh.in23
1 files changed, 17 insertions, 6 deletions
diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in
index e05b03f..b702152 100644
--- a/tools/h5repack/h5repack.sh.in
+++ b/tools/h5repack/h5repack.sh.in
@@ -42,6 +42,9 @@ H5DUMP_BIN=`pwd`/$H5DUMP # The path of the h5dump tool binary
GREP='grep'
CP='cp'
+DIRNAME='dirname'
+LS='ls'
+AWK='awk'
H5DETECTSZIP=testh5repack_detect_szip
H5DETECTSZIP_BIN=`pwd`/$H5DETECTSZIP
@@ -137,12 +140,20 @@ 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
- echo "Error: FAILED to copy $tstfile"
- echo " $tstfile doesn't exist!"
- exit $EXIT_FAILURE
+ # skip cp if srcdir is same as destdir
+ # this occurs when build/test performed in source dir and
+ # make cp fail
+ SDIR=`$DIRNAME $tstfile`
+ INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
+ INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'`
+ if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
+ $CP -f $tstfile $TESTDIR
+ if [ $? -ne 0 ]; then
+ echo "Error: FAILED to copy $tstfile ."
+
+ # Comment out this to CREATE expected file
+ exit $EXIT_FAILURE
+ fi
fi
fi
done