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>
This commit is contained in:
@ -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('.')):
|
||||
|
Reference in New Issue
Block a user