From 0dfd191e04178afe167dd8087258e4e88137a9d8 Mon Sep 17 00:00:00 2001 From: Dominik Ermel Date: Tue, 19 Jan 2021 18:19:48 +0000 Subject: [PATCH] scripts: west_commands: Remove no longer needed load_dot_config(path) The functionality of the function is now covered by BuildConfiguration class. Signed-off-by: Dominik Ermel --- scripts/west_commands/zephyr_ext_common.py | 63 ---------------------- 1 file changed, 63 deletions(-) diff --git a/scripts/west_commands/zephyr_ext_common.py b/scripts/west_commands/zephyr_ext_common.py index 642e2012cf6..8403bab44a3 100644 --- a/scripts/west_commands/zephyr_ext_common.py +++ b/scripts/west_commands/zephyr_ext_common.py @@ -10,7 +10,6 @@ commands which specifically execute runners.''' import os from pathlib import Path -import re from west import log from west.commands import WestCommand @@ -46,65 +45,3 @@ class Forceable(WestCommand): if not (cond or self.args.force): log.err(msg) log.die('refusing to proceed without --force due to above error') - - -def load_dot_config(path): - '''Load a Kconfig .config output file in 'path' and return a dict - from symbols set in that file to their values. - - This parser: - - - respects the usual "# CONFIG_FOO is not set" --> CONFIG_FOO=n - semantics - - converts decimal or hexadecimal integer literals to ints - - strips quotes around strings - ''' - - # You might think it would be easier to create a new - # kconfiglib.Kconfig object and use its load_config() method to - # parse the file instead. - # - # Beware, traveler: that way lies madness. - # - # Zephyr's Kconfig files rely heavily on environment variables to - # manage user-configurable directory locations, and recreating - # that state turns out to be a surprisingly fragile process. It's - # not just 'srctree'; there are various others and they change - # randomly as features get merged. - # - # Nor will pickling the Kconfig object come to your aid. It's a - # deeply recursive data structure which requires a very high - # system recursion limit (100K frames seems to do it) and contains - # references to un-pickle-able values in its attributes. - # - # It's easier and in fact more robust to rely on the fact that the - # .config file contents are just a strictly formatted Makefile - # fragment with some extra "is not set" semantics. - - opt_value = re.compile('^(?P