]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
utils: ensure explode_dep_versions2 raises an exception on invalid/missing operator
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Tue, 10 Feb 2015 18:13:23 +0000 (18:13 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 16 Feb 2015 09:10:30 +0000 (09:10 +0000)
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>
lib/bb/utils.py

index 90090b2fe341347ddda22a38f6dffae09c99fa07..7ba1234578fecef8b329ef9089b73dd8a08e151a 100644 (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()