systemd/debian/systemd-container.postinst
Felipe Sateler f5f5028055 Move conffile from systemd to systemd-container package
Use 224-2 as version in rm_conffile because otherwise the file will be
removed on 224-2 => 225-1 upgrades, when the file is now the property of
systemd-container, not systemd.

Closes: #797048
2015-08-28 13:20:22 -03:00

17 lines
678 B
Bash

#!/bin/sh
set -e
machine_policy=/etc/dbus-1/system.d/org.freedesktop.machine1.conf
if [ "$1" = configure ] && [ -z "$2" ] && [ -f ${machine_policy}.dpkg-bak ] ; then
md5sum="$(md5sum ${machine_policy} | sed -e 's/ .*//')"
old_md5sum="$(dpkg-query -W -f='${Conffiles}' systemd-container | \
sed -n -e "\' ${machine_policy} ' { s/ obsolete$//; s/.* //; p }")"
# On new installs, if the policy file was preserved on systemd upgrade
# by dpkg-maintscript helper, copy it back if the new file has not been modified yet
if [ "$md5sum" = "$old_md5sum" ] ; then
mv ${machine_policy}.dpkg-bak ${machine_policy}
fi
fi
#DEBHELPER#