]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/UPT/MkPkg.py
BaseTools: Clean up source files
[mirror_edk2.git] / BaseTools / Source / Python / UPT / MkPkg.py
index e7ec328a78d9be0830c51fcd4bebd087c2dd7bfb..37942b8ed9b3ff671a5b9898de3b794a1647048b 100644 (file)
@@ -1,11 +1,11 @@
 ## @file\r
 # Install distribution package.\r
 #\r
-# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>\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
+# 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
@@ -55,7 +55,7 @@ from Common.MultipleWorkspace import MultipleWorkspace as mws
 ## CheckForExistingDp\r
 #\r
 # Check if there is a same name DP file existing\r
-# @param Path: The path to be checked \r
+# @param Path: The path to be checked\r
 #\r
 def CheckForExistingDp(Path):\r
     if os.path.exists(Path):\r
@@ -76,7 +76,7 @@ def Main(Options = None):
     if Options is None:\r
         Logger.Error("\nMkPkg", OPTION_UNKNOWN_ERROR, ST.ERR_OPTION_NOT_FOUND)\r
     try:\r
-        DataBase = GlobalData.gDB        \r
+        DataBase = GlobalData.gDB\r
         ContentFileClosed = True\r
         WorkspaceDir = GlobalData.gWORKSPACE\r
 \r
@@ -85,7 +85,7 @@ def Main(Options = None):
         #\r
         if not Options.PackFileToCreate:\r
             Logger.Error("\nMkPkg", OPTION_UNKNOWN_ERROR, ST.ERR_OPTION_NOT_FOUND)\r
-        \r
+\r
         #\r
         # Handle if the distribution package file already exists\r
         #\r
@@ -95,7 +95,7 @@ def Main(Options = None):
         # Check package file existing and valid\r
         #\r
         CheckFileList('.DEC', Options.PackageFileList, ST.ERR_INVALID_PACKAGE_NAME, ST.ERR_INVALID_PACKAGE_PATH)\r
-        #            \r
+        #\r
         # Check module file existing and valid\r
         #\r
         CheckFileList('.INF', Options.ModuleFileList, ST.ERR_INVALID_MODULE_NAME, ST.ERR_INVALID_MODULE_PATH)\r
@@ -104,10 +104,10 @@ def Main(Options = None):
         # Get list of files that installed with RePackage attribute available\r
         #\r
         RePkgDict = DataBase.GetRePkgDict()\r
-              \r
-        ContentFile = PackageFile(GlobalData.gCONTENT_FILE, "w")       \r
+\r
+        ContentFile = PackageFile(GlobalData.gCONTENT_FILE, "w")\r
         ContentFileClosed = False\r
-        \r
+\r
         #\r
         # Add temp distribution header\r
         #\r
@@ -118,7 +118,7 @@ def Main(Options = None):
 \r
             #\r
             # add distribution level tool/misc files\r
-            # before pack, current dir should be workspace dir, else the full \r
+            # before pack, current dir should be workspace dir, else the full\r
             # path will be in the pack file\r
             #\r
             Cwd = getcwd()\r
@@ -132,8 +132,8 @@ def Main(Options = None):
                 FileList += MiscObject.GetFileList()\r
             for FileObject in FileList:\r
                 #\r
-                # If you have unicode file names, please convert them to byte \r
-                # strings in your desired encoding before passing them to \r
+                # If you have unicode file names, please convert them to byte\r
+                # strings in your desired encoding before passing them to\r
                 # write().\r
                 #\r
                 FromFile = os.path.normpath(FileObject.GetURI()).encode('utf_8')\r
@@ -151,8 +151,8 @@ def Main(Options = None):
                         DistPkg.Header.RePackage = True\r
                 ContentFile.PackFile(FromFile)\r
             chdir(Cwd)\r
-        \r
-        #    \r
+\r
+        #\r
         # Add init dp information\r
         #\r
         else:\r
@@ -160,14 +160,14 @@ def Main(Options = None):
             DistPkg.Header.Name = 'Distribution Package'\r
             DistPkg.Header.Guid = str(uuid4())\r
             DistPkg.Header.Version = '1.0'\r
-            \r
+\r
         DistPkg.GetDistributionPackage(WorkspaceDir, Options.PackageFileList, \\r
                                        Options.ModuleFileList)\r
         FileList, MetaDataFileList = DistPkg.GetDistributionFileList()\r
         for File in FileList + MetaDataFileList:\r
             FileFullPath = os.path.normpath(os.path.join(WorkspaceDir, File))\r
             #\r
-            # check whether file was included in a distribution that can not \r
+            # check whether file was included in a distribution that can not\r
             # be repackaged\r
             #\r
             if FileFullPath in RePkgDict:\r
@@ -182,17 +182,17 @@ def Main(Options = None):
                                  )\r
                 else:\r
                     DistPkg.Header.RePackage = True\r
-          \r
+\r
         Cwd = getcwd()\r
         chdir(WorkspaceDir)\r
         ContentFile.PackFiles(FileList)\r
         chdir(Cwd)\r
-        \r
-        Logger.Verbose(ST.MSG_COMPRESS_DISTRIBUTION_PKG) \r
-        \r
+\r
+        Logger.Verbose(ST.MSG_COMPRESS_DISTRIBUTION_PKG)\r
+\r
         ContentFile.Close()\r
         ContentFileClosed = True\r
-        \r
+\r
         #\r
         # Add Md5Sigature\r
         #\r
@@ -201,7 +201,7 @@ def Main(Options = None):
         # Add current Date\r
         #\r
         DistPkg.Header.Date = str(strftime("%Y-%m-%dT%H:%M:%S", localtime()))\r
-        \r
+\r
         #\r
         # Finish final dp file\r
         #\r
@@ -214,7 +214,7 @@ def Main(Options = None):
         ReturnCode = 0\r
 \r
     except FatalError as XExcept:\r
-        ReturnCode = XExcept.args[0]        \r
+        ReturnCode = XExcept.args[0]\r
         if Logger.GetLevel() <= Logger.DEBUG_9:\r
             Logger.Quiet(ST.MSG_PYTHON_ON % \\r
                          (python_version(), platform) + format_exc())\r
@@ -247,7 +247,7 @@ def Main(Options = None):
 \r
 \r
 ## CheckFileList\r
-# \r
+#\r
 # @param QualifiedExt:             QualifiedExt\r
 # @param FileList:                 FileList\r
 # @param ErrorStringExt:           ErrorStringExt\r
@@ -263,7 +263,7 @@ def CheckFileList(QualifiedExt, FileList, ErrorStringExt, ErrorStringFullPath):
         if Ext.upper() != QualifiedExt.upper():\r
             Logger.Error("\nMkPkg", OPTION_VALUE_INVALID, \\r
                          ErrorStringExt % Item)\r
-        \r
+\r
         Item = os.path.normpath(Item)\r
         Path = mws.join(WorkspaceDir, Item)\r
         if not os.path.exists(Path):\r
@@ -274,7 +274,7 @@ def CheckFileList(QualifiedExt, FileList, ErrorStringExt, ErrorStringFullPath):
         elif not IsValidPath(Item, WorkspaceDir):\r
             Logger.Error("\nMkPkg", OPTION_VALUE_INVALID, \\r
                          ErrorStringExt % Item)\r
-        \r
+\r
         if not os.path.split(Item)[0]:\r
             Logger.Error("\nMkPkg", OPTION_VALUE_INVALID, \\r
                          ST.ERR_INVALID_METAFILE_PATH % Item)\r