]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/UPT/RmPkg.py
BaseTools: Clean up source files
[mirror_edk2.git] / BaseTools / Source / Python / UPT / RmPkg.py
index 6427a8f16c887cac3ec61ac3cd2ee0cc01f39d4c..78469dc758d845da148d949dced4af28913e8f01 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
@@ -58,7 +58,7 @@ def CheckDpDepex(Dep, Guid, Version, WorkspaceDir):
             return 1\r
         else:\r
             #\r
-            # report list of modules that are not valid due to force \r
+            # report list of modules that are not valid due to force\r
             # remove,\r
             # also generate a log file for reference\r
             #\r
@@ -72,12 +72,12 @@ def CheckDpDepex(Dep, Guid, Version, WorkspaceDir):
                         LogFile.write("%s\n"%ModulePath)\r
                         Logger.Info(ModulePath)\r
                 except IOError:\r
-                    Logger.Warn("\nRmPkg", ST.ERR_FILE_WRITE_FAILURE, \r
+                    Logger.Warn("\nRmPkg", ST.ERR_FILE_WRITE_FAILURE,\r
                                 File=LogFilePath)\r
             except IOError:\r
-                Logger.Warn("\nRmPkg", ST.ERR_FILE_OPEN_FAILURE, \r
+                Logger.Warn("\nRmPkg", ST.ERR_FILE_OPEN_FAILURE,\r
                             File=LogFilePath)\r
-            finally:                    \r
+            finally:\r
                 LogFile.close()\r
 \r
 ## Remove Path\r
@@ -85,7 +85,7 @@ def CheckDpDepex(Dep, Guid, Version, WorkspaceDir):
 # removing readonly file on windows will get "Access is denied"\r
 # error, so before removing, change the mode to be writeable\r
 #\r
-# @param Path: The Path to be removed \r
+# @param Path: The Path to be removed\r
 #\r
 def RemovePath(Path):\r
     Logger.Info(ST.MSG_REMOVE_FILE % Path)\r
@@ -122,43 +122,43 @@ def GetCurrentFileList(DataBase, Guid, Version, WorkspaceDir):
 # If no error found, return zero value so the caller of this tool can know\r
 # if it's executed successfully or not.\r
 #\r
-# @param  Options: command option \r
+# @param  Options: command option\r
 #\r
 def Main(Options = None):\r
 \r
     try:\r
-        DataBase = GlobalData.gDB        \r
+        DataBase = GlobalData.gDB\r
         if not Options.DistributionFile:\r
-            Logger.Error("RmPkg", \r
-                         OPTION_MISSING, \r
+            Logger.Error("RmPkg",\r
+                         OPTION_MISSING,\r
                          ExtraData=ST.ERR_SPECIFY_PACKAGE)\r
         WorkspaceDir = GlobalData.gWORKSPACE\r
         #\r
         # Prepare check dependency\r
         #\r
         Dep = DependencyRules(DataBase)\r
-        \r
+\r
         #\r
         # Get the Dp information\r
         #\r
         StoredDistFile, Guid, Version = GetInstalledDpInfo(Options.DistributionFile, Dep, DataBase, WorkspaceDir)\r
 \r
-        # \r
+        #\r
         # Check Dp depex\r
         #\r
         CheckDpDepex(Dep, Guid, Version, WorkspaceDir)\r
 \r
-        # \r
+        #\r
         # remove distribution\r
         #\r
         RemoveDist(Guid, Version, StoredDistFile, DataBase, WorkspaceDir, Options.Yes)\r
 \r
         Logger.Quiet(ST.MSG_FINISH)\r
-        \r
+\r
         ReturnCode = 0\r
-        \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 % (python_version(), platform) + \\r
                          format_exc())\r
@@ -203,7 +203,7 @@ def GetInstalledDpInfo(DistributionFile, Dep, DataBase, WorkspaceDir):
     if not Dep.CheckDpExists(Guid, Version):\r
         Logger.Error("RmPkg", UNKNOWN_ERROR, ST.ERR_DISTRIBUTION_NOT_INSTALLED)\r
     #\r
-    # Check for Distribution files existence in /conf/upt, if not exist, \r
+    # Check for Distribution files existence in /conf/upt, if not exist,\r
     # Warn user and go on.\r
     #\r
     StoredDistFile = os.path.normpath(os.path.join(WorkspaceDir, GlobalData.gUPT_DIR, NewDpFileName))\r
@@ -252,7 +252,7 @@ def RemoveDist(Guid, Version, StoredDistFile, DataBase, WorkspaceDir, ForceRemov
             RemovePath(Path)\r
         else:\r
             MissingFileList.append(Path)\r
-    \r
+\r
     for Path in NewFileList:\r
         if os.path.isfile(Path):\r
             if (not ForceRemove) and (not os.path.split(Path)[1].startswith('.')):\r