From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web12.10878.1603160459977866613 for ; Mon, 19 Oct 2020 19:21:00 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: fengyunhua@byosoft.com.cn) Received: from localhost.localdomain ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Tue, 20 Oct 2020 10:20:56 +0800 X-WM-Sender: fengyunhua@byosoft.com.cn From: "fengyunhua" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao , Yuwei Chen Subject: [PATCH] BaseTools/Ecc: Fix ECC check MetaFile Copyright information issue Date: Tue, 20 Oct 2020 10:20:02 +0800 Message-Id: <20201020022002.2856-1-fengyunhua@byosoft.com.cn> X-Mailer: git-send-email 2.27.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3011 MetaFile Copyright support below format: # Copyright (C) 2020 Hewlett Packard Enterprise Development LP
# (C) Copyright 2020 Hewlett Packard Enterprise Development LP
Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Signed-off-by: Yunhua Feng --- BaseTools/Source/Python/Ecc/MetaDataParser.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/Ecc/MetaDataParser.py b/BaseTools/Source/Python/Ecc/MetaDataParser.py index 0fd9b6c4e3..d9f0da1ee0 100644 --- a/BaseTools/Source/Python/Ecc/MetaDataParser.py +++ b/BaseTools/Source/Python/Ecc/MetaDataParser.py @@ -214,8 +214,12 @@ def _IsCopyrightLine (LineContent): LineContent = LineContent.upper() Result = False + #Support below Copyright format + # Copyright (C) 2020 Hewlett Packard Enterprise Development LP
+ # (C) Copyright 2020 Hewlett Packard Enterprise Development LP
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 -- 2.27.0.windows.1