Add an exception if packaging format is not recognized

This commit is contained in:
Alexandre Aubin 2020-05-22 20:30:54 +02:00
parent 33667d7b1a
commit f0cc679828
2 changed files with 6 additions and 0 deletions

View file

@ -48,6 +48,7 @@
"app_upgrade_script_failed": "An error occurred inside the app upgrade script",
"app_upgrade_some_app_failed": "Some apps could not be upgraded",
"app_upgraded": "{app:s} upgraded",
"app_packaging_format_not_supported": "This app cannot be installed because its packaging format is not supported by your Yunohost version. You should probably consider upgrading your system.",
"apps_already_up_to_date": "All apps are already up-to-date",
"apps_catalog_init_success": "App catalog system initialized!",
"apps_catalog_updating": "Updating application catalog…",

View file

@ -2322,6 +2322,11 @@ def _encode_string(value):
def _check_manifest_requirements(manifest, app_instance_name):
"""Check if required packages are met from the manifest"""
packaging_format = int(manifest.get('packaging_format', 0))
if packaging_format not in [0, 1]:
raise YunohostError("app_packaging_format_not_supported")
requirements = manifest.get('requirements', dict())
if not requirements: