From 0a6d4bf1691eebddc88b7734088c425ae55e6f8f Mon Sep 17 00:00:00 2001 From: Julien Malik Date: Fri, 18 Mar 2016 15:23:14 +0100 Subject: [PATCH] [fix] Prevent non-updated multiinstance apps to be installed if no requirements for yunhost --- src/yunohost/app.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/yunohost/app.py b/src/yunohost/app.py index 1e77949c2..311f44c85 100644 --- a/src/yunohost/app.py +++ b/src/yunohost/app.py @@ -1405,6 +1405,22 @@ def _check_manifest_requirements(manifest): pkgname=pkgname, version=version, spec=spec)) + # Handle backward-incompatible change introduced in yunohost >= 2.3.6 + # See https://dev.yunohost.org/issues/156 + if 'multi_instance' in manifest and is_true(manifest['multi_instance']): + # Since 'requirements' in manifest is only introduced in stable starting from 2.4 + # we only check whether 'yunohost' is specified in requirements + # and hope that it is for ">= 2.3.6" + # This should at least prevent to install multi instance app which have not been + # updated since 2.4 is out. + # We are not safe against funny packagers who would have updated their manifest + # with for example ">= 2.2" + if 'yunohost' not in requirements: + raise MoulinetteError( + errno.EINVAL, m18n.n('minimal_yunohost_version_for_multiinstance_app_unmet', + version=min_yunohost_version)) + + def _parse_args_from_manifest(manifest, action, args={}, auth=None): """Parse arguments needed for an action from the manifest