diff --git a/locales/en.json b/locales/en.json index a4f5ec9da..61fdcfa9b 100644 --- a/locales/en.json +++ b/locales/en.json @@ -27,7 +27,6 @@ "app_location_install_failed": "Cannot install the app there because it conflicts with the app '{other_app}' already installed in '{other_path}'", "app_location_unavailable": "This URL is either unavailable, or conflicts with the already installed app(s):\n{apps:s}", "app_manifest_invalid": "Something is wrong with the app manifest: {error}", - "app_no_upgrade": "All applications are already up-to-date", "app_not_upgraded": "The app '{failed_app}' failed to upgrade, and as a consequence the following apps upgrades have been cancelled: {apps}", "app_upgrade_stopped": "The upgrade of all applications has been stopped to prevent possible damage because the previous application failed to upgrade", "app_not_correctly_installed": "{app:s} seems to be incorrectly installed", @@ -50,6 +49,7 @@ "app_upgrade_failed": "Could not upgrade {app:s}", "app_upgrade_some_app_failed": "Some applications could not be upgraded", "app_upgraded": "{app:s} upgraded", + "apps_already_up_to_date": "All applications are already up-to-date", "apps_permission_not_found": "No permission found for the installed apps", "apps_permission_restoration_failed": "Grant the permission permission '{permission:s}' to restore {app:s}", "appslist_corrupted_json": "Could not load the application lists. It looks like {filename:s} is damaged.", diff --git a/src/yunohost/app.py b/src/yunohost/app.py index 0d30a2da3..5a51e57bb 100644 --- a/src/yunohost/app.py +++ b/src/yunohost/app.py @@ -590,7 +590,7 @@ def app_upgrade(app=[], url=None, file=None): try: app_list() except YunohostError: - raise YunohostError('app_no_upgrade') + raise YunohostError('apps_already_up_to_date') not_upgraded_apps = [] @@ -611,7 +611,7 @@ def app_upgrade(app=[], url=None, file=None): raise YunohostError('app_not_installed', app=app, all_apps=_get_all_installed_apps_id()) if len(apps) == 0: - raise YunohostError('app_no_upgrade') + raise YunohostError('apps_already_up_to_date') if len(apps) > 1: logger.info(m18n.n("app_upgrade_several_apps", apps=", ".join(apps))) diff --git a/src/yunohost/tools.py b/src/yunohost/tools.py index eb2fc5cc6..64689fe0c 100644 --- a/src/yunohost/tools.py +++ b/src/yunohost/tools.py @@ -584,10 +584,7 @@ def tools_upgrade(operation_logger, apps=None, system=False): upgradable_apps = [app["id"] for app in _list_upgradable_apps()] - if not upgradable_apps: - logger.info(m18n.n("app_no_upgrade")) - return - elif len(apps) and all(app not in upgradable_apps for app in apps): + if not upgradable_apps or (len(apps) and all(app not in upgradable_apps for app in apps)): logger.info(m18n.n("apps_already_up_to_date")) return