summaryrefslogtreecommitdiffstats
path: root/tools/h5ls
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-09-01 10:27:45 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-09-01 10:27:45 (GMT)
commit642f392ba3e2d30ae2a82e32f249461121d17cbc (patch)
treebbce1ae1606153f323156f207b50d88d7fba2ddf /tools/h5ls
parentc034336452ee48574f0dd65bf053079f9801e269 (diff)
downloadhdf5-642f392ba3e2d30ae2a82e32f249461121d17cbc.zip
hdf5-642f392ba3e2d30ae2a82e32f249461121d17cbc.tar.gz
hdf5-642f392ba3e2d30ae2a82e32f249461121d17cbc.tar.bz2
[svn-r19330] Description:
Bring r19109:19328 from trunk to revise_chunks branch. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, w/threadsafe, in production mode Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode Mac OS X/32 10.6.4 (amazon) in debug mode Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
Diffstat (limited to 'tools/h5ls')
-rw-r--r--tools/h5ls/CMakeLists.txt41
-rw-r--r--tools/h5ls/h5ls.c7
2 files changed, 37 insertions, 11 deletions
diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt
index b57423b..1d2589a 100644
--- a/tools/h5ls/CMakeLists.txt
+++ b/tools/h5ls/CMakeLists.txt
@@ -4,13 +4,12 @@ PROJECT (HDF5_TOOLS_H5LS)
#-----------------------------------------------------------------------------
# Setup include Directories
#-----------------------------------------------------------------------------
-INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib)
+INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib)
INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test)
-# --------------------------------------------------------------------
-# If testing was NOT enabled, then we need to build the tools library
-# --------------------------------------------------------------------
-#-- Add the h5ls executable
+#-----------------------------------------------------------------------------
+# Add the h5ls executable
+#-----------------------------------------------------------------------------
ADD_EXECUTABLE (h5ls ${HDF5_TOOLS_H5LS_SOURCE_DIR}/h5ls.c)
H5_NAMING (h5ls)
IF (WIN32)
@@ -29,8 +28,16 @@ SET (H5_DEP_EXECUTABLES
h5ls
)
+##############################################################################
+##############################################################################
+### T E S T I N G ###
+##############################################################################
+##############################################################################
+
IF (BUILD_TESTING)
- #-- Copy all the HDF5 files from the test directory into the source directory
+ # --------------------------------------------------------------------
+ # Copy all the HDF5 files from the test directory into the source directory
+ # --------------------------------------------------------------------
SET (HDF5_REFERENCE_FILES
help-1.ls
help-2.ls
@@ -112,7 +119,7 @@ IF (BUILD_TESTING)
TARGET h5ls
POST_BUILD
COMMAND ${XLATE_UTILITY}
- ARGS ${HDF5_TOOLS_SOURCE_DIR}/testfiles/${ls_file} ${lsdest} -l3
+ ARGS ${HDF5_TOOLS_SRC_DIR}/testfiles/${ls_file} ${lsdest} -l3
)
ENDFOREACH (ls_file ${HDF5_REFERENCE_FILES})
@@ -123,9 +130,15 @@ IF (BUILD_TESTING)
TARGET h5ls
POST_BUILD
COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different ${HDF5_TOOLS_SOURCE_DIR}/testfiles/${h5_file} ${dest}
+ ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_file} ${dest}
)
ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES})
+
+##############################################################################
+##############################################################################
+### T H E T E S T S M A C R O S ###
+##############################################################################
+##############################################################################
MACRO (ADD_H5_TEST resultfile resultcode)
ADD_TEST (
@@ -141,6 +154,12 @@ IF (BUILD_TESTING)
)
ENDMACRO (ADD_H5_TEST file)
+##############################################################################
+##############################################################################
+### T H E T E S T S ###
+##############################################################################
+##############################################################################
+
# test the help syntax
ADD_H5_TEST (help-1 0 -w80 -h)
ADD_H5_TEST (help-2 0 -w80 --help)
@@ -247,6 +266,12 @@ IF (BUILD_TESTING)
ENDIF (BUILD_TESTING)
+##############################################################################
+##############################################################################
+### I N S T A L L A T I O N ###
+##############################################################################
+##############################################################################
+
#-----------------------------------------------------------------------------
# Rules for Installation of tools using make Install target
#-----------------------------------------------------------------------------
diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c
index fb08ddb..5bda0b4 100644
--- a/tools/h5ls/h5ls.c
+++ b/tools/h5ls/h5ls.c
@@ -1992,7 +1992,7 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter)
switch(linfo->type) {
case H5L_TYPE_SOFT:
- ret = H5tools_get_link_info(iter->fid, name, &lnk_info);
+ ret = H5tools_get_link_info(iter->fid, name, &lnk_info, follow_symlink_g);
/* lnk_info.trg_path is malloced in H5tools_get_link_info()
* so it will be freed via buf later */
buf = lnk_info.trg_path;
@@ -2048,8 +2048,9 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter)
{
const char *filename;
const char *path;
+ hbool_t follow_link = follow_symlink_g || follow_elink_g;
- ret = H5tools_get_link_info(iter->fid, name, &lnk_info);
+ ret = H5tools_get_link_info(iter->fid, name, &lnk_info, follow_link);
/* lnk_info.trg_path is malloced in H5tools_get_link_info()
* so it will be freed via buf later */
buf = lnk_info.trg_path;
@@ -2073,7 +2074,7 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter)
/* Recurse through the external link */
/* keep the follow_elink_g for backward compatibility with -E */
- if(follow_symlink_g || follow_elink_g)
+ if(follow_link)
{
hbool_t orig_grp_literal = grp_literal_g;
HDfputc(' ', stdout);