From f828f9c15ef3e5e5a4383ba4449e9e4d158b3114 Mon Sep 17 00:00:00 2001 From: Harry Ramsey Date: Fri, 27 Dec 2024 10:28:16 +0000 Subject: [PATCH 1/2] Enable check_files.py for TF-PSA-Crypto This commit enables check_files.py to run for Mbed TLS and TF-PSA-Crypto. Signed-off-by: Harry Ramsey --- scripts/check_files.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/check_files.py b/scripts/check_files.py index 399d371ed..493d1b5cd 100755 --- a/scripts/check_files.py +++ b/scripts/check_files.py @@ -374,7 +374,7 @@ class LicenseIssueTracker(LineIssueTracker): if build_tree.is_mbedtls_3_6(): LICENSE_EXEMPTION_RE_LIST.append(r'3rdparty/(?!(p256-m)/.*)') else: - LICENSE_EXEMPTION_RE_LIST.append(r'tf-psa-crypto/drivers/(?=(everest)/.*)') + LICENSE_EXEMPTION_RE_LIST.append(r'(tf-psa-crypto/)?drivers/(?=(everest)/.*)') LICENSE_EXEMPTION_RE_LIST += [ # Documentation explaining the license may have accidental @@ -479,7 +479,8 @@ class IntegrityChecker: """Instantiate the sanity checker. Check files under the current directory. Write a report of issues to log_file.""" - build_tree.check_repo_path() + if not build_tree.looks_like_root(os.getcwd()): + raise Exception("This script must be run from Mbed TLS or TF-PSA-Crypto root") self.logger = None self.setup_logger(log_file) self.issues_to_check = [ From 024ec9ee85335b99098d21d3bc3d22dff4e0be11 Mon Sep 17 00:00:00 2001 From: Harry Ramsey Date: Fri, 10 Jan 2025 12:40:15 +0000 Subject: [PATCH 2/2] Update license exemption list As TF-PSA-Crypto is now a seperate repository, the license does not need to be checked alongside Mbed TLS and instead has a seperate check. Signed-off-by: Harry Ramsey --- scripts/check_files.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/check_files.py b/scripts/check_files.py index 493d1b5cd..d3a61c1d6 100755 --- a/scripts/check_files.py +++ b/scripts/check_files.py @@ -371,10 +371,10 @@ class LicenseIssueTracker(LineIssueTracker): LICENSE_EXEMPTION_RE_LIST = [] # Exempt third-party drivers which may be under a different license - if build_tree.is_mbedtls_3_6(): + if build_tree.looks_like_tf_psa_crypto_root(os.getcwd()): + LICENSE_EXEMPTION_RE_LIST.append(r'drivers/(?=(everest)/.*)') + elif build_tree.is_mbedtls_3_6(): LICENSE_EXEMPTION_RE_LIST.append(r'3rdparty/(?!(p256-m)/.*)') - else: - LICENSE_EXEMPTION_RE_LIST.append(r'(tf-psa-crypto/)?drivers/(?=(everest)/.*)') LICENSE_EXEMPTION_RE_LIST += [ # Documentation explaining the license may have accidental