buildman: Squash useless output from -K
When using #define CONFIG_SOME_OPTION, the value it set to '1'. When using
defconfig (i.e. CONFIG_SOME_OPTION=y) the value is set to 'y'. This results
in differences showing up with -K. These differences are seldom useful.
Adjust buildman to suppress these differences by default.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index d834d31..6905ed9 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -98,19 +98,22 @@
# Translate a commit subject into a valid filename
trans_valid_chars = string.maketrans("/: ", "---")
-CONFIG_FILENAMES = [
+BASE_CONFIG_FILENAMES = [
+ 'u-boot.cfg', 'u-boot-spl.cfg', 'u-boot-tpl.cfg'
+]
+
+EXTRA_CONFIG_FILENAMES = [
'.config', '.config-spl', '.config-tpl',
'autoconf.mk', 'autoconf-spl.mk', 'autoconf-tpl.mk',
'autoconf.h', 'autoconf-spl.h','autoconf-tpl.h',
- 'u-boot.cfg', 'u-boot-spl.cfg', 'u-boot-tpl.cfg'
]
class Config:
"""Holds information about configuration settings for a board."""
- def __init__(self, target):
+ def __init__(self, config_filename, target):
self.target = target
self.config = {}
- for fname in CONFIG_FILENAMES:
+ for fname in config_filename:
self.config[fname] = {}
def Add(self, fname, key, value):
@@ -208,7 +211,7 @@
gnu_make='make', checkout=True, show_unknown=True, step=1,
no_subdirs=False, full_path=False, verbose_build=False,
incremental=False, per_board_out_dir=False,
- config_only=False):
+ config_only=False, squash_config_y=False):
"""Create a new Builder object
Args:
@@ -232,6 +235,7 @@
per_board_out_dir: Build in a separate persistent directory per
board rather than a thread-specific directory
config_only: Only configure each build, don't build it
+ squash_config_y: Convert CONFIG options with the value 'y' to '1'
"""
self.toolchains = toolchains
self.base_dir = base_dir
@@ -260,6 +264,10 @@
self.full_path = full_path
self.verbose_build = verbose_build
self.config_only = config_only
+ self.squash_config_y = squash_config_y
+ self.config_filenames = BASE_CONFIG_FILENAMES
+ if not self.squash_config_y:
+ self.config_filenames += EXTRA_CONFIG_FILENAMES
self.col = terminal.Color()
@@ -586,13 +594,15 @@
key, value = values
else:
key = values[0]
- value = ''
+ value = '1' if self.squash_config_y else ''
if not key.startswith('CONFIG_'):
continue
elif not line or line[0] in ['#', '*', '/']:
continue
else:
key, value = line.split('=', 1)
+ if self.squash_config_y and value == 'y':
+ value = '1'
config[key] = value
return config
@@ -659,7 +669,7 @@
if read_config:
output_dir = self.GetBuildDir(commit_upto, target)
- for name in CONFIG_FILENAMES:
+ for name in self.config_filenames:
fname = os.path.join(output_dir, name)
config[name] = self._ProcessConfig(fname)
@@ -736,8 +746,8 @@
line, board)
last_was_warning = is_warning
last_func = None
- tconfig = Config(board.target)
- for fname in CONFIG_FILENAMES:
+ tconfig = Config(self.config_filenames, board.target)
+ for fname in self.config_filenames:
if outcome.config:
for key, value in outcome.config[fname].iteritems():
tconfig.Add(fname, key, value)
@@ -1193,7 +1203,7 @@
arch_config_plus[arch] = {}
arch_config_minus[arch] = {}
arch_config_change[arch] = {}
- for name in CONFIG_FILENAMES:
+ for name in self.config_filenames:
arch_config_plus[arch][name] = {}
arch_config_minus[arch][name] = {}
arch_config_change[arch][name] = {}
@@ -1210,7 +1220,7 @@
tbase = self._base_config[target]
tconfig = config[target]
lines = []
- for name in CONFIG_FILENAMES:
+ for name in self.config_filenames:
if not tconfig.config[name]:
continue
config_plus = {}
@@ -1254,7 +1264,7 @@
all_plus = {}
all_minus = {}
all_change = {}
- for name in CONFIG_FILENAMES:
+ for name in self.config_filenames:
all_plus.update(arch_config_plus[arch][name])
all_minus.update(arch_config_minus[arch][name])
all_change.update(arch_config_change[arch][name])