mirror of
https://github.com/reactos/CMake.git
synced 2024-11-28 22:10:32 +00:00
Tests/RunCMake/CPack/DEB: add verifyDebControl
Add verifyDebControl helper function for checking of package control files such as preinstall scripts.
This commit is contained in:
parent
47d1f1189c
commit
32e9276a08
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user