summaryrefslogtreecommitdiffstats
path: root/java/examples/datasets
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@lbl.gov>2022-04-24 14:59:12 (GMT)
committerGitHub <noreply@github.com>2022-04-24 14:59:12 (GMT)
commitc8b87fa3200228b8689f77d325646d6f77502cfa (patch)
tree6ddcac93ec7889b1b35fce30e9a8358555ee8aff /java/examples/datasets
parenta6876a974556bf70a9d736f1ab4c21b2da8e1a88 (diff)
downloadhdf5-c8b87fa3200228b8689f77d325646d6f77502cfa.zip
hdf5-c8b87fa3200228b8689f77d325646d6f77502cfa.tar.gz
hdf5-c8b87fa3200228b8689f77d325646d6f77502cfa.tar.bz2
Improve handling of copying of dynamic libraries and clean them up after (#1681)
test finishes.
Diffstat (limited to 'java/examples/datasets')
-rw-r--r--java/examples/datasets/JavaDatasetExample.sh.in16
1 files changed, 9 insertions, 7 deletions
diff --git a/java/examples/datasets/JavaDatasetExample.sh.in b/java/examples/datasets/JavaDatasetExample.sh.in
index 9a5ddd8..b299ff2 100644
--- a/java/examples/datasets/JavaDatasetExample.sh.in
+++ b/java/examples/datasets/JavaDatasetExample.sh.in
@@ -29,6 +29,7 @@ CMP='cmp'
DIFF='diff -c'
CP='cp'
DIRNAME='dirname'
+BASENAME='basename'
LS='ls'
AWK='awk'
@@ -103,17 +104,21 @@ COPY_LIBFILES_TO_BLDLIBDIR()
INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'`
if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
- $CP -f $tstfile $BLDLIBDIR
+ $CP -fR $tstfile $BLDLIBDIR
if [ $? -ne 0 ]; then
echo "Error: FAILED to copy $tstfile ."
# Comment out this to CREATE expected file
exit $EXIT_FAILURE
fi
+ BNAME=`$BASENAME $tstfile`
+ if [ "$BNAME" = "libhdf5_java.dylib" ]; then
+ COPIED_LIBHDF5_JAVA=1
+ fi
fi
fi
done
- if [ "$IS_DARWIN" = "yes" ]; then
+ if [[ "$IS_DARWIN" = "yes" ]] && [[ $COPIED_LIBHDF5_JAVA -eq 1 ]]; then
(cd $BLDLIBDIR; \
install_name_tool -add_rpath @loader_path libhdf5_java.dylib; \
exist_path=` otool -l libhdf5_java.dylib | grep libhdf5 | grep -v java | awk '{print $2}'`; \
@@ -134,7 +139,7 @@ COPY_LIBFILES_TO_BLDLIBDIR()
INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'`
if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
- $CP -f $tstfile $BLDLIBDIR
+ $CP -fR $tstfile $BLDLIBDIR
if [ $? -ne 0 ]; then
echo "Error: FAILED to copy $tstfile ."
@@ -155,10 +160,7 @@ CLEAN_LIBFILES_AND_BLDLIBDIR()
INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'`
if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
- for tstfile in $COPY_JARTESTFILES
- do
- $RM $BLDLIBDIR/tstfile
- done
+ $RM -rf $BLDLIBDIR
fi
}