summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2021-07-12 03:09:35 (GMT)
committerBrad King <brad.king@kitware.com>2021-07-12 21:04:29 (GMT)
commit805fa791d10c31ba629306328c2f491708e3e88b (patch)
tree472b2f1201eaf5014775dcd45fcd1a6a273b120a
parentac984cb5f75349fd5ed00cc52fbb5154b7bb1527 (diff)
downloadCMake-805fa791d10c31ba629306328c2f491708e3e88b.zip
CMake-805fa791d10c31ba629306328c2f491708e3e88b.tar.gz
CMake-805fa791d10c31ba629306328c2f491708e3e88b.tar.bz2
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
-rw-r--r--Modules/Internal/CPack/CPackDeb.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/Internal/CPack/CPackDeb.cmake b/Modules/Internal/CPack/CPackDeb.cmake
index 2ceab10..967ad7b 100644
--- a/Modules/Internal/CPack/CPackDeb.cmake
+++ b/Modules/Internal/CPack/CPackDeb.cmake
@@ -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)