mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00

- Duplicates of the distribution's configuration files are now always installed with a .example suffix - Added --binary-package configure option to toggle configure logic specific to the creation of binary packages. - When not in binary packaging mode, `make install` never overwrites existing configure files in case they've been modified. The previous behavior (CMake's default) would only avoid overwriting modified files if one consistently uses the same build directory and doesn't reconfigure. - Fixed an issue with Mac package's pre-install script not preserving ACLs - Minor cleanup/refactor of the make-mac/rpm-packages scripts
34 lines
954 B
Bash
Executable file
34 lines
954 B
Bash
Executable file
#!/bin/sh
|
|
|
|
# This script is meant to be used by binary packages pre-installation.
|
|
# Variables between @ symbols are replaced by CMake at configure time.
|
|
|
|
configFiles="@INSTALLED_CONFIG_FILES@"
|
|
backupNamesFile=/tmp/bro_install_backups
|
|
|
|
# Checks if a config file exists in a default location and makes a backup
|
|
# so that a modified version is not clobbered
|
|
backupFile () {
|
|
origFile="$1"
|
|
|
|
if [ -e ${origFile} ]; then
|
|
# choose a file suffix that doesn't already exist
|
|
ver=1
|
|
while [ -e ${origFile}.${ver} ]; do
|
|
ver=$(( ver + 1 ))
|
|
done
|
|
|
|
backupFile=${origFile}.${ver}
|
|
|
|
cp -p ${origFile} ${backupFile}
|
|
|
|
# the post upgrade script will check whether the installed
|
|
# config file actually differs from existing version
|
|
# and delete unnecessary backups
|
|
echo "${backupFile}" >> ${backupNamesFile}
|
|
fi
|
|
}
|
|
|
|
for file in ${configFiles}; do
|
|
backupFile "${file}"
|
|
done
|