From 8bb63e377bf10f5769e1502f8d22579fdd40c701 Mon Sep 17 00:00:00 2001 From: "Carsey, Jaben" Date: Fri, 27 Apr 2018 00:57:53 +0800 Subject: BaseTools: replace string constants used for module types replace raw strings in the code (note: except UPT) with constants. SUP_MODULE_BASE was 'BASE' SUP_MODULE_SEC was 'SEC' SUP_MODULE_PEI_CORE was 'PEI_CORE' SUP_MODULE_PEIM was 'PEIM' SUP_MODULE_DXE_CORE was 'DXE_CORE' SUP_MODULE_DXE_DRIVER was 'DXE_DRIVER' SUP_MODULE_DXE_RUNTIME_DRIVER was 'DXE_RUNTIME_DRIVER' SUP_MODULE_DXE_SAL_DRIVER was 'DXE_SAL_DRIVER' SUP_MODULE_DXE_SMM_DRIVER was 'DXE_SMM_DRIVER' SUP_MODULE_UEFI_DRIVER was 'UEFI_DRIVER' SUP_MODULE_UEFI_APPLICATION was 'UEFI_APPLICATION' SUP_MODULE_USER_DEFINED was 'USER_DEFINED' SUP_MODULE_SMM_CORE was 'SMM_CORE' SUP_MODULE_MM_STANDALONE was 'MM_STANDALONE' SUP_MODULE_MM_CORE_STANDALONE was 'MM_CORE_STANDALONE' Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu --- BaseTools/Source/Python/Ecc/Check.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'BaseTools/Source/Python/Ecc') diff --git a/BaseTools/Source/Python/Ecc/Check.py b/BaseTools/Source/Python/Ecc/Check.py index 27783e617b..089d42a6d1 100644 --- a/BaseTools/Source/Python/Ecc/Check.py +++ b/BaseTools/Source/Python/Ecc/Check.py @@ -1,7 +1,7 @@ ## @file # This file is used to define checkpoints used by ECC tool # -# Copyright (c) 2008 - 2017, Intel Corporation. All rights reserved.
+# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -744,7 +744,7 @@ class Check(object): if Item not in LibraryClasses[List[0]]: LibraryClasses[List[0]].append(Item) - if Record[2] != 'BASE' and Record[2] not in SupModType: + if Record[2] != DT.SUP_MODULE_BASE and Record[2] not in SupModType: EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_2, OtherMsg="The Library Class '%s' does not specify its supported module types" % (List[0]), BelongsToTable='Inf', BelongsToItem=Record[0]) SqlCommand = """select A.ID, A.Value1, B.Value3 from Inf as A left join Inf as B @@ -763,7 +763,7 @@ class Check(object): for Record in RecordSet: if Record[1] in LibraryClasses: - if Record[2] not in LibraryClasses[Record[1]] and 'BASE' not in RecordDict[Record[1]]: + if Record[2] not in LibraryClasses[Record[1]] and DT.SUP_MODULE_BASE not in RecordDict[Record[1]]: if not EccGlobalData.gException.IsException(ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_1, Record[1]): EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_1, OtherMsg="The type of Library Class [%s] defined in Inf file does not match the type of the module" % (Record[1]), BelongsToTable='Inf', BelongsToItem=Record[0]) else: -- cgit v1.2.3