-
-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve handling of copying of dynamic libraries and clean them up after test finishes #1681
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Protect against mangling the dynlib when it wasn't copied |
||
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All the files need to be deleted, not just the JAR files. Plus this should have been $tstfile |
||
done | ||
$RM -rf $BLDLIBDIR | ||
fi | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'R' option preserves soft links correctly, instead of letting them be duplicated into new copies of the linked file.