]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Added missing debconf include in postinst, fixed postrm to purge db if user is ok...
authorThomas Goirand <thomas@goirand.fr>
Thu, 26 Sep 2013 15:29:26 +0000 (23:29 +0800)
committerThomas Goirand <thomas@goirand.fr>
Thu, 26 Sep 2013 15:29:26 +0000 (23:29 +0800)
Rewritten-From: b1c563731a1a48a5401a689a81e471ac94182924

trusty/debian/heat-common.postinst.in
trusty/debian/heat-common.postrm

index 68a08f6beb0a13f012b54017c6cd9fc35ea4803f..98eacb9c45be8ddbcab69673b299fdaa3ddaaef7 100644 (file)
@@ -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
index 04c3ef3c595f3d64940320a2ad4ee983a443656a..ec565ed13bf52cdbd253e21c47dca8d1aecf2347 100644 (file)
@@ -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