summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/utils/oe/misc.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/wic/utils/oe/misc.py')
-rw-r--r--scripts/lib/wic/utils/oe/misc.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/lib/wic/utils/oe/misc.py b/scripts/lib/wic/utils/oe/misc.py
index 87e30411b0..aa9b23582b 100644
--- a/scripts/lib/wic/utils/oe/misc.py
+++ b/scripts/lib/wic/utils/oe/misc.py
@@ -179,3 +179,26 @@ def get_bitbake_var(key):
179 val = get_line_val(line, key) 179 val = get_line_val(line, key)
180 return val 180 return val
181 return None 181 return None
182
183def parse_sourceparams(sourceparams):
184 """
185 Split sourceparams string of the form key1=val1[,key2=val2,...]
186 into a dict. Also accepts valueless keys i.e. without =.
187
188 Returns dict of param key/val pairs (note that val may be None).
189 """
190 params_dict = {}
191
192 params = sourceparams.split(',')
193 if params:
194 for p in params:
195 if not p:
196 continue
197 if not '=' in p:
198 key = p
199 val = None
200 else:
201 key, val = p.split('=')
202 params_dict[key] = val
203
204 return params_dict