## @file
# Install distribution package.
#
# Copyright (c) 2011, 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
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
'''
RmPkg
'''
##
# Import Modules
#
import md5
## CheckDpDepex
#
# Check if the Depex is satisfied
# @param Dep: Dep
# @param Guid: Guid of Dp
# @param Version: Version of Dp
# @param WorkspaceDir: Workspace Dir
#
if not Removable:
return 1
else:
#
# report list of modules that are not valid due to force
# remove,
# also generate a log file for reference
#
try:
try:
for ModulePath in DependModuleList:
except IOError:
except IOError:
finally:
## Remove Path
#
# 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
#
try:
except OSError:
pass
## GetCurrentFileList
#
# @param DataBase: DataBase of UPT
# @param Guid: Guid of Dp
# @param Version: Version of Dp
# @param WorkspaceDir: Workspace Dir
#
NewFileList = []
if FilePath not in NewFileList:
return NewFileList
## Tool entrance method
#
# This method mainly dispatch specific methods per the command line options.
# 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
#
try:
if not Options.DistributionFile:
#
# Prepare check dependency
#
if not Guid:
else:
#
# Check Dp existing
#
#
# Warn user and go on.
#
StoredDistFile = None
#
# Check Dp depex
#
#
# Get Current File List
#
#
# Remove all files
#
MissingFileList = []
if Path in NewFileList:
#
# check whether modified by users
#
continue
else:
for Path in NewFileList:
continue
#
# Remove distribution files in /Conf/.upt
#
if StoredDistFile is not None:
#
# update database
#
ReturnCode = 0
except FatalError, XExcept:
format_exc())
except KeyboardInterrupt:
format_exc())
except:
"\nRmPkg",
)
format_exc())
return ReturnCode