mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
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:
parent
0dea9e80f3
commit
bd20b6570b
@ -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():
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user