From 975dfca7addd444cb44115a38aebd5f855e9ed6d Mon Sep 17 00:00:00 2001 From: James Valleroy Date: Wed, 3 Feb 2021 19:05:28 -0500 Subject: [PATCH] roundcube: Allow upgrade to 1.4.* Hold roundcube during dist upgrade. Closes: #2035. Signed-off-by: James Valleroy Reviewed-by: Sunil Mohan Adapa --- actions/upgrades | 4 +++- plinth/modules/roundcube/__init__.py | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/actions/upgrades b/actions/upgrades index e6d135dd7..b52e01499 100755 --- a/actions/upgrades +++ b/actions/upgrades @@ -422,7 +422,9 @@ def _perform_dist_upgrade(): # Hold packages known to have conffile prompts. FreedomBox service # will handle their upgrade later. - packages_with_prompts = ['firewalld', 'mumble-server', 'radicale'] + packages_with_prompts = [ + 'firewalld', 'mumble-server', 'radicale', 'roundcube-core' + ] print( 'Holding packages with conffile prompts: ' + ', '.join(packages_with_prompts) + '...', flush=True) diff --git a/plinth/modules/roundcube/__init__.py b/plinth/modules/roundcube/__init__.py index 5b663f2af..8250e0491 100644 --- a/plinth/modules/roundcube/__init__.py +++ b/plinth/modules/roundcube/__init__.py @@ -11,6 +11,7 @@ from plinth import frontpage, menu from plinth.modules.apache.components import Webserver from plinth.modules.backups.components import BackupRestore from plinth.modules.firewall.components import Firewall +from plinth.utils import Version from . import manifest @@ -89,3 +90,18 @@ def setup(helper, old_version=None): helper.install(managed_packages) helper.call('post', actions.superuser_run, 'roundcube', ['setup']) helper.call('post', app.enable) + + +def force_upgrade(helper, packages): + """Force upgrade package to resolve conffile prompts.""" + if 'roundcube-core' not in packages: + return False + + # Allow roundcube any lower version to upgrade to 1.4.* + package = packages['roundcube-core'] + if Version(package['new_version']) > Version('1.5~'): + return False + + helper.install(['roundcube-core'], force_configuration='new') + actions.superuser_run('roundcube', ['setup']) + return True