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:42 +0000 |
commit | 93c3f3922c477e8062c09492c94169276168db96 (patch) | |
tree | 2c7202a94f4f6952aba652fff23e3e52c195c563 | |
parent | b427750a5d8e2a2e1a675f68dea250eb25e94c8e (diff) | |
download | poky-93c3f3922c477e8062c09492c94169276168db96.tar.gz |
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>
-rw-r--r-- | bitbake/lib/bb/utils.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 90090b2fe3..7ba1234578 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
@@ -53,6 +53,9 @@ def set_context(ctx): | |||
53 | # Context used in better_exec, eval | 53 | # Context used in better_exec, eval |
54 | _context = clean_context() | 54 | _context = clean_context() |
55 | 55 | ||
56 | class VersionStringException(Exception): | ||
57 | """Exception raised when an invalid version specification is found""" | ||
58 | |||
56 | def explode_version(s): | 59 | def explode_version(s): |
57 | r = [] | 60 | r = [] |
58 | alpha_regexp = re.compile('^([a-zA-Z]+)(.*)$') | 61 | alpha_regexp = re.compile('^([a-zA-Z]+)(.*)$') |
@@ -188,6 +191,7 @@ def explode_dep_versions2(s): | |||
188 | i = i[1:] | 191 | i = i[1:] |
189 | else: | 192 | else: |
190 | # This is an unsupported case! | 193 | # This is an unsupported case! |
194 | raise VersionStringException('Invalid version specification in "(%s" - invalid or missing operator' % i) | ||
191 | lastcmp = (i or "") | 195 | lastcmp = (i or "") |
192 | i = "" | 196 | i = "" |
193 | i.strip() | 197 | i.strip() |