summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/utils.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index ec46021b55..211ac8129f 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -96,7 +96,34 @@ def explode_deps(s):
96 #r[-1] += ' ' + ' '.join(j) 96 #r[-1] += ' ' + ' '.join(j)
97 return r 97 return r
98 98
99def explode_dep_versions(s):
100 """
101 Take an RDEPENDS style string of format:
102 "DEPEND1 (optional version) DEPEND2 (optional version) ..."
103 and return a dictonary of dependencies and versions.
104 """
105 r = {}
106 l = s.split()
107 lastdep = None
108 lastver = ""
109 inversion = False
110 for i in l:
111 if i[0] == '(':
112 inversion = True
113 lastver = i[1:] or ""
114 #j = []
115 elif inversion and i.endswith(')'):
116 inversion = False
117 lastver = lastver + " " + (i[:-1] or "")
118 r[lastdep] = lastver
119 elif not inversion:
120 r[i] = None
121 lastdep = i
122 lastver = ""
123 elif inversion:
124 lastver = lastver + " " + i
99 125
126 return r
100 127
101def _print_trace(body, line): 128def _print_trace(body, line):
102 """ 129 """