summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-11-29 17:47:20 (GMT)
committerBrad King <brad.king@kitware.com>2023-11-29 17:47:20 (GMT)
commitbf22ac5263e6dfdfc2824deed8f003ef8a4e7816 (patch)
tree91422dbfc490366244ec5a6463c4fe0c4a20eabf
parent75ea6207b74110a61eefe390868ae6987acb1a5d (diff)
downloadCMake-bf22ac5263e6dfdfc2824deed8f003ef8a4e7816.zip
CMake-bf22ac5263e6dfdfc2824deed8f003ef8a4e7816.tar.gz
CMake-bf22ac5263e6dfdfc2824deed8f003ef8a4e7816.tar.bz2
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 <ben.boeckel@kitware.com> See: https://github.com/rpm-software-management/rpm/commit/d44114f007f54f205ffa13d22724199fe50a137a
-rw-r--r--Modules/Internal/CPack/CPackRPM.cmake7
1 files changed, 6 insertions, 1 deletions
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)