[pve-devel] [PATCH manager v2 10/17] postinst: simplify code for transitional updates
Thomas Lamprecht
t.lamprecht at proxmox.com
Mon Mar 12 14:14:01 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 0dc897ba..95b2fb24 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -122,28 +122,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 most recently configured 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