mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-07-08 11:40:25 +00:00
upgrades: Use kvstore and then file to determine if backports are enabled
Signed-off-by: James Valleroy <jvalleroy@mailbox.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
65d8f82ae1
commit
d2f6fe9556
@ -139,8 +139,7 @@ def disable():
|
||||
|
||||
def setup_repositories(data):
|
||||
"""Setup apt backport repositories."""
|
||||
from plinth import kvstore
|
||||
if kvstore.get_default(BACKPORTS_ENABLED_KEY, False):
|
||||
if is_backports_enabled():
|
||||
command = ['setup-repositories']
|
||||
if cfg.develop:
|
||||
command += ['--develop']
|
||||
@ -150,7 +149,9 @@ def setup_repositories(data):
|
||||
|
||||
def is_backports_enabled():
|
||||
"""Return whether backports are enabled."""
|
||||
return os.path.exists(SOURCES_LIST)
|
||||
from plinth import kvstore
|
||||
return kvstore.get_default(BACKPORTS_ENABLED_KEY,
|
||||
os.path.exists(SOURCES_LIST))
|
||||
|
||||
|
||||
def get_current_release():
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user