PREUN
/bin/sh
if [ $1 -eq 0 ] && [ -x "/usr/lib/systemd/systemd-update-helper" ]; then
# Package removal, not upgrade
/usr/lib/systemd/systemd-update-helper remove-system-units netconsole.service || :
fi
POSTIN
/bin/sh
# (ovitters) remember $1 for usage in posttrans scriptlet as posttrans always
# sets $1 to 1. See see https://bugs.mageia.org/show_bug.cgi?id=19882 and the
# comment in posttrans scriplet
#
# Note: Logic is a bit weird to avoid a dependency on mkdir. The 'mkdir'
# command might not exist in the install case. On upgrade the system will have·
# 'mkdir'. So basically this post scriptlet tells posttrans not to run the
# 'install' logic.
#
# WARNING: Do NOT add a Requires(post) on coreutils! Might cause dependency
# loops (see above bug for detailed discussion
if [ "$1" -ne 1 ]; then
# ignore "mkdir" not found errors
mkdir -p "/var/lib/rpm-state/netconsole-service.notinstall" 2> /dev/null || :
fi
POSTUN
/bin/sh
# ---------------
POSTTRANS
/bin/sh
# (ovitters) The posttrans scriptlet always has $1 to 1. This confuses:
# 1. The systemd_post scriplet (makes use of $1).
# 2. Any usage of $1 in posttrans (was used to not call chkconfig)
#
# systemd_post scriptlet only does something when the rpm is installed.·
# Make use of that knowledge to only call these scriptlets when this package is
# first installed. See https://bugs.mageia.org/show_bug.cgi?id=19882
if [ ! -d "/var/lib/rpm-state/netconsole-service.notinstall" ]; then
if [ $1 -eq 1 ] && [ -x "/usr/lib/systemd/systemd-update-helper" ]; then
# Initial installation
/usr/lib/systemd/systemd-update-helper install-system-units netconsole.service || :
fi
# reset the state
rmdir "/var/lib/rpm-state/netconsole-service.notinstall" 2> /dev/null || :
fi