Tests/RunCMake/CPack/DEB: Add getPackageInfo helper function

getPackageInfo helper function returns package info
for provided deb package file
This commit is contained in:
Domen Vrankar 2015-07-29 23:34:17 +02:00 committed by Brad King
parent 145735b748
commit d882d4770f
1 changed files with 10 additions and 0 deletions

View File

@ -26,3 +26,13 @@ function(verifyDebControl FILE PREFIX VERIFY_FILES)
endif()
endforeach()
endfunction()
function(getPackageInfo FILE RESULT_VAR)
execute_process(COMMAND ${DPKG_EXECUTABLE} -I ${FILE}
WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}"
OUTPUT_VARIABLE package_info_
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(${RESULT_VAR} "${package_info_}" PARENT_SCOPE)
endfunction()