summaryrefslogtreecommitdiffstats
path: root/Modules/CPackRPM.cmake
diff options
context:
space:
mode:
authorAndrew Fuller <afuller@teradici.com>2016-06-24 17:45:40 (GMT)
committerBrad King <brad.king@kitware.com>2016-07-05 19:27:56 (GMT)
commita351edd2452f191988253da3f7b537f8e505f794 (patch)
tree31aeb55bdb26e295271a5b93e3026fa2cbee78c2 /Modules/CPackRPM.cmake
parentf05657de9d1ae7247a527186830d37702ec30de4 (diff)
downloadCMake-a351edd2452f191988253da3f7b537f8e505f794.zip
CMake-a351edd2452f191988253da3f7b537f8e505f794.tar.gz
CMake-a351edd2452f191988253da3f7b537f8e505f794.tar.bz2
CPackRPM: Handle directives of form %foo and %foo(anything)
Directives that are legal inside the %files section of an RPM spec may contain a variety of characters particularly when specifying %caps which can include +, _, and space. Watch for parenthesis to determine what forms the prefix vs. path. Fixes #14362.
Diffstat (limited to 'Modules/CPackRPM.cmake')
-rw-r--r--Modules/CPackRPM.cmake4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index d231ff0..7706bbc 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -1683,8 +1683,8 @@ function(cpack_rpm_generate_package)
set(CPACK_RPM_USER_INSTALL_FILES "")
foreach(F IN LISTS CPACK_RPM_USER_FILELIST_INTERNAL)
- string(REGEX REPLACE "%[A-Za-z0-9\(\),-]* " "" F_PATH ${F})
- string(REGEX MATCH "%[A-Za-z0-9\(\),-]*" F_PREFIX ${F})
+ string(REGEX REPLACE "%[A-Za-z]+(\\([^()]*\\))? " "" F_PATH ${F})
+ string(REGEX MATCH "%[A-Za-z]+(\\([^()]*\\))?" F_PREFIX ${F})
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: F_PREFIX=<${F_PREFIX}>, F_PATH=<${F_PATH}>")