summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
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:40:53 +0100
commite7ba10c1de29277113ad47e9c3686823aa43e845 (patch)
tree4bbe85877ff73cfc483da7379049a06867153ddb /bitbake/lib
parent5fdbda6922327d963d4fe1c597fed8f0dfd20ed1 (diff)
downloadpoky-e7ba10c1de29277113ad47e9c3686823aa43e845.tar.gz
bitbake: 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) (Bitbake rev: d40448f0483a2959e9dcaac9b6dd35839f396a6e) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/utils.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index 82dab6b542..d032ab299e 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -157,9 +157,12 @@ def explode_dep_versions(s):
157 elif inversion and i.endswith(')'): 157 elif inversion and i.endswith(')'):
158 inversion = False 158 inversion = False
159 lastver = lastver + " " + (i[:-1] or "") 159 lastver = lastver + " " + (i[:-1] or "")
160 if lastdep in r and r[lastdep] and r[lastdep] != lastver:
161 raise ValueError("Error, item %s appeared in dependency string '%s' multiple times with different values. explode_dep_versions cannot cope with this." % (lastdep, s))
160 r[lastdep] = lastver 162 r[lastdep] = lastver
161 elif not inversion: 163 elif not inversion:
162 r[i] = None 164 if not (i in r and r[i]):
165 r[i] = None
163 lastdep = i 166 lastdep = i
164 lastver = "" 167 lastver = ""
165 elif inversion: 168 elif inversion: