summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/UPT/RmPkg.py
diff options
context:
space:
mode:
authorLiming Gao <liming.gao@intel.com>2018-07-05 17:40:04 +0800
committerLiming Gao <liming.gao@intel.com>2018-07-09 10:25:47 +0800
commitf7496d717357b9af78414d19679b073403812340 (patch)
tree67621e65fd181bdf8a12d12e7706579beaaed0fb /BaseTools/Source/Python/UPT/RmPkg.py
parent39456d00f36e04b7e7efb208f350f4e83b6c3531 (diff)
downloadedk2-f7496d717357b9af78414d19679b073403812340.tar.gz
edk2-f7496d717357b9af78414d19679b073403812340.tar.bz2
edk2-f7496d717357b9af78414d19679b073403812340.zip
BaseTools: Clean up source files
1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/UPT/RmPkg.py')
-rw-r--r--BaseTools/Source/Python/UPT/RmPkg.py42
1 files changed, 21 insertions, 21 deletions
diff --git a/BaseTools/Source/Python/UPT/RmPkg.py b/BaseTools/Source/Python/UPT/RmPkg.py
index 6427a8f16c..78469dc758 100644
--- a/BaseTools/Source/Python/UPT/RmPkg.py
+++ b/BaseTools/Source/Python/UPT/RmPkg.py
@@ -1,11 +1,11 @@
## @file
# Install distribution package.
#
-# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
+# This program and the accompanying materials are licensed and made available
+# under the terms and conditions of the BSD License which accompanies this
+# distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
@@ -58,7 +58,7 @@ def CheckDpDepex(Dep, Guid, Version, WorkspaceDir):
return 1
else:
#
- # report list of modules that are not valid due to force
+ # report list of modules that are not valid due to force
# remove,
# also generate a log file for reference
#
@@ -72,12 +72,12 @@ def CheckDpDepex(Dep, Guid, Version, WorkspaceDir):
LogFile.write("%s\n"%ModulePath)
Logger.Info(ModulePath)
except IOError:
- Logger.Warn("\nRmPkg", ST.ERR_FILE_WRITE_FAILURE,
+ Logger.Warn("\nRmPkg", ST.ERR_FILE_WRITE_FAILURE,
File=LogFilePath)
except IOError:
- Logger.Warn("\nRmPkg", ST.ERR_FILE_OPEN_FAILURE,
+ Logger.Warn("\nRmPkg", ST.ERR_FILE_OPEN_FAILURE,
File=LogFilePath)
- finally:
+ finally:
LogFile.close()
## Remove Path
@@ -85,7 +85,7 @@ def CheckDpDepex(Dep, Guid, Version, WorkspaceDir):
# removing readonly file on windows will get "Access is denied"
# error, so before removing, change the mode to be writeable
#
-# @param Path: The Path to be removed
+# @param Path: The Path to be removed
#
def RemovePath(Path):
Logger.Info(ST.MSG_REMOVE_FILE % Path)
@@ -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
# if it's executed successfully or not.
#
-# @param Options: command option
+# @param Options: command option
#
def Main(Options = None):
try:
- DataBase = GlobalData.gDB
+ DataBase = GlobalData.gDB
if not Options.DistributionFile:
- Logger.Error("RmPkg",
- OPTION_MISSING,
+ Logger.Error("RmPkg",
+ OPTION_MISSING,
ExtraData=ST.ERR_SPECIFY_PACKAGE)
WorkspaceDir = GlobalData.gWORKSPACE
#
# Prepare check dependency
#
Dep = DependencyRules(DataBase)
-
+
#
# Get the Dp information
#
StoredDistFile, Guid, Version = GetInstalledDpInfo(Options.DistributionFile, Dep, DataBase, WorkspaceDir)
- #
+ #
# Check Dp depex
#
CheckDpDepex(Dep, Guid, Version, WorkspaceDir)
- #
+ #
# remove distribution
#
RemoveDist(Guid, Version, StoredDistFile, DataBase, WorkspaceDir, Options.Yes)
Logger.Quiet(ST.MSG_FINISH)
-
+
ReturnCode = 0
-
+
except FatalError as XExcept:
- ReturnCode = XExcept.args[0]
+ ReturnCode = XExcept.args[0]
if Logger.GetLevel() <= Logger.DEBUG_9:
Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(), platform) + \
format_exc())
@@ -203,7 +203,7 @@ def GetInstalledDpInfo(DistributionFile, Dep, DataBase, WorkspaceDir):
if not Dep.CheckDpExists(Guid, Version):
Logger.Error("RmPkg", UNKNOWN_ERROR, ST.ERR_DISTRIBUTION_NOT_INSTALLED)
#
- # Check for Distribution files existence in /conf/upt, if not exist,
+ # Check for Distribution files existence in /conf/upt, if not exist,
# Warn user and go on.
#
StoredDistFile = os.path.normpath(os.path.join(WorkspaceDir, GlobalData.gUPT_DIR, NewDpFileName))
@@ -252,7 +252,7 @@ def RemoveDist(Guid, Version, StoredDistFile, DataBase, WorkspaceDir, ForceRemov
RemovePath(Path)
else:
MissingFileList.append(Path)
-
+
for Path in NewFileList:
if os.path.isfile(Path):
if (not ForceRemove) and (not os.path.split(Path)[1].startswith('.')):