diff options
author | Domen Vrankar <domen.vrankar@gmail.com> | 2015-07-13 20:23:22 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-07-15 13:59:44 (GMT) |
commit | 32e9276a086c8ec78d0d6ff15bf576571118c3d7 (patch) | |
tree | 7329129f2a6f2ffea8656b1cf1472852a1d4e82d /Tests | |
parent | 47d1f1189c53f02010d16ef541835c016fd8302d (diff) | |
download | CMake-32e9276a086c8ec78d0d6ff15bf576571118c3d7.zip CMake-32e9276a086c8ec78d0d6ff15bf576571118c3d7.tar.gz CMake-32e9276a086c8ec78d0d6ff15bf576571118c3d7.tar.bz2 |
Tests/RunCMake/CPack/DEB: add verifyDebControl
Add verifyDebControl helper function for checking
of package control files such as preinstall scripts.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/CPack/DEB/Helpers.cmake | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Tests/RunCMake/CPack/DEB/Helpers.cmake b/Tests/RunCMake/CPack/DEB/Helpers.cmake index 4ed3fbd..45c85c3 100644 --- a/Tests/RunCMake/CPack/DEB/Helpers.cmake +++ b/Tests/RunCMake/CPack/DEB/Helpers.cmake @@ -8,3 +8,21 @@ function(getPackageContent FILE RESULT_VAR) set(${RESULT_VAR} "${package_content_}" PARENT_SCOPE) endfunction() + +function(verifyDebControl FILE PREFIX VERIFY_FILES) + execute_process(COMMAND ${DPKG_EXECUTABLE} --control ${FILE} control_${PREFIX} + ERROR_VARIABLE err_) + + if(err_) + message(FATAL_ERROR "Debian controll verification failed for file: " + "'${FILE}'; error output: '${err_}'") + endif() + + foreach(FILE_ IN LISTS VERIFY_FILES) + file(READ "${CMAKE_CURRENT_BINARY_DIR}/control_${PREFIX}/${FILE_}" content_) + if(NOT content_ MATCHES "${${PREFIX}_${FILE_}}") + message(FATAL_ERROR "Unexpected content in for '${PREFIX}_${FILE_}'!" + " Content: '${content_}'") + endif() + endforeach() +endfunction() |