From f0cc679828f9daace29a6aad8a78cf0a7e09a4dd Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 22 May 2020 20:30:54 +0200 Subject: [PATCH] Add an exception if packaging format is not recognized --- locales/en.json | 1 + src/yunohost/app.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/locales/en.json b/locales/en.json index 95e297bc1..851656532 100644 --- a/locales/en.json +++ b/locales/en.json @@ -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…", diff --git a/src/yunohost/app.py b/src/yunohost/app.py index b9116693b..d11bceda5 100644 --- a/src/yunohost/app.py +++ b/src/yunohost/app.py @@ -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: