From f3fb0d1c946b295dbf5d7683c02a411fafcafe31 Mon Sep 17 00:00:00 2001 From: Jerome Lebleu Date: Thu, 19 Dec 2013 15:43:21 +0100 Subject: [PATCH] Implement min_version in app manifest --- yunohost_app.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/yunohost_app.py b/yunohost_app.py index 28a7af16..0f7697f9 100644 --- a/yunohost_app.py +++ b/yunohost_app.py @@ -310,6 +310,10 @@ def app_upgrade(app, url=None, file=None): else: continue + # Check min version + if 'min_version' in manifest and __version__ < manifest['min_version']: + raise YunoHostError(1, app_id + _(" requires a more recent version of the moulinette")) + app_setting_path = apps_setting_path +'/'+ app_id if original_app_id != app_id: @@ -384,6 +388,10 @@ def app_install(app, label=None, args=None): else: manifest = _extract_app_from_file(app) + # Check min version + if 'min_version' in manifest and __version__ < manifest['min_version']: + raise YunoHostError(1, _("App requires a more recent version of the moulinette")) + # Check ID if 'id' not in manifest or '__' in manifest['id']: raise YunoHostError(22, _("App id is invalid"))