]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/PatchCheck: Generate error if Contributed-under found
authorMichael D Kinney <michael.d.kinney@intel.com>
Thu, 4 Apr 2019 22:35:07 +0000 (15:35 -0700)
committerMichael D Kinney <michael.d.kinney@intel.com>
Tue, 9 Apr 2019 18:26:28 +0000 (11:26 -0700)
https://bugzilla.tianocore.org/show_bug.cgi?id=1655

With the change to BSD+Patent License, the TianoCore Contributor's
Agreement has been removed and as a result, a Contributed-under
tag is no longer appropriate in patches.  Remove the check for
the TianoCore Contributor's Agreement and instead, generate an
error if a patch contains a Contributed-under tag in the commit
message.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
BaseTools/Scripts/PatchCheck.py

index dfc43b42746354e0b9f28f92f4306f5f91ecdf48..6aec15d0f0b23bd58c13efac5b0ecf3c5457f36e 100755 (executable)
@@ -1,7 +1,7 @@
 ## @file\r
 #  Check a patch for various format issues\r
 #\r
-#  Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 #\r
@@ -67,14 +67,17 @@ class CommitMessageCheck:
             print(prefix, line)\r
             count += 1\r
 \r
+    # Find 'contributed-under:' at the start of a line ignoring case and\r
+    # requires ':' to be present.  Matches if there is white space before\r
+    # the tag or between the tag and the ':'.\r
+    contributed_under_re = \\r
+        re.compile(r'^\s*contributed-under\s*:', re.MULTILINE|re.IGNORECASE)\r
+\r
     def check_contributed_under(self):\r
-        cu_msg='Contributed-under: TianoCore Contribution Agreement 1.1'\r
-        if self.msg.find(cu_msg) < 0:\r
-            # Allow 1.0 for now while EDK II community transitions to 1.1\r
-            cu_msg='Contributed-under: TianoCore Contribution Agreement 1.0'\r
-            if self.msg.find(cu_msg) < 0:\r
-                self.error('Missing Contributed-under! (Note: this must be ' +\r
-                           'added by the code contributor!)')\r
+        match = self.contributed_under_re.search(self.msg)\r
+        if match is not None:\r
+            self.error('Contributed-under! (Note: this must be ' +\r
+                       'removed by the code contributor!)')\r
 \r
     @staticmethod\r
     def make_signature_re(sig, re_input=False):\r