diff options
author | Domen Vrankar <domen.vrankar@gmail.com> | 2016-03-28 22:51:18 (GMT) |
---|---|---|
committer | Domen Vrankar <domen.vrankar@gmail.com> | 2016-03-28 22:51:18 (GMT) |
commit | 1fe004eac3c5b905cb620580c3258ca3bd455c18 (patch) | |
tree | 4a06fcf562e5dc11cb4fb0f004e99984afdfd996 /Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake | |
parent | d29004756fa314119a91821a14eef81a2ffcf40a (diff) | |
download | CMake-1fe004eac3c5b905cb620580c3258ca3bd455c18.zip CMake-1fe004eac3c5b905cb620580c3258ca3bd455c18.tar.gz CMake-1fe004eac3c5b905cb620580c3258ca3bd455c18.tar.bz2 |
cpack rpm setting of defattr
RPM supports setting of default user, group,
file and directory permissions that will be
applied for files in package unless specified
per file/dir with attr setting
This is related to bug report 14714
Diffstat (limited to 'Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake')
-rw-r--r-- | Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake index 34b9c82..0c5cca8 100644 --- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake +++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake @@ -304,6 +304,30 @@ if(CPackGen MATCHES "RPM") message(FATAL_ERROR "error: '${check_file}' rpm package content does not match expected value - regex '${check_content_list}'; RPM output: '${check_package_content}'; generated spec file: '${spec_file_content}'") endif() + + # validate permissions user and group + execute_process(COMMAND ${RPM_EXECUTABLE} -pqlv ${check_file} + OUTPUT_VARIABLE check_file_content + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + + if(check_file_libraries_match) + set(check_file_match_expected_permissions ".*-rwx------.*user.*defgrp.*") + elseif(check_file_headers_match) + set(check_file_match_expected_permissions ".*-rwxr--r--.*defusr.*defgrp.*") + elseif(check_file_applications_match) + set(check_file_match_expected_permissions ".*-rwxr--r--.*defusr.*group.*") + elseif(check_file_Unspecified_match) + set(check_file_match_expected_permissions ".*-rwxr--r--.*defusr.*defgrp.*") + else() + message(FATAL_ERROR "error: unexpected rpm package '${check_file}'") + endif() + + string(REGEX MATCH "${check_file_match_expected_permissions}" check_file_match_permissions "${check_file_content}") + + if(NOT check_file_match_permissions) + message(FATAL_ERROR "error: '${check_file}' rpm package permissions do not match expected value - regex '${check_file_match_expected_permissions}'") + endif() endforeach() ####################### |