memgraph/release/debian/preinst
Marko Budiselić 291158160d Put all logrotate config to a file per offering (#23)
Not having one logrotate file produced an error during rpmlint.  It makes sense
to have one logrotate file after Memgraph is installed because it's easier to
manage config files. There are two logrotate files in the codebase, one for
Community and one for Enterprise edition. Having rotate files per offering also
makes sense because offerings are affected less often compared to the features.
It's easier to maintain.
2020-10-17 20:10:55 +02:00

20 lines
782 B
Bash

#!/bin/sh
# preinst script for memgraph
#
# see: dh_installdeb(1)
set -e
# Manage (remove) /etc/logrotate.d/memgraph_audit file because the whole
# logrotate config is moved to /etc/logrotate.d/memgraph since v1.2.0.
# Note: Only used to manage Memgraph Enterprise config but packaged into the
# Memgraph Community as well.
if dpkg-maintscript-helper supports rm_conffile 2>/dev/null; then
# 1.1.999 is chosen because it's high enough version number. It's highly
# unlikely (impossible) that the patch number in v1.1 reaches 999
# (it's 0 on 2020-10-17).
# Tested with: `dpkg --compare-versions -- "1.2" le-nl "1.1.999"`
# (used inside dpkg-maintscript-helper script).
dpkg-maintscript-helper rm_conffile /etc/logrotate.d/memgraph_audit 1.1.999 -- "$@"
fi