diff --git a/cmake/developer_package/packaging/packaging.cmake b/cmake/developer_package/packaging/packaging.cmake index a66b24dfc71..13097a20672 100644 --- a/cmake/developer_package/packaging/packaging.cmake +++ b/cmake/developer_package/packaging/packaging.cmake @@ -122,6 +122,32 @@ function(ov_install_with_name file component) endif() endfunction() +# +# checks that current OpenVINO versions has previous version in RPM / DEB conflicts +# +function(ov_check_conflicts_versions var_name) + set(ov_major ${OpenVINO_VERSION_MAJOR}) + set(ov_minor ${OpenVINO_VERSION_MINOR}) + set(ov_patch ${OpenVINO_VERSION_PATCH}) + + if(ov_patch EQUAL 0) + if(ov_minor EQUAL 0) + math(EXPR ov_major "${ov_major} - 1") + else() + math(EXPR ov_minor "${ov_minor} - 1") + endif() + else() + math(EXPR ov_patch "${ov_patch} - 1") + endif() + + set(ov_prev_version "${ov_major}.${ov_minor}.${ov_patch}") + + # perform check + if(NOT ov_prev_version IN_LIST ${var_name}) + message(FATAL_ERROR "List ${var_name} (${${var_name}}) does not contain verison ${ov_prev_version}") + endif() +endfunction() + # # List of public OpenVINO components # diff --git a/cmake/packaging/debian.cmake b/cmake/packaging/debian.cmake index 234f921e347..81d5a22afc7 100644 --- a/cmake/packaging/debian.cmake +++ b/cmake/packaging/debian.cmake @@ -92,6 +92,8 @@ macro(ov_cpack_settings) 2023.2.0 ) + ov_check_conflicts_versions(conflicting_versions) + # # core: base dependency for each component # diff --git a/cmake/packaging/rpm.cmake b/cmake/packaging/rpm.cmake index 5aa6808fa11..9cac54e742d 100644 --- a/cmake/packaging/rpm.cmake +++ b/cmake/packaging/rpm.cmake @@ -78,6 +78,8 @@ macro(ov_cpack_settings) 2023.2.0 ) + ov_check_conflicts_versions(conflicting_versions) + find_host_program(rpmlint_PROGRAM NAMES rpmlint DOC "Path to rpmlint") if(rpmlint_PROGRAM) execute_process(COMMAND "${rpmlint_PROGRAM}" --version