summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2012-09-30 00:01:44 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-10-02 11:20:30 +0100
commitd40448f0483a2959e9dcaac9b6dd35839f396a6e (patch)
tree1e6c4a4eaeced337794e5801b0a9c8ea7e93756e
parent5b84d88f2a47063197f9a20f8ebf0a7ccf22c2eb (diff)
downloadbitbake-d40448f0483a2959e9dcaac9b6dd35839f396a6e.tar.gz
utils.py: Check for duplicate dependency entries
explode_dep_versions is not able to have duplicate entries. Previously duplicate entries ended up with the last item being the one returned to the caller. We now detect a collision. We do allow an empty item to have a comparison added to it, or a duplicate with the same comparison without error. When a collision is detected a ValueError exception is thrown. Allowed: foo foo (= 1.12) foo Invalid: foo (= 1.12) foo (= 1.13) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/utils.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/bb/utils.py b/lib/bb/utils.py
index 82dab6b54..d032ab299 100644
--- a/lib/bb/utils.py
+++ b/lib/bb/utils.py
@@ -157,9 +157,12 @@ def explode_dep_versions(s):
elif inversion and i.endswith(')'):
inversion = False
lastver = lastver + " " + (i[:-1] or "")
+ if lastdep in r and r[lastdep] and r[lastdep] != lastver:
+ raise ValueError("Error, item %s appeared in dependency string '%s' multiple times with different values. explode_dep_versions cannot cope with this." % (lastdep, s))
r[lastdep] = lastver
elif not inversion:
- r[i] = None
+ if not (i in r and r[i]):
+ r[i] = None
lastdep = i
lastver = ""
elif inversion: