bitbake: utils: ensure explode_dep_versions2 raises an exception on invalid/missing operator

We really want an error rather than the version to just be silently
skipped when the operator is missing (e.g. "somepackage (1.0)" was
specified instead of "somepackage (>= 1.0)".)

(Bitbake rev: b6dc946f477adc40d68da16e2f2580cb3b4a10db)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Paul Eggleton 2015-02-10 18:13:23 +00:00 committed by Richard Purdie
parent b427750a5d
commit 93c3f3922c
1 changed files with 4 additions and 0 deletions

View File

@ -53,6 +53,9 @@ def set_context(ctx):
# Context used in better_exec, eval
_context = clean_context()
class VersionStringException(Exception):
"""Exception raised when an invalid version specification is found"""
def explode_version(s):
r = []
alpha_regexp = re.compile('^([a-zA-Z]+)(.*)$')
@ -188,6 +191,7 @@ def explode_dep_versions2(s):
i = i[1:]
else:
# This is an unsupported case!
raise VersionStringException('Invalid version specification in "(%s" - invalid or missing operator' % i)
lastcmp = (i or "")
i = ""
i.strip()