[bitbake-devel] [PATCH 1/3] utils: ensure explode_dep_versions2 raises an exception on invalid/missing operator

Paul Eggleton paul.eggleton at linux.intel.com
Tue Feb 10 18:13:23 UTC 2015


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 at linux.intel.com>
---
 lib/bb/utils.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/bb/utils.py b/lib/bb/utils.py
index 90090b2..7ba1234 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()
-- 
1.9.3




More information about the bitbake-devel mailing list