From 75ea6207b74110a61eefe390868ae6987acb1a5d Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 29 Nov 2023 12:24:21 -0500 Subject: CPack/RPM: Factor out helper to quote paths in generated rpm spec --- Modules/Internal/CPack/CPackRPM.cmake | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Modules/Internal/CPack/CPackRPM.cmake b/Modules/Internal/CPack/CPackRPM.cmake index 36c0a3f..2676c88 100644 --- a/Modules/Internal/CPack/CPackRPM.cmake +++ b/Modules/Internal/CPack/CPackRPM.cmake @@ -54,6 +54,10 @@ macro(set_spec_scripts PACKAGE_NAME) "${CPACK_RPM_SPEC_PREUNINSTALL}") endmacro() +function(make_rpm_spec_path var path) + set("${var}" "\"${path}\"" PARENT_SCOPE) +endfunction() + function(get_file_permissions FILE RETURN_VAR) execute_process(COMMAND ls -l ${FILE} OUTPUT_VARIABLE permissions_ @@ -596,7 +600,8 @@ function(cpack_rpm_prepare_install_files INSTALL_FILES_LIST WDIR PACKAGE_PREFIXE set(DIRECTIVE "%dir ") endif() - string(APPEND INSTALL_FILES "${DIRECTIVE}\"${F}\"\n") + make_rpm_spec_path(F_SPEC "${F}") + string(APPEND INSTALL_FILES "${DIRECTIVE}${F_SPEC}\n") endforeach() if(REQUIRES_SYMLINK_RELOCATION_SCRIPT) @@ -1317,7 +1322,8 @@ function(cpack_rpm_generate_package) string(APPEND F_PREFIX " ") endif() # Rebuild the user list file - string(APPEND CPACK_RPM_USER_INSTALL_FILES "${F_PREFIX}\"${F_PATH}\"\n") + make_rpm_spec_path(F_SPEC "${F_PATH}") + string(APPEND CPACK_RPM_USER_INSTALL_FILES "${F_PREFIX}${F_SPEC}\n") # Remove from CPACK_RPM_INSTALL_FILES and CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL list(REMOVE_ITEM CPACK_RPM_INSTALL_FILES_LIST ${F_PATH}) @@ -1330,7 +1336,8 @@ function(cpack_rpm_generate_package) # Rebuild CPACK_RPM_INSTALL_FILES set(CPACK_RPM_INSTALL_FILES "") foreach(F IN LISTS CPACK_RPM_INSTALL_FILES_LIST) - string(APPEND CPACK_RPM_INSTALL_FILES "\"${F}\"\n") + make_rpm_spec_path(F_SPEC "${F}") + string(APPEND CPACK_RPM_INSTALL_FILES "${F_SPEC}\n") endforeach() else() set(CPACK_RPM_USER_INSTALL_FILES "") @@ -1351,12 +1358,14 @@ function(cpack_rpm_generate_package) # Rebuild INSTALL_FILES set(CPACK_RPM_INSTALL_FILES "") foreach(F IN LISTS CPACK_RPM_INSTALL_FILES_LIST) - string(APPEND CPACK_RPM_INSTALL_FILES "\"${F}\"\n") + make_rpm_spec_path(F_SPEC "${F}") + string(APPEND CPACK_RPM_INSTALL_FILES "${F_SPEC}\n") endforeach() # Build ABSOLUTE_INSTALL_FILES set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "") foreach(F IN LISTS CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL) - string(APPEND CPACK_RPM_ABSOLUTE_INSTALL_FILES "%config \"${F}\"\n") + make_rpm_spec_path(F_SPEC "${F}") + string(APPEND CPACK_RPM_ABSOLUTE_INSTALL_FILES "%config ${F_SPEC}\n") endforeach() if(CPACK_RPM_PACKAGE_DEBUG) message("CPackRPM:Debug: CPACK_RPM_ABSOLUTE_INSTALL_FILES=${CPACK_RPM_ABSOLUTE_INSTALL_FILES}") -- cgit v0.12 From bf22ac5263e6dfdfc2824deed8f003ef8a4e7816 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 29 Nov 2023 12:47:20 -0500 Subject: CPack/RPM: Quote paths in rpm spec only if they have whitespace RPM supports either whitespace with quoting or globbing without quoting. Prior to RPM 4.19 it accepted globbing in quotes, but it only globbed correctly without whitespace, where quoting was not necessary anyway. Starting in RPM 4.19, glob characters in quotes are considered literal. Fixes: #25421 Inspired-by: Ben Boeckel See: https://github.com/rpm-software-management/rpm/commit/d44114f007f54f205ffa13d22724199fe50a137a --- Modules/Internal/CPack/CPackRPM.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Modules/Internal/CPack/CPackRPM.cmake b/Modules/Internal/CPack/CPackRPM.cmake index 2676c88..ace2c6b 100644 --- a/Modules/Internal/CPack/CPackRPM.cmake +++ b/Modules/Internal/CPack/CPackRPM.cmake @@ -55,7 +55,12 @@ macro(set_spec_scripts PACKAGE_NAME) endmacro() function(make_rpm_spec_path var path) - set("${var}" "\"${path}\"" PARENT_SCOPE) + # RPM supports either whitespace with quoting or globbing without quoting. + if(path MATCHES "[ \t]") + set("${var}" "\"${path}\"" PARENT_SCOPE) + else() + set("${var}" "${path}" PARENT_SCOPE) + endif() endfunction() function(get_file_permissions FILE RETURN_VAR) -- cgit v0.12 From 5123e9e160c1d3238dadc8ee1fea4a095191b62f Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 24 Nov 2023 22:06:08 -0500 Subject: ci: unmask RPM tests on Fedora 39 --- .gitlab/ci/ctest_exclusions.cmake | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.gitlab/ci/ctest_exclusions.cmake b/.gitlab/ci/ctest_exclusions.cmake index 159c1c8..a2789c3 100644 --- a/.gitlab/ci/ctest_exclusions.cmake +++ b/.gitlab/ci/ctest_exclusions.cmake @@ -34,15 +34,6 @@ if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "nvhpc_") ) endif() -if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "fedora39_makefiles") - list(APPEND test_exclusions - # FIXME(#25421): CPack/RPM needs an update for Fedora 39. - "^CPackComponentsForAll-RPM-default$" - "^CPackComponentsForAll-RPM-AllInOne$" - "^CPackComponentsForAll-RPM-OnePackPerGroup$" - ) -endif() - string(REPLACE ";" "|" test_exclusions "${test_exclusions}") if (test_exclusions) set(test_exclusions "(${test_exclusions})") -- cgit v0.12