summaryrefslogtreecommitdiffstats
path: root/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake')
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake25
1 files changed, 25 insertions, 0 deletions
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake
index 2093e7e..b172da2 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake
@@ -200,4 +200,29 @@ function(dpkgdeb_return_specific_metaentry output)
endif()
endfunction()
+function(get_package_description DPKG_OUTPUT RESULT_VAR)
+ string(UUID uuid NAMESPACE 00000000-0000-0000-0000-000000000000 TYPE SHA1)
+ string(REPLACE ";" "${uuid}" DPKG_OUTPUT "${DPKG_OUTPUT}")
+ string(REPLACE "\n" ";" DPKG_OUTPUT "${DPKG_OUTPUT}")
+
+ unset(_actual_description)
+ set(_parse_description FALSE)
+ foreach(_line IN LISTS DPKG_OUTPUT)
+ if(_line MATCHES " Description:.*")
+ set(_parse_description TRUE)
+ string(REPLACE " Description: " "" _line "${_line}")
+ list(APPEND _actual_description "${_line}")
+ elseif(_parse_description)
+ if(_line MATCHES " [A-Z][A-Za-z\-]+: .*")
+ set(_parse_description FALSE)
+ else()
+ list(APPEND _actual_description "${_line}")
+ endif()
+ endif()
+ endforeach()
+ list(JOIN _actual_description "\n" _actual_description)
+
+ set(${RESULT_VAR} "${_actual_description}" PARENT_SCOPE)
+endfunction()
+
cmake_policy(POP)