mirror of
https://github.com/Mbed-TLS/mbedtls-framework.git
synced 2026-08-28 22:09:54 +00:00
Merge pull request #49 from gilles-peskine-arm/config-full-booleans-only-framework
config.py: don't rely on section names
This commit is contained in:
@@ -143,16 +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, active, section)` for each setting, where `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.active,
|
||||
setting.section)
|
||||
setting.active = adapter(setting.name, setting.value,
|
||||
setting.active)
|
||||
# Check if modifying the config file
|
||||
if setting.active != is_active:
|
||||
setting.configfile.modified = True
|
||||
|
||||
Reference in New Issue
Block a user