This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, next has been updated via 1301e17efbcf1a286e96240a0aa4082d134f1ea2 (commit) via 4e4b786e33cb67250a026efc1bbba6bba8575a07 (commit) via a5a6f61be37bd7fa6997e40ed43b3450834b265e (commit) from 3bd5d24975e984b7df2c55855aacaaa291ca35d1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1301e17efbcf1a286e96240a0aa4082d134f1ea2 commit 1301e17efbcf1a286e96240a0aa4082d134f1ea2 Merge: 3bd5d24 4e4b786 Author: Domen Vrankar <domen.vran...@gmail.com> AuthorDate: Sat Dec 3 14:42:45 2016 -0500 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Sat Dec 3 14:42:45 2016 -0500 Merge topic 'cpack-rpm-user-file-list-with-multiple-directives' into next 4e4b786e CPack/RPM CPACK_RPM_USER_FILELIST change release note a5a6f61b CPackRPM now supports multiple directives in CPACK_RPM_USER_FILELIST https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4e4b786e33cb67250a026efc1bbba6bba8575a07 commit 4e4b786e33cb67250a026efc1bbba6bba8575a07 Author: Domen Vrankar <domen.vran...@gmail.com> AuthorDate: Sat Dec 3 20:38:30 2016 +0100 Commit: Domen Vrankar <domen.vran...@gmail.com> CommitDate: Sat Dec 3 20:40:29 2016 +0100 CPack/RPM CPACK_RPM_USER_FILELIST change release note diff --git a/Help/release/dev/cpack-rpm-user-file-list-with-multiple-directives.rst b/Help/release/dev/cpack-rpm-user-file-list-with-multiple-directives.rst new file mode 100644 index 0000000..ad0154d --- /dev/null +++ b/Help/release/dev/cpack-rpm-user-file-list-with-multiple-directives.rst @@ -0,0 +1,6 @@ +cpack-rpm-user-file-list-with-multiple-directives +------------------------------------------------- + +* The :module:`CPackRPM` module learned to support + multiple directives per file when using + :variable:`CPACK_RPM_USER_FILELIST` variable. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a5a6f61be37bd7fa6997e40ed43b3450834b265e commit a5a6f61be37bd7fa6997e40ed43b3450834b265e Author: Harry Mallon <ha...@codexdigital.com> AuthorDate: Sat Dec 3 20:31:41 2016 +0100 Commit: Domen Vrankar <domen.vran...@gmail.com> CommitDate: Sat Dec 3 20:39:05 2016 +0100 CPackRPM now supports multiple directives in CPACK_RPM_USER_FILELIST * In older version "%dir %attr(-, root, root) foo" would put "%dir foo" in the final spec file. * Also added comment to describe this and advise not not to add trailing slashes to directories in USER_FILELIST. * Includes test in RunCMake CPack which now passes. diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index 39697f0..5021c41 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -507,10 +507,12 @@ # # May be used to explicitly specify ``%(<directive>)`` file line # in the spec file. Like ``%config(noreplace)`` or any other directive -# that be found in the ``%files`` section. Since CPackRPM is generating -# the list of files (and directories) the user specified files of -# the ``CPACK_RPM_<COMPONENT>_USER_FILELIST`` list will be removed from -# the generated list. +# that be found in the ``%files`` section. You can have multiple directives +# per line, as in ``%attr(600,root,root) %config(noreplace)``. Since +# CPackRPM is generating the list of files (and directories) the user +# specified files of the ``CPACK_RPM_<COMPONENT>_USER_FILELIST`` list will +# be removed from the generated list. If referring to directories do +# not add a trailing slash. # # .. variable:: CPACK_RPM_CHANGELOG_FILE # @@ -2055,7 +2057,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-z]+(\\([^()]*\\))? " "" F_PATH ${F}) - string(REGEX MATCH "%[A-Za-z]+(\\([^()]*\\))?" F_PREFIX ${F}) + string(REGEX MATCH "(%[A-Za-z]+(\\([^()]*\\))? )*" F_PREFIX ${F}) + string(STRIP ${F_PREFIX} F_PREFIX) if(CPACK_RPM_PACKAGE_DEBUG) message("CPackRPM:Debug: F_PREFIX=<${F_PREFIX}>, F_PATH=<${F_PATH}>") diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake index 092fb47..3077340 100644 --- a/Tests/RunCMake/CPack/RunCMakeTest.cmake +++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake @@ -22,3 +22,4 @@ run_cpack_test(PER_COMPONENT_FIELDS "RPM;DEB" false "COMPONENT") run_cpack_test_subtests(SINGLE_DEBUGINFO "no_main_component;one_component;one_component_main;no_debuginfo;one_component_no_debuginfo;no_components;valid" "RPM" true "CUSTOM") run_cpack_source_test(SOURCE_PACKAGE "RPM") run_cpack_test(SUGGESTS "RPM" false "MONOLITHIC") +run_cpack_test(USER_FILELIST "RPM" false "MONOLITHIC") diff --git a/Tests/RunCMake/CPack/tests/USER_FILELIST/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/USER_FILELIST/ExpectedFiles.cmake new file mode 100644 index 0000000..aabe537 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/USER_FILELIST/ExpectedFiles.cmake @@ -0,0 +1,2 @@ +set(EXPECTED_FILES_COUNT "1") +set(EXPECTED_FILE_CONTENT_1_LIST "/usr/one;/usr/one/foo.txt;/usr/one/two;/usr/one/two/bar.txt;/usr/three;/usr/three/baz.txt;/usr/three/qux.txt") diff --git a/Tests/RunCMake/CPack/tests/USER_FILELIST/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/USER_FILELIST/VerifyResult.cmake new file mode 100644 index 0000000..57444ed --- /dev/null +++ b/Tests/RunCMake/CPack/tests/USER_FILELIST/VerifyResult.cmake @@ -0,0 +1,12 @@ +execute_process(COMMAND ${RPM_EXECUTABLE} -qpd ${FOUND_FILE_1} + WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}" + OUTPUT_VARIABLE DOC_FILES_ + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + +string(REPLACE "\n" ";" DOC_FILES_ "${DOC_FILES_}") + +set(DOC_FILES_WANTED_ "/usr/one/foo.txt;/usr/one/two/bar.txt;/usr/three/baz.txt") +if (NOT "${DOC_FILES_}" STREQUAL "${DOC_FILES_WANTED_}") + message(FATAL_ERROR "USER_FILELIST handling error: Check filelist in spec file. Doc files were: ${DOC_FILES_}. Should have been ${DOC_FILES_WANTED_}") +endif() diff --git a/Tests/RunCMake/CPack/tests/USER_FILELIST/test.cmake b/Tests/RunCMake/CPack/tests/USER_FILELIST/test.cmake new file mode 100644 index 0000000..acfee42 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/USER_FILELIST/test.cmake @@ -0,0 +1,13 @@ +install(FILES CMakeLists.txt DESTINATION one RENAME foo.txt) +install(FILES CMakeLists.txt DESTINATION one/two RENAME bar.txt) +install(FILES CMakeLists.txt DESTINATION three RENAME baz.txt) +install(FILES CMakeLists.txt DESTINATION three RENAME qux.txt) + +# We are verifying the USER_FILELIST works by comparing what +# ends up with a %doc tag in the final rpm with what we expect +# from this USER_FILELIST. +set(CPACK_RPM_USER_FILELIST + "%doc /usr/one/foo.txt" + "%doc %attr(640,root,root) /usr/one/two/bar.txt" + "%attr(600, -, root) %doc /usr/three/baz.txt" +) ----------------------------------------------------------------------- Summary of changes: .../cpack-rpm-user-file-list-with-multiple-directives.rst | 6 ++++++ Modules/CPackRPM.cmake | 13 ++++++++----- Tests/RunCMake/CPack/RunCMakeTest.cmake | 1 + .../CPack/tests/USER_FILELIST/ExpectedFiles.cmake | 2 ++ .../RunCMake/CPack/tests/USER_FILELIST/VerifyResult.cmake | 12 ++++++++++++ Tests/RunCMake/CPack/tests/USER_FILELIST/test.cmake | 13 +++++++++++++ 6 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 Help/release/dev/cpack-rpm-user-file-list-with-multiple-directives.rst create mode 100644 Tests/RunCMake/CPack/tests/USER_FILELIST/ExpectedFiles.cmake create mode 100644 Tests/RunCMake/CPack/tests/USER_FILELIST/VerifyResult.cmake create mode 100644 Tests/RunCMake/CPack/tests/USER_FILELIST/test.cmake hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/mailman/listinfo/cmake-commits