mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Propagate the changes on other parts of the code relying on the appslist system
This commit is contained in:
parent
65b81e8677
commit
050750b7c9
2 changed files with 13 additions and 29 deletions
|
@ -86,28 +86,10 @@ def app_list(filter=None, raw=False, installed=False, with_backup=False):
|
||||||
"""
|
"""
|
||||||
installed = with_backup or installed
|
installed = with_backup or installed
|
||||||
|
|
||||||
app_dict = {}
|
|
||||||
list_dict = {} if raw else []
|
list_dict = {} if raw else []
|
||||||
|
|
||||||
appslists = _read_appslist_list()
|
# Get app list from applist cache
|
||||||
|
app_dict = _load_appslist()
|
||||||
for appslist in appslists.keys():
|
|
||||||
|
|
||||||
json_path = "%s/%s.json" % (REPO_PATH, appslist)
|
|
||||||
|
|
||||||
# If we don't have the json yet, try to fetch it
|
|
||||||
if not os.path.exists(json_path):
|
|
||||||
app_fetchlist(name=appslist)
|
|
||||||
|
|
||||||
# If it now exist
|
|
||||||
if os.path.exists(json_path):
|
|
||||||
appslist_content = read_json(json_path)
|
|
||||||
for app, info in appslist_content.items():
|
|
||||||
if app not in app_dict:
|
|
||||||
info['repository'] = appslist
|
|
||||||
app_dict[app] = info
|
|
||||||
else:
|
|
||||||
logger.warning("Uh there's no data for applist '%s' ... (That should be just a temporary issue?)" % appslist)
|
|
||||||
|
|
||||||
# Get app list from the app settings directory
|
# Get app list from the app settings directory
|
||||||
for app in os.listdir(APPS_SETTING_PATH):
|
for app in os.listdir(APPS_SETTING_PATH):
|
||||||
|
|
|
@ -38,7 +38,7 @@ from moulinette import msignals, m18n
|
||||||
from moulinette.utils.log import getActionLogger
|
from moulinette.utils.log import getActionLogger
|
||||||
from moulinette.utils.process import check_output, call_async_output
|
from moulinette.utils.process import check_output, call_async_output
|
||||||
from moulinette.utils.filesystem import read_json, write_to_json
|
from moulinette.utils.filesystem import read_json, write_to_json
|
||||||
from yunohost.app import app_fetchlist, app_info, app_upgrade, app_ssowatconf, app_list, _install_appslist_fetch_cron
|
from yunohost.app import _update_appslist, app_info, app_upgrade, app_ssowatconf, app_list
|
||||||
from yunohost.domain import domain_add, domain_list, _get_maindomain, _set_maindomain
|
from yunohost.domain import domain_add, domain_list, _get_maindomain, _set_maindomain
|
||||||
from yunohost.dyndns import _dyndns_available, _dyndns_provides
|
from yunohost.dyndns import _dyndns_available, _dyndns_provides
|
||||||
from yunohost.firewall import firewall_upnp
|
from yunohost.firewall import firewall_upnp
|
||||||
|
@ -411,15 +411,17 @@ def tools_postinstall(operation_logger, domain, password, ignore_dyndns=False,
|
||||||
# Enable UPnP silently and reload firewall
|
# Enable UPnP silently and reload firewall
|
||||||
firewall_upnp('enable', no_refresh=True)
|
firewall_upnp('enable', no_refresh=True)
|
||||||
|
|
||||||
# Setup the default apps list with cron job
|
# Initialize the appslist system
|
||||||
|
_initialize_appslist_system()
|
||||||
|
|
||||||
|
# Try to update the appslist ...
|
||||||
|
# we don't fail miserably if this fails,
|
||||||
|
# because that could be for example an offline installation...
|
||||||
try:
|
try:
|
||||||
app_fetchlist(name="yunohost",
|
_update_appslist()
|
||||||
url="https://app.yunohost.org/apps.json")
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.warning(str(e))
|
logger.warning(str(e))
|
||||||
|
|
||||||
_install_appslist_fetch_cron()
|
|
||||||
|
|
||||||
# Init migrations (skip them, no need to run them on a fresh system)
|
# Init migrations (skip them, no need to run them on a fresh system)
|
||||||
_skip_all_migrations()
|
_skip_all_migrations()
|
||||||
|
|
||||||
|
@ -465,6 +467,7 @@ def tools_update(apps=False, system=False):
|
||||||
Keyword arguments:
|
Keyword arguments:
|
||||||
system -- Fetch available system packages upgrades (equivalent to apt update)
|
system -- Fetch available system packages upgrades (equivalent to apt update)
|
||||||
apps -- Fetch the application list to check which apps can be upgraded
|
apps -- Fetch the application list to check which apps can be upgraded
|
||||||
|
appslist -- Just update the application list cache
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# If neither --apps nor --system specified, do both
|
# If neither --apps nor --system specified, do both
|
||||||
|
@ -510,11 +513,10 @@ def tools_update(apps=False, system=False):
|
||||||
|
|
||||||
upgradable_apps = []
|
upgradable_apps = []
|
||||||
if apps:
|
if apps:
|
||||||
logger.info(m18n.n('updating_app_lists'))
|
|
||||||
try:
|
try:
|
||||||
app_fetchlist()
|
_update_appslist()
|
||||||
except YunohostError as e:
|
except YunohostError as e:
|
||||||
logger.error(m18n.n('tools_update_failed_to_app_fetchlist'), error=e)
|
logger.error(str(e))
|
||||||
|
|
||||||
upgradable_apps = list(_list_upgradable_apps())
|
upgradable_apps = list(_list_upgradable_apps())
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue