[PATCH rdma-core 20/20] ibdiags: Perform substitution on the RST include files as well

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jason Gunthorpe <jgg@xxxxxxxxxxxx>

These have @ directives but are not marked as .in so they never got
substituted. Rename them and run them through substitution and arrange
for rst2man to pick them up.

Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
---
 infiniband-diags/man/CMakeLists.txt           | 48 ++++++++++++++++++-
 .../{opt_z-config.rst => opt_z-config.in.rst} |  0
 ...config-file.rst => sec_config-file.in.rst} |  0
 3 files changed, 46 insertions(+), 2 deletions(-)
 rename infiniband-diags/man/common/{opt_z-config.rst => opt_z-config.in.rst} (100%)
 rename infiniband-diags/man/common/{sec_config-file.rst => sec_config-file.in.rst} (100%)

diff --git a/infiniband-diags/man/CMakeLists.txt b/infiniband-diags/man/CMakeLists.txt
index 916a52dcab6cb0..3cc2c643c2287c 100644
--- a/infiniband-diags/man/CMakeLists.txt
+++ b/infiniband-diags/man/CMakeLists.txt
@@ -1,5 +1,49 @@
-# rst2man has no way to set the include search path
-rdma_create_symlink("${CMAKE_CURRENT_SOURCE_DIR}/common" "${CMAKE_CURRENT_BINARY_DIR}/common")
+# rst2man has no way to set the include search path and we need to substitute
+# into the common files, so subst/link them all into the build directory
+function(rdma_rst_common)
+  foreach(I ${ARGN})
+    if ("${I}" MATCHES "\\.in.rst$")
+      string(REGEX REPLACE "^(.+)\\.in.rst$" "\\1" BASE_NAME "${I}")
+      configure_file("common/${I}" "${CMAKE_CURRENT_BINARY_DIR}/common/${BASE_NAME}.rst" @ONLY)
+    else()
+      if (NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
+	rdma_create_symlink("${CMAKE_CURRENT_SOURCE_DIR}/common/${I}" "${CMAKE_CURRENT_BINARY_DIR}/common/${I}")
+      endif()
+    endif()
+  endforeach()
+endfunction()
+
+rdma_rst_common(
+  opt_cache.rst
+  opt_C.rst
+  opt_diffcheck.rst
+  opt_diff.rst
+  opt_d.rst
+  opt_D.rst
+  opt_D_with_param.rst
+  opt_e.rst
+  opt_G.rst
+  opt_G_with_param.rst
+  opt_h.rst
+  opt_K.rst
+  opt_load-cache.rst
+  opt_L.rst
+  opt_node_name_map.rst
+  opt_o-outstanding_smps.rst
+  opt_ports-file.rst
+  opt_P.rst
+  opt_s.rst
+  opt_t.rst
+  opt_v.rst
+  opt_V.rst
+  opt_y.rst
+  opt_z-config.in.rst
+  sec_config-file.in.rst
+  sec_node-name-map.rst
+  sec_portselection.rst
+  sec_ports-file.rst
+  sec_topology-file.rst
+)
 
 rdma_man_pages(
   check_lft_balance.8.in.rst
diff --git a/infiniband-diags/man/common/opt_z-config.rst b/infiniband-diags/man/common/opt_z-config.in.rst
similarity index 100%
rename from infiniband-diags/man/common/opt_z-config.rst
rename to infiniband-diags/man/common/opt_z-config.in.rst
diff --git a/infiniband-diags/man/common/sec_config-file.rst b/infiniband-diags/man/common/sec_config-file.in.rst
similarity index 100%
rename from infiniband-diags/man/common/sec_config-file.rst
rename to infiniband-diags/man/common/sec_config-file.in.rst
-- 
2.21.0




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux