mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Install local.zeek as symlink to pre-existing local.bro
This a convenience for those that are upgrading. If we didn't do this, then deployments can silently break until the user intervenes since BroControl now prefers to load the initially-vanilla local.zeek instead of the formerly-customized local.bro.
This commit is contained in:
parent
84ca12fdb4
commit
c640dd70cc
4 changed files with 38 additions and 7 deletions
|
@ -8,8 +8,27 @@ install(DIRECTORY ./ DESTINATION ${BRO_SCRIPT_INSTALL_PATH} FILES_MATCHING
|
|||
PATTERN "*.fp"
|
||||
)
|
||||
|
||||
# Install all local* scripts as config files since they are meant to be
|
||||
# user modify-able.
|
||||
if ( NOT BINARY_PACKAGING_MODE )
|
||||
# If the user has a local.bro file from a previous installation, prefer to
|
||||
# symlink local.zeek to it to avoid breaking their custom configuration --
|
||||
# because BroControl will now prefer to load local.zeek rather than local.bro
|
||||
# and we're about to install a default version of local.zeek.
|
||||
|
||||
set(_local_bro_dst ${BRO_SCRIPT_INSTALL_PATH}/site/local.bro)
|
||||
set(_local_zeek_dst ${BRO_SCRIPT_INSTALL_PATH}/site/local.zeek)
|
||||
|
||||
install(CODE "
|
||||
if ( \"\$ENV{DESTDIR}\" STREQUAL \"\" )
|
||||
if ( EXISTS \"${_local_bro_dst}\" AND NOT EXISTS \"${_local_zeek_dst}\" )
|
||||
message(STATUS \"WARNING: installed ${_local_zeek_dst} as symlink to ${_local_bro_dst}\")
|
||||
execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink
|
||||
\"${_local_bro_dst}\" \"${_local_zeek_dst}\")
|
||||
endif ()
|
||||
endif ()
|
||||
")
|
||||
endif ()
|
||||
|
||||
# Install local script as a config file since it's meant to be modified directly.
|
||||
InstallPackageConfigFile(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/site/local.zeek
|
||||
${BRO_SCRIPT_INSTALL_PATH}/site
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue