Skip to content
Snippets Groups Projects
Commit 805fa791 authored by Alex Turbov's avatar Alex Turbov Committed by Brad King
Browse files

CPack/DEB: Avoid overriding user-provided `postinst` and `postrm`

When a user provides `CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA` or
`CPACK_DEBIAN_<comp>_PACKAGE_CONTROL_EXTRA` variables in
`CMakeLists.txt` and the package contains dynamic libraries, the
`CPackDeb.cmake` sets `CPACK_ADD_LDCONFIG_CALL` to `1`.  Later it
analyzes if defaulted `postinst`/`postrm` should be generated trying to
check if the user provides any in `CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA`
variable. However, the `foreach` loop uses the invalid variable
`PACKAGE_CONTROL_EXTRA` instead, so these files gonna be overridden.
Fix the variable name.

Fixes: #22410
parent ac984cb5
No related branches found
No related tags found
No related merge requests found
......@@ -673,7 +673,7 @@ function(cpack_deb_prepare_package_vars)
if(CPACK_ADD_LDCONFIG_CALL)
set(CPACK_DEBIAN_GENERATE_POSTINST 1)
set(CPACK_DEBIAN_GENERATE_POSTRM 1)
foreach(f IN LISTS PACKAGE_CONTROL_EXTRA)
foreach(f IN LISTS CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA)
get_filename_component(n "${f}" NAME)
if(n STREQUAL "postinst")
set(CPACK_DEBIAN_GENERATE_POSTINST 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment