CPackDeb: always treat PACKAGE_DEPENDS as a list

Remove some edge cases where if CPACK_DEBIAN_PACKAGE_DEPENDS is a list
it would not be expanded on all components leaving some with ';'(s) in
the Depends field of the control file.
Same goes for using CPACK_DEBIAN_PACKAGE_SHLIBDEPS.
This commit is contained in:
Edoardo Bortolozzo
2024-10-03 10:35:37 +02:00
committed by Brad King
parent 823e0a3a61
commit 443a06807c
2 changed files with 12 additions and 2 deletions

View File

@@ -182,11 +182,22 @@ List of CPack DEB generator specific variables:
only the automatically discovered dependencies will be set for this
component.
.. versionchanged:: 3.31
The variable is always expanded as a list. Before it was expanded only
if used in cooperation with :variable:`CPACK_DEB_COMPONENT_INSTALL`,
:variable:`CPACK_DEBIAN_PACKAGE_SHLIBDEPS` or
:variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_SHLIBDEPS`.
This meant that if a component had no shared libraries discovered
(e.g. a package composed only of scripts) you had to join the list
by yourself to obtain a valid Depends field.
Example:
.. code-block:: cmake
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.3.1-6), libc6 (< 2.4)")
list(APPEND CPACK_DEBIAN_PACKAGE_DEPENDS cmake)
.. variable:: CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS

View File

@@ -589,7 +589,6 @@ function(cpack_deb_prepare_package_vars)
list(JOIN COMPONENT_DEPENDS ", " COMPONENT_DEPENDS)
if(COMPONENT_DEPENDS)
list(PREPEND CPACK_DEBIAN_PACKAGE_DEPENDS ${COMPONENT_DEPENDS})
list(JOIN CPACK_DEBIAN_PACKAGE_DEPENDS ", " CPACK_DEBIAN_PACKAGE_DEPENDS)
endif()
endif()
endif()
@@ -599,9 +598,9 @@ function(cpack_deb_prepare_package_vars)
# Append automatically discovered dependencies .
if(CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS)
list(APPEND CPACK_DEBIAN_PACKAGE_DEPENDS ${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS})
list(JOIN CPACK_DEBIAN_PACKAGE_DEPENDS ", " CPACK_DEBIAN_PACKAGE_DEPENDS)
endif()
list(JOIN CPACK_DEBIAN_PACKAGE_DEPENDS ", " CPACK_DEBIAN_PACKAGE_DEPENDS)
if(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
message(STATUS "CPACK_DEBIAN_PACKAGE_DEPENDS not set, the package will have no dependencies.")
endif()