[pve-devel] [PATCH manager 10/15] postinst: simplify code for transitional updates

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Jan 24 14:12:35 CET 2018


The first case won't happen anymore on a recent PVE.
The 'version is empty or <unknown>' check may drop the '<unknown>'
part, it gets handled by the 'dpkg --compare-versions' bits just
fine, if it happens at all for the 'configure' case

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 debian/postinst | 21 +++++----------------
 1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/debian/postinst b/debian/postinst
index cdec8a20..5e3dd689 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -120,28 +120,17 @@ EOF
 
     #a2ensite pve.conf >/dev/null 2>&1
 
-    # There are three sub-cases:
-    if test "${2+set}" != set; then
-      # We're being installed by an ancient dpkg which doesn't remember
-      # which version was most recently configured, or even whether
-      # there is a most recently configured version.
-      :
-
-    elif test -z "$2" -o "$2" = "<unknown>"; then
-      # The package has not ever been configured on this system, or was
-      # purged since it was last configured.
-      :
-
+    if test -z "$2"; then
+      : # no old version, nothing to do
     else
-      # Version $2 is the most recently configured version of this
-      # package.
+      # "$2" is the currenlty installing package version
       if dpkg --compare-versions "$2" '<=' '5.0-23'; then
         # 5.0-23 temporarily reverted the removal of the startcom CA in
         # ca-certificates; we've since switched to let's encrypt
         update-ca-certificates >/dev/null 2>&1
       fi
-
-    fi ;;
+    fi
+    ;;
 
   abort-upgrade|abort-remove|abort-deconfigure)
     ;;
-- 
2.14.2





More information about the pve-devel mailing list