]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Revert "BaseTools/PatchCheck.py: Add LicenseCheck"
authorLeif Lindholm <leif@nuviainc.com>
Thu, 2 Jul 2020 11:24:19 +0000 (19:24 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 31 Jul 2020 03:37:17 +0000 (03:37 +0000)
This reverts commit a4cfb842fca9693a330cb5435284c1ee8bfbbace.
This commit suggests inclusion of non-edk2+license content without
a contribution agreement is something the community has made a
decision on, which is incorrect.

Cc: Shenglei Zhang <shenglei.zhang@intel.com>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Leif Lindholm <leif@nuviainc.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Scripts/PatchCheck.py

index ca0849b77bbee5ecca9409fd81f9e18a6bbbf881..68c984ed0e4d4a95f811048e0e8ba260233a6a77 100755 (executable)
@@ -314,49 +314,12 @@ class GitDiffCheck:
         self.line_num = 0\r
         self.state = START\r
         self.new_bin = []\r
         self.line_num = 0\r
         self.state = START\r
         self.new_bin = []\r
-        self.LicenseCheck(self.lines, self.count)\r
         while self.line_num < self.count and self.format_ok:\r
             line_num = self.line_num\r
             self.run()\r
             assert(self.line_num > line_num)\r
         self.report_message_result()\r
 \r
         while self.line_num < self.count and self.format_ok:\r
             line_num = self.line_num\r
             self.run()\r
             assert(self.line_num > line_num)\r
         self.report_message_result()\r
 \r
-    def LicenseCheck(self, lines, count):\r
-        self.ok = True\r
-        self.startcheck = False\r
-        self.license = True\r
-        line_index = 0\r
-        for line in lines:\r
-            if line.startswith('--- /dev/null'):\r
-                nextline = lines[line_index + 1]\r
-                added_file = self.Readdedfileformat.search(nextline).group(1)\r
-                added_file_extension = os.path.splitext(added_file)[1]\r
-                if added_file_extension in self.file_extension_list:\r
-                    self.startcheck = True\r
-                    self.license = False\r
-            if self.startcheck and self.license_format_preflix in line:\r
-                if self.bsd2_patent in line or self.bsd3_patent in line:\r
-                    self.license = True\r
-                else:\r
-                    for optional_license in self.license_optional_list:\r
-                        if optional_license in line:\r
-                            self.license = True\r
-                            self.warning(added_file)\r
-            if line_index + 1 == count or lines[line_index + 1].startswith('diff --') and self.startcheck:\r
-                if not self.license:\r
-                    error_message = "Invalid License in: " + added_file\r
-                    self.error(error_message)\r
-                self.startcheck = False\r
-                self.license = True\r
-            line_index = line_index + 1\r
-\r
-    def warning(self, *err):\r
-        count = 0\r
-        for line in err:\r
-            warning_format = 'Warning: License accepted but not BSD plus patent license in'\r
-            print(warning_format, line)\r
-            count += 1\r
-\r
     def report_message_result(self):\r
         if Verbose.level < Verbose.NORMAL:\r
             return\r
     def report_message_result(self):\r
         if Verbose.level < Verbose.NORMAL:\r
             return\r
@@ -544,19 +507,6 @@ class GitDiffCheck:
             print(prefix, line)\r
             count += 1\r
 \r
             print(prefix, line)\r
             count += 1\r
 \r
-    license_format_preflix = 'SPDX-License-Identifier'\r
-\r
-    bsd2_patent = 'BSD-2-Clause-Patent'\r
-\r
-    bsd3_patent = 'BSD-3-Clause-Patent'\r
-\r
-    license_optional_list = ['BSD-2-Clause', 'BSD-3-Clause', 'MIT', 'Python-2.0', 'Zlib']\r
-\r
-    Readdedfileformat = re.compile(r'\+\+\+ b\/(.*)\n')\r
-\r
-    file_extension_list = [".c", ".h", ".inf", ".dsc", ".dec", ".py", ".bat", ".sh", ".uni", ".yaml", ".fdf", ".inc", "yml", ".asm", \\r
-                          ".asm16", ".asl", ".vfr", ".s", ".S", ".aslc", ".nasm", ".nasmb", ".idf", ".Vfr", ".H"]\r
-\r
 class CheckOnePatch:\r
     """Checks the contents of a git email formatted patch.\r
 \r
 class CheckOnePatch:\r
     """Checks the contents of a git email formatted patch.\r
 \r