diff options
author | Brad King <brad.king@kitware.com> | 2019-02-26 16:11:49 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-02-26 16:11:56 (GMT) |
commit | 78ff8d573777c099aea5bd2eb92d9866c0d85952 (patch) | |
tree | 9815f7edf16be90eb1e2d6365190efdb8cd8f6ce | |
parent | 2621efac19e0538f0f92f69ecab60db184c70953 (diff) | |
parent | d3ffe90598da9c9439cc9a42012c0bef05ad25f7 (diff) | |
download | CMake-78ff8d573777c099aea5bd2eb92d9866c0d85952.zip CMake-78ff8d573777c099aea5bd2eb92d9866c0d85952.tar.gz CMake-78ff8d573777c099aea5bd2eb92d9866c0d85952.tar.bz2 |
Merge topic 'cpack-rpm++'
d3ffe90598 CPackRPM: Fix packaging in folders with ++ in name
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3008
-rw-r--r-- | Modules/Internal/CPack/CPackRPM.cmake | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Modules/Internal/CPack/CPackRPM.cmake b/Modules/Internal/CPack/CPackRPM.cmake index 2de71ee..26b2517 100644 --- a/Modules/Internal/CPack/CPackRPM.cmake +++ b/Modules/Internal/CPack/CPackRPM.cmake @@ -63,6 +63,11 @@ function(get_unix_permissions_octal_notation PERMISSIONS_VAR RETURN_VAR) set(${RETURN_VAR} "${OWNER_PERMISSIONS}${GROUP_PERMISSIONS}${WORLD_PERMISSIONS}" PARENT_SCOPE) endfunction() +function(cpack_rpm_exact_regex regex_var string) + string(REGEX REPLACE "([][+.*()^])" "\\\\\\1" regex "${string}") + set("${regex_var}" "${regex}" PARENT_SCOPE) +endfunction() + function(cpack_rpm_prepare_relocation_paths) # set appropriate prefix, remove possible trailing slash and convert backslashes to slashes if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_PREFIX) @@ -482,7 +487,9 @@ function(cpack_rpm_prepare_install_files INSTALL_FILES_LIST WDIR PACKAGE_PREFIXE # recalculate path length after conversion to canonical form string(LENGTH "${SYMLINK_POINT_}" SYMLINK_POINT_LENGTH_) - if(SYMLINK_POINT_ MATCHES "${WDIR}/.*") + cpack_rpm_exact_regex(IN_SYMLINK_POINT_REGEX "${WDIR}") + string(APPEND IN_SYMLINK_POINT_REGEX "/.*") + if(SYMLINK_POINT_ MATCHES "${IN_SYMLINK_POINT_REGEX}") # only symlinks that are pointing inside the packaging structure should be checked for relocation string(SUBSTRING "${SYMLINK_POINT_}" ${WDR_LEN_} -1 SYMLINK_POINT_WD_) cpack_rpm_symlink_get_relocation_prefixes("${F}" "${PACKAGE_PREFIXES}" "SYMLINK_RELOCATIONS") |