summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-06-30 11:29:22 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-06-30 11:29:29 (GMT)
commita63ae2f1b84f0bad4abc9a4ab536bcf3f3e82e93 (patch)
tree33291736a0f43ff258d08cd8a0e125331fa08d7e /Tests
parentfccacee6093e6e7183c178b2d4a48dd2266b50a6 (diff)
parent9b53eca317e52dffa1ba8972981af7b40392e323 (diff)
downloadCMake-a63ae2f1b84f0bad4abc9a4ab536bcf3f3e82e93.zip
CMake-a63ae2f1b84f0bad4abc9a4ab536bcf3f3e82e93.tar.gz
CMake-a63ae2f1b84f0bad4abc9a4ab536bcf3f3e82e93.tar.bz2
Merge topic 'rpm-suggests'
9b53eca317 CPack/RPM: Fix weak dep support Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6274
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CPack/tests/SUGGESTS/VerifyResult.cmake20
-rw-r--r--Tests/RunCMake/CPack/tests/SUGGESTS/test_suggests.spec22
2 files changed, 31 insertions, 11 deletions
diff --git a/Tests/RunCMake/CPack/tests/SUGGESTS/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/SUGGESTS/VerifyResult.cmake
index 61ce752..d1d615b 100644
--- a/Tests/RunCMake/CPack/tests/SUGGESTS/VerifyResult.cmake
+++ b/Tests/RunCMake/CPack/tests/SUGGESTS/VerifyResult.cmake
@@ -1,15 +1,13 @@
-execute_process(COMMAND ${RPMBUILD_EXECUTABLE} --querytags
- OUTPUT_VARIABLE RPMBUILD_CAPS
- RESULT_VARIABLE RPMBUILD_CAPS_RESULT)
+# CPack uses `rpm --suggests` to check if rpmbuild supports the "Suggests:" tag.
+# This test intentionally uses a different method (build a test .spec) so any
+# problems will be caught early if functionality should change in the future.
+execute_process(
+ COMMAND ${RPMBUILD_EXECUTABLE} --nobuild test_suggests.spec
+ ERROR_QUIET
+ RESULT_VARIABLE RPMBUILD_SUGGESTS_RESULT)
-if(NOT RPMBUILD_CAPS_RESULT)
- string(REPLACE "\n" ";" RPMBUILD_CAPS "${RPMBUILD_CAPS}")
- cmake_policy(PUSH)
- cmake_policy(SET CMP0057 NEW)
- if(SUGGESTS IN_LIST RPMBUILD_CAPS)
- set(should_contain_suggests_tag_ true)
- endif()
- cmake_policy(POP)
+if(RPMBUILD_SUGGESTS_RESULT EQUAL 0)
+ set(should_contain_suggests_tag_ true)
endif()
# Only verify that suggests tag is present only if that tag is supported.
diff --git a/Tests/RunCMake/CPack/tests/SUGGESTS/test_suggests.spec b/Tests/RunCMake/CPack/tests/SUGGESTS/test_suggests.spec
new file mode 100644
index 0000000..e766fa9
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/SUGGESTS/test_suggests.spec
@@ -0,0 +1,22 @@
+# This spec file is used to check if the provided version of rpmbuild supports the "Suggests:" tag
+
+Name: test
+Version: 0
+Release: 1
+Summary: test
+License: test
+
+Suggests: suggested_package
+
+%description
+
+
+%prep
+
+%build
+%configure
+%install
+%clean
+%files
+%doc
+%changelog