From: Thomas Goirand Date: Thu, 26 Sep 2013 15:29:26 +0000 (+0800) Subject: Added missing debconf include in postinst, fixed postrm to purge db if user is ok... X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=ec544f83b19e12d7764e6b36f2a0484ad5a3f7b3;p=openstack-build%2Fheat-build.git Added missing debconf include in postinst, fixed postrm to purge db if user is ok with that. Rewritten-From: b1c563731a1a48a5401a689a81e471ac94182924 --- diff --git a/trusty/debian/heat-common.postinst.in b/trusty/debian/heat-common.postinst.in index 68a08f6b..98eacb9c 100644 --- a/trusty/debian/heat-common.postinst.in +++ b/trusty/debian/heat-common.postinst.in @@ -7,7 +7,10 @@ CONF=/etc/heat/heat.conf #PKGOS-INCLUDE# -if [ "$1" = "configure" ] ; then +if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ] ; then + . /usr/share/debconf/confmodule + . /usr/share/dbconfig-common/dpkg/postinst + pkgos_var_user_group heat chown heat:adm /var/log/heat chmod 0750 /var/log/heat diff --git a/trusty/debian/heat-common.postrm b/trusty/debian/heat-common.postrm index 04c3ef3c..ec565ed1 100644 --- a/trusty/debian/heat-common.postrm +++ b/trusty/debian/heat-common.postrm @@ -3,6 +3,23 @@ set -e if [ "${1}" = "purge" ] ; then + if [ -r /usr/share/debconf/confmodule ] ; then + . /usr/share/debconf/confmodule + db_get heat/configure_db || true + if [ "$RET" = "true" ] ; then + if [ -f /usr/share/dbconfig-common/dpkg/postrm ] ; then + . /usr/share/dbconfig-common/dpkg/postrm + dbc_go heat-common $@ + else + rm -f /etc/dbconfig-common/heat-common.conf + if which ucf >/dev/null 2>&1; then + ucf --purge /etc/dbconfig-common/heat-common.conf + ucfr --purge heat-common /etc/dbconfig-common/heat-common.conf + fi + fi + fi + fi + [ -d /var/lib/heat/cache ] && rmdir --ignore-fail-on-non-empty /var/lib/heat/cache [ -d /var/lib/heat ] && rmdir --ignore-fail-on-non-empty /var/lib/heat