diff options
-rw-r--r-- | meta/lib/oe/data.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/meta/lib/oe/data.py b/meta/lib/oe/data.py index 80bba2b9d2..b8901e63f5 100644 --- a/meta/lib/oe/data.py +++ b/meta/lib/oe/data.py | |||
@@ -17,7 +17,7 @@ def typed_value(key, d): | |||
17 | except (TypeError, ValueError) as exc: | 17 | except (TypeError, ValueError) as exc: |
18 | bb.msg.fatal("Data", "%s: %s" % (key, str(exc))) | 18 | bb.msg.fatal("Data", "%s: %s" % (key, str(exc))) |
19 | 19 | ||
20 | def export2json(d, json_file, expand=True): | 20 | def export2json(d, json_file, expand=True, searchString="",replaceString=""): |
21 | data2export = {} | 21 | data2export = {} |
22 | keys2export = [] | 22 | keys2export = [] |
23 | 23 | ||
@@ -37,9 +37,11 @@ def export2json(d, json_file, expand=True): | |||
37 | 37 | ||
38 | for key in keys2export: | 38 | for key in keys2export: |
39 | try: | 39 | try: |
40 | data2export[key] = d.getVar(key, expand) | 40 | data2export[key] = d.getVar(key, expand).replace(searchString,replaceString) |
41 | except bb.data_smart.ExpansionError: | 41 | except bb.data_smart.ExpansionError: |
42 | data2export[key] = '' | 42 | data2export[key] = '' |
43 | except AttributeError: | ||
44 | pass | ||
43 | 45 | ||
44 | with open(json_file, "w") as f: | 46 | with open(json_file, "w") as f: |
45 | json.dump(data2export, f, skipkeys=True, indent=4, sort_keys=True) | 47 | json.dump(data2export, f, skipkeys=True, indent=4, sort_keys=True) |