backports: When upgrading from older version, assumed requested

- This helps the case where an user installs FreedomBox on Buster and then after
finishing the first boot wizard and before repositories have been setup,
upgrades to latest FreedomBox version.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2020-09-08 15:53:03 -07:00 committed by James Valleroy
parent ff4b4414fd
commit 271f88d9ed
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -18,7 +18,7 @@ from plinth import cfg, glib, menu
from .manifest import backup # noqa, pylint: disable=unused-import
version = 6
version = 7
is_essential = True
@ -119,6 +119,11 @@ def setup(helper, old_version=None):
# increment.
helper.call('post', actions.superuser_run, 'upgrades', ['setup'])
# When upgrading from a version without first boot wizard for backports,
# assume backports have been requested.
if old_version and old_version < 7:
set_backports_requested(can_activate_backports())
# Try to setup apt repositories, if needed, if possible, on first install
# and on version increment.
helper.call('post', setup_repositories, None)