BaseTools/Ecc: Fix ECC check MetaFile Copyright information issue

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3011

MetaFile Copyright support below format:

#  Copyright (C) 2020 Hewlett Packard Enterprise Development LP<BR>
#  (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Yunhua Feng <fengyunhua@byosoft.com.cn>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
This commit is contained in:
Yunhua Feng 2020-10-20 10:20:02 +08:00 committed by mergify[bot]
parent 31e97bdae2
commit eb520b93d2
1 changed files with 5 additions and 1 deletions

View File

@ -214,8 +214,12 @@ def _IsCopyrightLine (LineContent):
LineContent = LineContent.upper()
Result = False
#Support below Copyright format
# Copyright (C) 2020 Hewlett Packard Enterprise Development LP<BR>
# (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
ReIsCopyrightRe = re.compile(r"""(^|\s)COPYRIGHT *\(""", re.DOTALL)
if ReIsCopyrightRe.search(LineContent):
ReIsCopyrightTypeB = re.compile(r"""(^|\s)\(C\)\s*COPYRIGHT""", re.DOTALL)
if ReIsCopyrightRe.search(LineContent) or ReIsCopyrightTypeB.search(LineContent):
Result = True
return Result