This patch is going to:

1.	Add a recovery mode for UPT failure
2.	Add UNI file support
3.	Add binary file header support
4.	Add support for PCD error message
5.	Add support for replace
6.	Format generated INF/DEC files
7.	Update dependency check
8.	Other minor fixes


Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Gao, Liming <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15896 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Hess Chen
2014-08-26 05:58:02 +00:00
committed by hchen30
parent f0aa06e385
commit 421ccda307
56 changed files with 5945 additions and 1710 deletions

View File

@ -2,7 +2,7 @@
#
# PackageFile class represents the zip file of a distribution package.
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2011 - 2014, 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
@ -36,7 +36,7 @@ import Logger.Log as Logger
from Logger import StringTable as ST
from Library.Misc import CreateDirectory
from Library.Misc import RemoveDirectory
from Core.FileHook import __FileHookOpen__
class PackageFile:
@ -96,7 +96,7 @@ class PackageFile:
## Extract the file
#
# @param Which: the source path
# @param To: the destination path
# @param ToDest: the destination path
#
def Extract(self, Which, ToDest):
Which = os.path.normpath(Which)
@ -116,7 +116,8 @@ class PackageFile:
Logger.Warn("PackagingTool", \
ST.WRN_FILE_NOT_OVERWRITTEN % ToDest)
return
ToFile = open(ToDest, "wb")
else:
ToFile = __FileHookOpen__(ToDest, 'wb')
except BaseException, Xstr:
Logger.Error("PackagingTool", FILE_OPEN_FAILURE,
ExtraData="%s (%s)" % (ToDest, str(Xstr)))
@ -234,6 +235,8 @@ class PackageFile:
#
def PackData(self, Data, ArcName):
try:
if os.path.splitext(ArcName)[1].lower() == '.pkg':
Data = Data.encode('utf_8')
self._ZipFile.writestr(ArcName, Data)
except BaseException, Xstr:
Logger.Error("PackagingTool", FILE_COMPRESS_FAILURE,