]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py
BaseTools: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / BaseTools / Source / Python / UPT / GenMetaFile / GenDecFile.py
index 0ba07ccebc73398e9eb62681be030f48262f16ed..91952a5feec79f52ce8c4143e2c2c95110baa3e6 100644 (file)
@@ -4,13 +4,7 @@
 #\r
 # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>\r
 #\r
-# This program and the accompanying materials are licensed and made available\r
-# under the terms and conditions of the BSD License which accompanies this\r
-# distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+# SPDX-License-Identifier: BSD-2-Clause-Patent\r
 #\r
 \r
 '''\r
@@ -19,7 +13,7 @@ GenDEC
 import os\r
 import stat\r
 import codecs\r
-import md5\r
+from hashlib import md5\r
 from Core.FileHook import __FileHookOpen__\r
 from Library.Parsing import GenSection\r
 from Library.CommentGenerating import GenHeaderCommentSection\r
@@ -646,8 +640,8 @@ def GenPackageUNIEncodeFile(PackageObject, UniFileHeader = '', Encoding=TAB_ENCO
     File = codecs.open(ContainerFile, 'w', Encoding)\r
     File.write(u'\uFEFF' + Content)\r
     File.stream.close()\r
-    Md5Sigature = md5.new(__FileHookOpen__(str(ContainerFile), 'rb').read())\r
-    Md5Sum = Md5Sigature.hexdigest()\r
+    Md5Signature = md5(__FileHookOpen__(str(ContainerFile), 'rb').read())\r
+    Md5Sum = Md5Signature.hexdigest()\r
     if (ContainerFile, Md5Sum) not in PackageObject.FileList:\r
         PackageObject.FileList.append((ContainerFile, Md5Sum))\r
 \r