Switch from config_history to config_macros

Switch from the `config_history` module to the new module `config_macros`.
No behavior change.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine
2025-12-23 12:44:59 +01:00
parent 262d9cab42
commit 35821e7c77

View File

@@ -8,7 +8,7 @@ from typing import Iterator
import framework_scripts_path # pylint: disable=unused-import
from mbedtls_framework.config_checks_generator import * \
#pylint: disable=wildcard-import,unused-wildcard-import
from mbedtls_framework import config_history
from mbedtls_framework import config_macros
class CryptoInternal(SubprojectInternal):
SUBPROJECT = 'TF-PSA-Crypto'
@@ -23,17 +23,17 @@ ALWAYS_ENABLED_SINCE_4_0 = frozenset([
def checkers_for_removed_options() -> Iterator[Checker]:
"""Discover removed options. Yield corresponding checkers."""
history = config_history.ConfigHistory()
old_public = history.options('mbedtls', '3.6')
new_public = history.options('mbedtls', '4.0')
crypto_public = history.options('tfpsacrypto', '1.0')
crypto_internal = history.internal('tfpsacrypto', '1.0')
previous_major = config_macros.History('mbedtls', '3.6')
this_major = config_macros.History('mbedtls', '4.0')
old_public = previous_major.options()
new_public = this_major.options()
crypto = config_macros.History('tfpsacrypto', '1.0')
for option in sorted(old_public - new_public):
if option in ALWAYS_ENABLED_SINCE_4_0:
continue
if option in crypto_public:
if option in crypto.options():
yield CryptoOption(option)
elif option in crypto_internal:
elif option in crypto.internal():
yield CryptoInternal(option)
else:
yield Removed(option, 'Mbed TLS 4.0')