diff options
author | Domen Vrankar <domen.vrankar@gmail.com> | 2017-10-28 22:53:46 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-10-30 12:48:46 (GMT) |
commit | 9ce00caee3639cda96ea7bc0310d6fa0aad7631b (patch) | |
tree | 44f3812d2e7d5fac2a36e028d860304d3126375d | |
parent | a91eb5e41f486628910f189bf40403568af013c7 (diff) | |
download | CMake-9ce00caee3639cda96ea7bc0310d6fa0aad7631b.zip CMake-9ce00caee3639cda96ea7bc0310d6fa0aad7631b.tar.gz CMake-9ce00caee3639cda96ea7bc0310d6fa0aad7631b.tar.bz2 |
CPack/RPM: DIST-MONOLITHIC-type subtest fix
Test was failing in case dist macro contained
a + symbol which is valid but must be escaped
for using the string as a regex.
Fixes #17328
-rw-r--r-- | Tests/RunCMake/CPack/tests/DIST/VerifyResult.cmake | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Tests/RunCMake/CPack/tests/DIST/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/DIST/VerifyResult.cmake index 7375ecc..1b2eb48 100644 --- a/Tests/RunCMake/CPack/tests/DIST/VerifyResult.cmake +++ b/Tests/RunCMake/CPack/tests/DIST/VerifyResult.cmake @@ -5,6 +5,11 @@ execute_process(COMMAND ${RPMBUILD_EXECUTABLE} -E %{?dist} set(whitespaces_ "[\t\n\r ]*") +# since we have no control over dist tag value we should try to escape +# the content for use as a regular expression +string(REPLACE "+" "\\+" DIST_TAG "${DIST_TAG}") +string(REPLACE "." "\\." DIST_TAG "${DIST_TAG}") + getPackageInfo("${FOUND_FILE_1}" "FILE_INFO_") if(NOT FILE_INFO_ MATCHES ".*Release${whitespaces_}:${whitespaces_}1${DIST_TAG}") message(FATAL_ERROR "Unexpected Release in '${FOUND_FILE_1}'; file info: '${FILE_INFO_}'") |