From 2f639b6bf4bcf57c4b1b0afb23ccb657607428bc Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 23 Sep 2024 15:46:37 +0200 Subject: [PATCH] Don't pass the section name to adapters Signed-off-by: Gilles Peskine --- scripts/mbedtls_framework/config_common.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/mbedtls_framework/config_common.py b/scripts/mbedtls_framework/config_common.py index 5e106cbd7..6f7c58b20 100644 --- a/scripts/mbedtls_framework/config_common.py +++ b/scripts/mbedtls_framework/config_common.py @@ -143,17 +143,16 @@ class Config: """Run adapter on each known symbol and (de)activate it accordingly. `adapter` must be a function that returns a boolean. It is called as - `adapter(name, value, active, section)` for each setting, where - `value` is the macro's expansion (possibly empty), `active` is - `True` if `name` is set and `False` if `name` is known but unset, - and `section` is the name of the section containing `name`. If - `adapter` returns `True`, then set `name` (i.e. make it active), + `adapter(name, value, active)` for each setting, where + `value` is the macro's expansion (possibly empty), and `active` is + `True` if `name` is set and `False` if `name` is known but unset. + If `adapter` returns `True`, then set `name` (i.e. make it active), otherwise unset `name` (i.e. make it known but inactive). """ for setting in self.settings.values(): is_active = setting.active setting.active = adapter(setting.name, setting.value, - setting.active, setting.section) + setting.active) # Check if modifying the config file if setting.active != is_active: setting.configfile.modified = True