ttrss: Implement upgrade from 17.4 to 18.12

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2019-03-01 16:51:49 -08:00 committed by James Valleroy
parent 0dea9e80f3
commit bd20b6570b
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
2 changed files with 18 additions and 2 deletions

View File

@ -81,7 +81,8 @@ def subcommand_setup(_):
aug.save()
action_utils.service_try_restart('tt-rss')
if action_utils.service_is_enabled('tt-rss'):
action_utils.service_restart('tt-rss')
def enable_api_access():

View File

@ -25,7 +25,7 @@ from plinth import action_utils, actions, cfg, frontpage
from plinth import service as service_module
from plinth.menu import main_menu
from plinth.modules.users import register_group
from plinth.utils import format_lazy
from plinth.utils import Version, format_lazy
from .manifest import backup, clients
@ -99,6 +99,21 @@ def setup(helper, old_version=None):
helper.call('post', add_shortcut)
def force_upgrade(helper, packages):
"""Force update package to resolve conffile prompts."""
if 'tt-rss' not in packages:
return
# tt-rss 17.4 -> 18.12
package = packages['tt-rss']
if Version(package['current_version']) >= Version('18.12') or \
Version(package['new_version']) < Version('18.12'):
return
helper.install(['tt-rss'], force_configuration='new')
actions.superuser_run('ttrss', ['setup'])
def add_shortcut():
"""Add a shortcut to the front page."""
frontpage.add_shortcut('ttrss', name, short_description=short_description,