summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2022-06-21 15:34:33 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2022-06-21 15:34:33 +0200
commitf66449ac4f9c88ad3da834d041a25e1da6eb8d8c (patch)
treeb7cc7fb1be9e7c200ca6f0a60c98c12b27044252 /bin
parentc9097d5f6346271e3f3c5198cda0901d5a979776 (diff)
analyze-kconfig: add ubjson support
Diffstat (limited to 'bin')
-rwxr-xr-xbin/analyze-kconfig.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/bin/analyze-kconfig.py b/bin/analyze-kconfig.py
index 2223a4d..4b84921 100755
--- a/bin/analyze-kconfig.py
+++ b/bin/analyze-kconfig.py
@@ -169,10 +169,20 @@ def main():
else:
# show-failing-symbols, show-nop-symbols, DFATOOL_KCONF_WITH_CHOICE_NODES, DFATOOL_KCONF_IGNORE_NUMERIC, and DFATOOL_KCONF_IGNORE_STRING have no effect
# in this branch.
- import lzma
- with lzma.open(args.model, "rt") as f:
- observations = json.load(f)
+ if args.model.endswith("xz"):
+ import lzma
+
+ with lzma.open(args.model, "rt") as f:
+ observations = json.load(f)
+ elif args.model.endswith("ubjson"):
+ import ubjson
+
+ with open(args.model, "rb") as f:
+ observations = ubjson.load(f)
+ else:
+ with open(args.model, "r") as f:
+ observations = json.load(f)
if bool(int(os.getenv("DFATOOL_KCONF_IGNORE_STRING", 0))):
attributes = KConfigAttributes(args.kconfig_path, None)