Преглед изворни кода

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.
Edoardo Bortolozzo пре 1 година
родитељ
комит
443a06807c
2 измењених фајлова са 12 додато и 2 уклоњено
  1. 11 0
      Help/cpack_gen/deb.rst
  2. 1 2
      Modules/Internal/CPack/CPackDeb.cmake

+ 11 - 0
Help/cpack_gen/deb.rst

@@ -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
 

+ 1 - 2
Modules/Internal/CPack/CPackDeb.cmake

@@ -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()