]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Scripts/PatchCheck.py
Maintainers.txt: Remove Network maintainers for MdeModulePkg/Universal/Network
[mirror_edk2.git] / BaseTools / Scripts / PatchCheck.py
index 0b580f3b3165d5fbaa300e9ea7fde0dfae0db910..6aec15d0f0b23bd58c13efac5b0ecf3c5457f36e 100755 (executable)
@@ -1,16 +1,9 @@
 ## @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
-#  This program and the accompanying materials are licensed and made\r
-#  available under the terms and conditions of the BSD License which\r
-#  accompanies this distribution. The full text of the license may be\r
-#  found at http://opensource.org/licenses/bsd-license.php\r
-#\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"\r
-#  BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER\r
-#  EXPRESS OR IMPLIED.\r
+#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 #\r
 \r
 from __future__ import print_function\r
@@ -74,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