gnucash-docs stable: Fix race condition in creating symlinks

Geert Janssens gjanssens at code.gnucash.org
Thu Aug 17 06:51:37 EDT 2023


Updated	 via  https://github.com/Gnucash/gnucash-docs/commit/4ba0ed1a (commit)
	from  https://github.com/Gnucash/gnucash-docs/commit/6cde219e (commit)



commit 4ba0ed1a9c8e2005ab98d545e55076a8b7fdc619
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Thu Aug 17 12:51:30 2023 +0200

    Fix race condition in creating symlinks
    
    For the kde help system, a few extra symlinks are created.
    The way this was done however caused the build system to
    recreate the exact same symlink from the guide and the manual
    build scripts. In many cases this was detected by cmake and
    the second attempt skipped, but I ran in to race conditions
    where the build would error out while attempting to create
    the already existing link a second time.
    
    By explicitly using unique links in the guide and manual,
    this race condition is avoided. The final paths to the
    documents kde looks are still the same as before this change.
    The only difference is that the symlink has been shifted
    one level down in the full path.

diff --git a/cmake/AddXdgHelpTarget.cmake b/cmake/AddXdgHelpTarget.cmake
index 9f42d8af..cf161c4d 100644
--- a/cmake/AddXdgHelpTarget.cmake
+++ b/cmake/AddXdgHelpTarget.cmake
@@ -45,8 +45,8 @@ function (add_xdghelp_target targetbase lang entities figures)
       COMMAND ${CMAKE_COMMAND} -E make_directory "${BUILD_DIR}/figures"
 
       # Add links to make our documentation visible for KDE's help system
-      COMMAND ${CMAKE_COMMAND} -E make_directory "${BUILD_DIR_KDE_BASE}"
-      COMMAND ${CMAKE_COMMAND} -E create_symlink "${BUILD_DIR_BASE}" "${BUILD_DIR_KDE_BASE}/${kde_lang}"
+      COMMAND ${CMAKE_COMMAND} -E make_directory "${BUILD_DIR_KDE_BASE}/${kde_lang}"
+      COMMAND ${CMAKE_COMMAND} -E create_symlink "${BUILD_DIR}" "${BUILD_DIR_KDE_BASE}/${kde_lang}/${docname}"
       COMMAND touch "${CMAKE_CURRENT_BINARY_DIR}/xdghelptrigger")
 
 



Summary of changes:
 cmake/AddXdgHelpTarget.cmake | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)



More information about the gnucash-changes mailing list