diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-02-10 18:13:23 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-02-16 09:10:30 +0000 |
commit | b6dc946f477adc40d68da16e2f2580cb3b4a10db (patch) | |
tree | 4e7a026350e06ae9af40951c65e0c52d96814710 /lib/bb | |
parent | f35e9bd7b59c180fe9a3d9177efb57b92d9cd373 (diff) | |
download | bitbake-b6dc946f477adc40d68da16e2f2580cb3b4a10db.tar.gz |
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)".)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb')
-rw-r--r-- | lib/bb/utils.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/bb/utils.py b/lib/bb/utils.py index 90090b2fe..7ba123457 100644 --- a/lib/bb/utils.py +++ b/lib/bb/utils.py @@ -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() |