[Pkg-ganeti-devel] [ganeti] 18/29: Prompt to abort removal of versioned packages

Apollon Oikonomopoulos apoikos at moszumanska.debian.org
Fri Mar 7 10:15:05 UTC 2014


This is an automated email from the git hooks/post-receive script.

apoikos pushed a commit to branch master
in repository ganeti.

commit 195441d7ffc86bc1050dad0179a17f261da46aeb
Author: Apollon Oikonomopoulos <apoikos at debian.org>
Date:   Thu Mar 6 15:34:32 2014 +0200

    Prompt to abort removal of versioned packages
    
    Use debconf to prompt the user to abort removal of versioned packages
    that are still in use. This scenario can come up after upgrading to a
    new minor version and before running `gnt-cluster upgrade'. In this
    case, `apt-get autoremove' will try to remove the old packages, which
    however are still in use.
---
 debian/control                      |  6 +++---
 debian/ganeti-VER.prerm             | 25 +++++++++++++++++++++++++
 debian/ganeti-VER.templates         | 13 +++++++++++++
 debian/ganeti-haskell-VER.prerm     | 25 +++++++++++++++++++++++++
 debian/ganeti-haskell-VER.templates | 13 +++++++++++++
 debian/ganeti-htools-VER.prerm      | 25 +++++++++++++++++++++++++
 debian/ganeti-htools-VER.templates  | 13 +++++++++++++
 7 files changed, 117 insertions(+), 3 deletions(-)

diff --git a/debian/control b/debian/control
index 6465c4d..799fb42 100644
--- a/debian/control
+++ b/debian/control
@@ -66,7 +66,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, lvm2,
  openssh-client, openssh-server, bridge-utils, iproute2 | iproute,
  iputils-arping, openssl, python-simplejson, python-pyparsing, python-openssl,
  python-pyinotify, python-pycurl, python-paramiko, python-bitarray,
- python-ipaddr, socat, fping, adduser
+ python-ipaddr, socat, fping, adduser, debconf | debconf-2.0
 Provides: ${python:Provides}
 Description: Cluster-based virtualization management software - Python components
  Ganeti is a virtual server cluster management software tool built on top
@@ -87,7 +87,7 @@ Description: Cluster-based virtualization management software - Python component
 
 Package: ganeti-haskell-2.10
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}, debconf | debconf-2.0
 Description: Cluster-based virtualization management software - Haskell components
  Ganeti is a virtual server cluster management software tool built on top
  of the Xen and KVM virtualization technologies and other Free Software. After
@@ -128,7 +128,7 @@ Description: Cluster allocation tools for Ganeti - stand-alone version
 
 Package: ganeti-htools-2.10
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}, debconf | debconf-2.0
 Description: Cluster allocation tools for Ganeti 2.10
  Additional tools used for enhanced allocation, maintenance and capacity
  calculation on Ganeti clusters.
diff --git a/debian/ganeti-VER.prerm b/debian/ganeti-VER.prerm
new file mode 100644
index 0000000..78bec7c
--- /dev/null
+++ b/debian/ganeti-VER.prerm
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" != "remove" ]; then
+	exit 0;
+fi
+
+. /usr/share/debconf/confmodule
+
+target=$(readlink /etc/ganeti/lib || true)
+if [ "$target" = "/usr/lib/ganeti/VER" ]; then
+       db_version 2.0
+       db_fset ganeti-VER/abort-removal seen false
+       db_input critical ganeti-VER/abort-removal
+       db_go
+       db_get ganeti-VER/abort-removal
+
+       if [ "$RET" = "true" ]; then
+	       echo "Aborting removal on user request"
+               exit 1;
+       fi
+fi
+
+#DEBHELPER#
diff --git a/debian/ganeti-VER.templates b/debian/ganeti-VER.templates
new file mode 100644
index 0000000..99a2955
--- /dev/null
+++ b/debian/ganeti-VER.templates
@@ -0,0 +1,13 @@
+Template: ganeti-VER/abort-removal
+Type: boolean
+Default: true
+Description: Abort ganeti-VER removal?
+ You are attempting to remove ganeti-VER, but it seems that the running
+ Ganeti version is still VER.
+ .
+ This can happen if you upgrade the Ganeti package to a new minor version, but
+ have not run `gnt-cluster upgrade' yet. Removing the package will cause Ganeti to
+ stop functioning correctly.
+ .
+ It is highly recommended to abort removal now and upgrade your cluster before
+ removing ganeti-VER.
diff --git a/debian/ganeti-haskell-VER.prerm b/debian/ganeti-haskell-VER.prerm
new file mode 100644
index 0000000..54d59c5
--- /dev/null
+++ b/debian/ganeti-haskell-VER.prerm
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" != "remove" ]; then
+	exit 0;
+fi
+
+. /usr/share/debconf/confmodule
+
+target=$(readlink /etc/ganeti/lib || true)
+if [ "$target" = "/usr/lib/ganeti/VER" ]; then
+       db_version 2.0
+       db_fset ganeti-haskell-VER/abort-removal seen false
+       db_input critical ganeti-haskell-VER/abort-removal
+       db_go
+       db_get ganeti-haskell-VER/abort-removal
+
+       if [ "$RET" = "true" ]; then
+	       echo "Aborting removal on user request"
+               exit 1;
+       fi
+fi
+
+#DEBHELPER#
diff --git a/debian/ganeti-haskell-VER.templates b/debian/ganeti-haskell-VER.templates
new file mode 100644
index 0000000..3863768
--- /dev/null
+++ b/debian/ganeti-haskell-VER.templates
@@ -0,0 +1,13 @@
+Template: ganeti-haskell-VER/abort-removal
+Type: boolean
+Default: true
+Description: Abort ganeti-haskell-VER removal?
+ You are attempting to remove ganeti-haskell-VER, but it seems that the running
+ Ganeti version is still VER.
+ .
+ This can happen if you upgrade the Ganeti package to a new minor version, but
+ have not run `gnt-cluster upgrade' yet. Removing the package will cause Ganeti to
+ stop functioning correctly.
+ .
+ It is highly recommended to abort removal now and upgrade your cluster before
+ removing ganeti-haskell-VER.
diff --git a/debian/ganeti-htools-VER.prerm b/debian/ganeti-htools-VER.prerm
new file mode 100644
index 0000000..3271404
--- /dev/null
+++ b/debian/ganeti-htools-VER.prerm
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" != "remove" ]; then
+	exit 0;
+fi
+
+. /usr/share/debconf/confmodule
+
+target=$(readlink /etc/ganeti/lib || true)
+if [ "$target" = "/usr/lib/ganeti/VER" ]; then
+       db_version 2.0
+       db_fset ganeti-htools-VER/abort-removal seen false
+       db_input critical ganeti-htools-VER/abort-removal
+       db_go
+       db_get ganeti-htools-VER/abort-removal
+
+       if [ "$RET" = "true" ]; then
+	       echo "Aborting removal on user request"
+               exit 1;
+       fi
+fi
+
+#DEBHELPER#
diff --git a/debian/ganeti-htools-VER.templates b/debian/ganeti-htools-VER.templates
new file mode 100644
index 0000000..2825adb
--- /dev/null
+++ b/debian/ganeti-htools-VER.templates
@@ -0,0 +1,13 @@
+Template: ganeti-htools-VER/abort-removal
+Type: boolean
+Default: true
+Description: Abort ganeti-htools-VER removal?
+ You are attempting to remove ganeti-htools-VER, but it seems that the running
+ Ganeti version is still VER.
+ .
+ This can happen if you upgrade the Ganeti package to a new minor version, but
+ have not run `gnt-cluster upgrade' yet. Removing the package will cause Ganeti to
+ stop functioning correctly.
+ .
+ It is highly recommended to abort removal now and upgrade your cluster before
+ removing ganeti-htools-VER.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ganeti/ganeti.git



More information about the Pkg-ganeti-devel mailing list