diff options
| -rw-r--r-- | bitbake/lib/bb/utils.py | 27 | 
1 files changed, 21 insertions, 6 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index a537338326..cef0fdd5b8 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py  | |||
| @@ -138,7 +138,7 @@ def explode_deps(s): | |||
| 138 | #r[-1] += ' ' + ' '.join(j) | 138 | #r[-1] += ' ' + ' '.join(j) | 
| 139 | return r | 139 | return r | 
| 140 | 140 | ||
| 141 | def explode_dep_versions(s): | 141 | def explode_dep_versions2(s): | 
| 142 | """ | 142 | """ | 
| 143 | Take an RDEPENDS style string of format: | 143 | Take an RDEPENDS style string of format: | 
| 144 | "DEPEND1 (optional version) DEPEND2 (optional version) ..." | 144 | "DEPEND1 (optional version) DEPEND2 (optional version) ..." | 
| @@ -188,9 +188,9 @@ def explode_dep_versions(s): | |||
| 188 | lastver += " " | 188 | lastver += " " | 
| 189 | if i: | 189 | if i: | 
| 190 | lastver += i | 190 | lastver += i | 
| 191 | if lastdep in r and r[lastdep] and r[lastdep] != lastver: | 191 | if lastdep not in r: | 
| 192 | raise ValueError("Error, item %s appeared in dependency string '%s' multiple times with different values. explode_dep_versions cannot cope with this." % (lastdep, s)) | 192 | r[lastdep] = [] | 
| 193 | r[lastdep] = lastcmp + " " + lastver | 193 | r[lastdep].append(lastcmp + " " + lastver) | 
| 194 | continue | 194 | continue | 
| 195 | 195 | ||
| 196 | #if not inversion: | 196 | #if not inversion: | 
| @@ -198,8 +198,19 @@ def explode_dep_versions(s): | |||
| 198 | lastver = "" | 198 | lastver = "" | 
| 199 | lastcmp = "" | 199 | lastcmp = "" | 
| 200 | if not (i in r and r[i]): | 200 | if not (i in r and r[i]): | 
| 201 | r[lastdep] = None | 201 | r[lastdep] = [] | 
| 202 | |||
| 203 | return r | ||
| 202 | 204 | ||
| 205 | def explode_dep_versions(s): | ||
| 206 | r = explode_dep_versions2(s) | ||
| 207 | for d in r: | ||
| 208 | if not r[d]: | ||
| 209 | r[d] = None | ||
| 210 | continue | ||
| 211 | if len(r[d]) > 1: | ||
| 212 | bb.warn("explode_dep_versions(): Item %s appeared in dependency string '%s' multiple times with different values. explode_dep_versions cannot cope with this." % (d, s)) | ||
| 213 | r[d] = r[d][0] | ||
| 203 | return r | 214 | return r | 
| 204 | 215 | ||
| 205 | def join_deps(deps, commasep=True): | 216 | def join_deps(deps, commasep=True): | 
| @@ -209,7 +220,11 @@ def join_deps(deps, commasep=True): | |||
| 209 | result = [] | 220 | result = [] | 
| 210 | for dep in deps: | 221 | for dep in deps: | 
| 211 | if deps[dep]: | 222 | if deps[dep]: | 
| 212 | result.append(dep + " (" + deps[dep] + ")") | 223 | if isinstance(deps[dep], list): | 
| 224 | for v in deps[dep]: | ||
| 225 | result.append(dep + " (" + v + ")") | ||
| 226 | else: | ||
| 227 | result.append(dep + " (" + deps[dep] + ")") | ||
| 213 | else: | 228 | else: | 
| 214 | result.append(dep) | 229 | result.append(dep) | 
| 215 | if commasep: | 230 | if commasep: | 
