summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDomen Vrankar <domen.vrankar@gmail.com>2015-07-29 21:34:17 (GMT)
committerBrad King <brad.king@kitware.com>2015-08-06 13:33:50 (GMT)
commitd882d4770fec6d65d82d818b4979cb5763d253c1 (patch)
treeb4b56b8e8e72daff93ebb4010baba9e5f99280aa
parent145735b748ab04505ab7a885a54fbd175ccecee2 (diff)
downloadCMake-d882d4770fec6d65d82d818b4979cb5763d253c1.zip
CMake-d882d4770fec6d65d82d818b4979cb5763d253c1.tar.gz
CMake-d882d4770fec6d65d82d818b4979cb5763d253c1.tar.bz2
Tests/RunCMake/CPack/DEB: Add getPackageInfo helper function
getPackageInfo helper function returns package info for provided deb package file
-rw-r--r--Tests/RunCMake/CPack/DEB/Helpers.cmake10
1 files changed, 10 insertions, 0 deletions
diff --git a/Tests/RunCMake/CPack/DEB/Helpers.cmake b/Tests/RunCMake/CPack/DEB/Helpers.cmake
index 45c85c3..a204a3c 100644
--- a/Tests/RunCMake/CPack/DEB/Helpers.cmake
+++ b/Tests/RunCMake/CPack/DEB/Helpers.cmake
@@ -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()