diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-12-07 06:19:28 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-12-07 06:19:28 +0000 |
commit | d0acc87a41d9aa25fe87eb096efa62afacd1f865 (patch) | |
tree | 4430e100da50ce255ab37dc6ba09e8ff11252443 /BaseTools/Source/Python/UPT | |
parent | b7891584a58d5e5e26f35c0944cae5f03efd880b (diff) | |
download | edk2-platforms-d0acc87a41d9aa25fe87eb096efa62afacd1f865.tar.xz |
Sync BaseTool trunk (version r2460) into EDKII BaseTools. The change mainly includes:
1. Support use expression as DSC file PCD value.
2. Update FDF parser to fix bug to get complete macro value.
3. Fix bug to replace SET statement macro and evaluate SET statement PCD value in FDF file.
4. Fix a bug for MACRO defined in conditional block cannot be processed correctly
Signed-off-by: lgao4
Reviewed-by: gikidy
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12827 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/UPT')
-rw-r--r-- | BaseTools/Source/Python/UPT/BuildVersion.py | 2 | ||||
-rw-r--r-- | BaseTools/Source/Python/UPT/Core/DependencyRules.py | 6 | ||||
-rw-r--r-- | BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py | 20 | ||||
-rw-r--r-- | BaseTools/Source/Python/UPT/Core/IpiDb.py | 190 | ||||
-rw-r--r-- | BaseTools/Source/Python/UPT/InstallPkg.py | 12 | ||||
-rw-r--r-- | BaseTools/Source/Python/UPT/Library/Misc.py | 2 | ||||
-rw-r--r-- | BaseTools/Source/Python/UPT/Logger/StringTable.py | 1 | ||||
-rw-r--r-- | BaseTools/Source/Python/UPT/Logger/ToolError.py | 1 | ||||
-rw-r--r-- | BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py | 3 | ||||
-rw-r--r-- | BaseTools/Source/Python/UPT/Xml/XmlParser.py | 4 |
10 files changed, 134 insertions, 107 deletions
diff --git a/BaseTools/Source/Python/UPT/BuildVersion.py b/BaseTools/Source/Python/UPT/BuildVersion.py index 4bb9a8b521..fc3239135c 100644 --- a/BaseTools/Source/Python/UPT/BuildVersion.py +++ b/BaseTools/Source/Python/UPT/BuildVersion.py @@ -1,3 +1,3 @@ #This file is for build version number auto generation
#
-gBUILD_VERSION = "Build 2423"
+gBUILD_VERSION = "Build 2460"
diff --git a/BaseTools/Source/Python/UPT/Core/DependencyRules.py b/BaseTools/Source/Python/UPT/Core/DependencyRules.py index ac656bb02a..752d8e8f41 100644 --- a/BaseTools/Source/Python/UPT/Core/DependencyRules.py +++ b/BaseTools/Source/Python/UPT/Core/DependencyRules.py @@ -55,12 +55,12 @@ class DependencyRules(object): # @param Guid: Guid of a module
# @param Version: Version of a module
#
- def CheckModuleExists(self, Guid, Version, ReturnCode=DEPEX_CHECK_SUCCESS):
+ def CheckModuleExists(self, Guid, Version, Name, Path, ReturnCode=DEPEX_CHECK_SUCCESS):
if ReturnCode:
pass
Logger.Verbose(ST.MSG_CHECK_MODULE_EXIST)
- ModuleList = self.IpiDb.GetModInPackage(Guid, Version)
- ModuleList.extend(self.IpiDb.GetStandaloneModule(Guid, Version))
+ ModuleList = self.IpiDb.GetModInPackage(Guid, Version, Name, Path)
+ ModuleList.extend(self.IpiDb.GetStandaloneModule(Guid, Version, Name, Path))
Logger.Verbose(ST.MSG_CHECK_MODULE_EXIST_FINISH)
if len(ModuleList) > 0:
return True
diff --git a/BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py b/BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py index 0387237951..8ac8d4ed52 100644 --- a/BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py +++ b/BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py @@ -95,7 +95,7 @@ class DistributionPackageClass(object): #
self.PackageSurfaceArea = Sdict()
#
- # {(Guid, Version, Path) : ModuleObj}
+ # {(Guid, Version, Name, Path) : ModuleObj}
#
self.ModuleSurfaceArea = Sdict()
self.Tools = MiscFileObject()
@@ -149,6 +149,7 @@ class DistributionPackageClass(object): ModuleDict = PackageObj.GetModuleDict()
ModuleDict[(ModuleObj.GetGuid(), \
ModuleObj.GetVersion(), \
+ ModuleObj.GetName(), \
ModuleObj.GetCombinePath())] = ModuleObj
PackageObj.SetModuleDict(ModuleDict)
except FatalError, ErrCode:
@@ -172,10 +173,11 @@ class DistributionPackageClass(object): try:
ModuleObj = InfPomAlignment(ModuleFileFullPath,
WorkspaceDir)
- self.ModuleSurfaceArea[(ModuleObj.GetGuid(), \
- ModuleObj.GetVersion(), \
- ModuleObj.GetCombinePath())] = \
- ModuleObj
+ ModuleKey = (ModuleObj.GetGuid(),
+ ModuleObj.GetVersion(),
+ ModuleObj.GetName(),
+ ModuleObj.GetCombinePath())
+ self.ModuleSurfaceArea[ModuleKey] = ModuleObj
except FatalError, ErrCode:
if ErrCode.message == EDK1_INF_ERROR:
Logger.Error("UPT",
@@ -207,16 +209,16 @@ class DistributionPackageClass(object): Module = None
ModuleDict = Package.GetModuleDict()
- for Guid, Version, Path in ModuleDict:
- Module = ModuleDict[Guid, Version, Path]
+ for Guid, Version, Name, Path in ModuleDict:
+ Module = ModuleDict[Guid, Version, Name, Path]
ModulePath = Module.GetModulePath()
FullPath = Module.GetFullPath()
PkgRelPath = os.path.normpath(os.path.join(PackagePath, ModulePath))
MetaDataFileList.append(Path)
self.FileList += GetNonMetaDataFiles(os.path.dirname(FullPath), ['CVS', '.svn'], False, PkgRelPath)
- for Guid, Version, Path in self.ModuleSurfaceArea:
- Module = self.ModuleSurfaceArea[Guid, Version, Path]
+ for Guid, Version, Name, Path in self.ModuleSurfaceArea:
+ Module = self.ModuleSurfaceArea[Guid, Version, Name, Path]
ModulePath = Module.GetModulePath()
FullPath = Module.GetFullPath()
MetaDataFileList.append(Path)
diff --git a/BaseTools/Source/Python/UPT/Core/IpiDb.py b/BaseTools/Source/Python/UPT/Core/IpiDb.py index 38f872c2ad..e45acb7d48 100644 --- a/BaseTools/Source/Python/UPT/Core/IpiDb.py +++ b/BaseTools/Source/Python/UPT/Core/IpiDb.py @@ -26,6 +26,7 @@ import time import Logger.Log as Logger
from Logger import StringTable as ST
from Logger.ToolError import UPT_ALREADY_RUNNING_ERROR
+from Logger.ToolError import UPT_DB_UPDATE_ERROR
## IpiDb
#
@@ -118,11 +119,12 @@ class IpiDatabase(object): create table IF NOT EXISTS %s (
ModuleGuid TEXT NOT NULL,
ModuleVersion TEXT NOT NULL,
+ ModuleName TEXT NOT NULL,
InstallTime REAL NOT NULL,
PackageGuid TEXT,
PackageVersion TEXT,
InstallPath TEXT NOT NULL,
- PRIMARY KEY (ModuleGuid, ModuleVersion, InstallPath)
+ PRIMARY KEY (ModuleGuid, ModuleVersion, ModuleName, InstallPath)
)""" % self.ModInPkgTable
self.Cur.execute(SqlCommand)
@@ -130,11 +132,12 @@ class IpiDatabase(object): create table IF NOT EXISTS %s (
ModuleGuid TEXT NOT NULL,
ModuleVersion TEXT NOT NULL,
+ ModuleName TEXT NOT NULL,
InstallTime REAL NOT NULL,
DpGuid TEXT,
DpVersion TEXT,
InstallPath TEXT NOT NULL,
- PRIMARY KEY (ModuleGuid, ModuleVersion, InstallPath)
+ PRIMARY KEY (ModuleGuid, ModuleVersion, ModuleName, InstallPath)
)""" % self.StandaloneModTable
self.Cur.execute(SqlCommand)
@@ -142,6 +145,7 @@ class IpiDatabase(object): create table IF NOT EXISTS %s (
ModuleGuid TEXT NOT NULL,
ModuleVersion TEXT NOT NULL,
+ ModuleName TEXT NOT NULL,
InstallPath TEXT NOT NULL,
DepexGuid TEXT,
DepexVersion TEXT
@@ -160,64 +164,72 @@ class IpiDatabase(object): # @param RePackage: A RePackage
#
def AddDPObject(self, DpObj, NewDpPkgFileName, DpPkgFileName, RePackage):
-
- for PkgKey in DpObj.PackageSurfaceArea.keys():
- PkgGuid = PkgKey[0]
- PkgVersion = PkgKey[1]
- PkgInstallPath = PkgKey[2]
- self._AddPackage(PkgGuid, PkgVersion, DpObj.Header.GetGuid(), \
- DpObj.Header.GetVersion(), PkgInstallPath)
- PkgObj = DpObj.PackageSurfaceArea[PkgKey]
- for ModKey in PkgObj.GetModuleDict().keys():
+ try:
+ for PkgKey in DpObj.PackageSurfaceArea.keys():
+ PkgGuid = PkgKey[0]
+ PkgVersion = PkgKey[1]
+ PkgInstallPath = PkgKey[2]
+ self._AddPackage(PkgGuid, PkgVersion, DpObj.Header.GetGuid(), \
+ DpObj.Header.GetVersion(), PkgInstallPath)
+ PkgObj = DpObj.PackageSurfaceArea[PkgKey]
+ for ModKey in PkgObj.GetModuleDict().keys():
+ ModGuid = ModKey[0]
+ ModVersion = ModKey[1]
+ ModName = ModKey[2]
+ ModInstallPath = ModKey[3]
+ ModInstallPath = \
+ os.path.normpath(os.path.join(PkgInstallPath, ModInstallPath))
+ self._AddModuleInPackage(ModGuid, ModVersion, ModName, PkgGuid, \
+ PkgVersion, ModInstallPath)
+ ModObj = PkgObj.GetModuleDict()[ModKey]
+ for Dep in ModObj.GetPackageDependencyList():
+ DepexGuid = Dep.GetGuid()
+ DepexVersion = Dep.GetVersion()
+ self._AddModuleDepex(ModGuid, ModVersion, ModName, ModInstallPath, \
+ DepexGuid, DepexVersion)
+ for (FilePath, Md5Sum) in PkgObj.FileList:
+ self._AddDpFilePathList(DpObj.Header.GetGuid(), \
+ DpObj.Header.GetVersion(), FilePath, \
+ Md5Sum)
+
+ for ModKey in DpObj.ModuleSurfaceArea.keys():
ModGuid = ModKey[0]
ModVersion = ModKey[1]
- ModInstallPath = ModKey[2]
- ModInstallPath = \
- os.path.normpath(os.path.join(PkgInstallPath, ModInstallPath))
- self._AddModuleInPackage(ModGuid, ModVersion, PkgGuid, \
- PkgVersion, ModInstallPath)
- ModObj = PkgObj.GetModuleDict()[ModKey]
+ ModName = ModKey[2]
+ ModInstallPath = ModKey[3]
+ self._AddStandaloneModule(ModGuid, ModVersion, ModName, \
+ DpObj.Header.GetGuid(), \
+ DpObj.Header.GetVersion(), \
+ ModInstallPath)
+ ModObj = DpObj.ModuleSurfaceArea[ModKey]
for Dep in ModObj.GetPackageDependencyList():
DepexGuid = Dep.GetGuid()
DepexVersion = Dep.GetVersion()
- self._AddModuleDepex(ModGuid, ModVersion, ModInstallPath, \
+ self._AddModuleDepex(ModGuid, ModVersion, ModName, ModInstallPath, \
DepexGuid, DepexVersion)
- for (FilePath, Md5Sum) in PkgObj.FileList:
- self._AddDpFilePathList(DpObj.Header.GetGuid(), \
- DpObj.Header.GetVersion(), FilePath, \
- Md5Sum)
-
- for ModKey in DpObj.ModuleSurfaceArea.keys():
- ModGuid = ModKey[0]
- ModVersion = ModKey[1]
- ModInstallPath = ModKey[2]
- self._AddStandaloneModule(ModGuid, ModVersion, \
- DpObj.Header.GetGuid(), \
- DpObj.Header.GetVersion(), \
- ModInstallPath)
- ModObj = DpObj.ModuleSurfaceArea[ModKey]
- for Dep in ModObj.GetPackageDependencyList():
- DepexGuid = Dep.GetGuid()
- DepexVersion = Dep.GetVersion()
- self._AddModuleDepex(ModGuid, ModVersion, ModInstallPath, \
- DepexGuid, DepexVersion)
- for (Path, Md5Sum) in ModObj.FileList:
+ for (Path, Md5Sum) in ModObj.FileList:
+ self._AddDpFilePathList(DpObj.Header.GetGuid(), \
+ DpObj.Header.GetVersion(), \
+ Path, Md5Sum)
+
+ #
+ # add tool/misc files
+ #
+ for (Path, Md5Sum) in DpObj.FileList:
self._AddDpFilePathList(DpObj.Header.GetGuid(), \
- DpObj.Header.GetVersion(), \
- Path, Md5Sum)
-
- #
- # add tool/misc files
- #
- for (Path, Md5Sum) in DpObj.FileList:
- self._AddDpFilePathList(DpObj.Header.GetGuid(), \
- DpObj.Header.GetVersion(), Path, Md5Sum)
-
- self._AddDp(DpObj.Header.GetGuid(), DpObj.Header.GetVersion(), \
- NewDpPkgFileName, DpPkgFileName, RePackage)
+ DpObj.Header.GetVersion(), Path, Md5Sum)
+
+ self._AddDp(DpObj.Header.GetGuid(), DpObj.Header.GetVersion(), \
+ NewDpPkgFileName, DpPkgFileName, RePackage)
+
+ self.Conn.commit()
+ except sqlite3.IntegrityError, DetailMsg:
+ Logger.Error("UPT",
+ UPT_DB_UPDATE_ERROR,
+ ST.ERR_UPT_DB_UPDATE_ERROR,
+ ExtraData = DetailMsg
+ )
- self.Conn.commit()
-
## Add a distribution install information
#
# @param Guid Guid of the distribution package
@@ -290,12 +302,14 @@ class IpiDatabase(object): ## Add a module that from a package install information
#
- # @param Guid: A package guid
- # @param Version: A package version
- # @param PkgGuid: A package guid
- # @param PkgFileName: A package File Name
+ # @param Guid: Module Guid
+ # @param Version: Module version
+ # @param Name: Module Name
+ # @param PkgGuid: Package Guid
+ # @param PkgVersion: Package version
+ # @param Path: Package relative path that module installs
#
- def _AddModuleInPackage(self, Guid, Version, PkgGuid=None, \
+ def _AddModuleInPackage(self, Guid, Version, Name, PkgGuid=None, \
PkgVersion=None, Path=''):
if Version == None or len(Version.strip()) == 0:
@@ -312,8 +326,8 @@ class IpiDatabase(object): #
CurrentTime = time.time()
SqlCommand = \
- """insert into %s values('%s', '%s', %s, '%s', '%s', '%s')""" % \
- (self.ModInPkgTable, Guid, Version, CurrentTime, PkgGuid, PkgVersion, \
+ """insert into %s values('%s', '%s', '%s', %s, '%s', '%s', '%s')""" % \
+ (self.ModInPkgTable, Guid, Version, Name, CurrentTime, PkgGuid, PkgVersion, \
Path)
self.Cur.execute(SqlCommand)
@@ -321,11 +335,12 @@ class IpiDatabase(object): #
# @param Guid: a module Guid
# @param Version: a module Version
+ # @param Name: a module name
# @param DpGuid: a DpGuid
# @param DpVersion: a DpVersion
# @param Path: path
#
- def _AddStandaloneModule(self, Guid, Version, DpGuid=None, \
+ def _AddStandaloneModule(self, Guid, Version, Name, DpGuid=None, \
DpVersion=None, Path=''):
if Version == None or len(Version.strip()) == 0:
@@ -342,8 +357,8 @@ class IpiDatabase(object): #
CurrentTime = time.time()
SqlCommand = \
- """insert into %s values('%s', '%s', %s, '%s', '%s', '%s')""" % \
- (self.StandaloneModTable, Guid, Version, CurrentTime, DpGuid, \
+ """insert into %s values('%s', '%s', '%s', %s, '%s', '%s', '%s')""" % \
+ (self.StandaloneModTable, Guid, Version, Name, CurrentTime, DpGuid, \
DpVersion, Path)
self.Cur.execute(SqlCommand)
@@ -351,10 +366,11 @@ class IpiDatabase(object): #
# @param Guid: a module Guid
# @param Version: a module Version
+ # @param Name: a module name
# @param DepexGuid: a module DepexGuid
# @param DepexVersion: a module DepexVersion
#
- def _AddModuleDepex(self, Guid, Version, Path, DepexGuid=None, \
+ def _AddModuleDepex(self, Guid, Version, Name, Path, DepexGuid=None, \
DepexVersion=None):
if DepexGuid == None or len(DepexGuid.strip()) == 0:
@@ -366,8 +382,8 @@ class IpiDatabase(object): #
# Add module depex information to DB.
#
- SqlCommand = """insert into %s values('%s', '%s', '%s', '%s', '%s')"""\
- % (self.ModDepexTable, Guid, Version, Path, DepexGuid, DepexVersion)
+ SqlCommand = """insert into %s values('%s', '%s', '%s', '%s', '%s', '%s')"""\
+ % (self.ModDepexTable, Guid, Version, Name, Path, DepexGuid, DepexVersion)
self.Cur.execute(SqlCommand)
## Remove a distribution install information, if no version specified,
@@ -389,10 +405,13 @@ class IpiDatabase(object): and ModDepexInfo.ModuleVersion in
(select ModuleVersion from StandaloneModInfo as B
where B.DpGuid = '%s' and B.DpVersion = '%s')
+ and ModDepexInfo.ModuleName in
+ (select ModuleName from StandaloneModInfo as B
+ where B.DpGuid = '%s' and B.DpVersion = '%s')
and ModDepexInfo.InstallPath in
(select InstallPath from StandaloneModInfo as B
where B.DpGuid = '%s' and B.DpVersion = '%s') """ % \
- (DpGuid, DpVersion, DpGuid, DpVersion, DpGuid, DpVersion)
+ (DpGuid, DpVersion, DpGuid, DpVersion, DpGuid, DpVersion, DpGuid, DpVersion)
self.Cur.execute(SqlCommand)
#
@@ -409,11 +428,15 @@ class IpiDatabase(object): (select ModuleVersion from ModInPkgInfo
where ModInPkgInfo.PackageGuid ='%s' and
ModInPkgInfo.PackageVersion = '%s')
+ and ModDepexInfo.ModuleName in
+ (select ModuleName from ModInPkgInfo
+ where ModInPkgInfo.PackageGuid ='%s' and
+ ModInPkgInfo.PackageVersion = '%s')
and ModDepexInfo.InstallPath in
(select InstallPath from ModInPkgInfo where
ModInPkgInfo.PackageGuid ='%s'
and ModInPkgInfo.PackageVersion = '%s')""" \
- % (Pkg[0], Pkg[1],Pkg[0], Pkg[1],Pkg[0], Pkg[1])
+ % (Pkg[0], Pkg[1], Pkg[0], Pkg[1], Pkg[0], Pkg[1],Pkg[0], Pkg[1])
self.Cur.execute(SqlCommand)
#
@@ -627,23 +650,21 @@ class IpiDatabase(object): # @param Guid: A module guid
# @param Version: A module version
#
- def GetModInPackage(self, Guid, Version, PkgGuid='', PkgVersion=''):
-
+ def GetModInPackage(self, Guid, Version, Name, Path, PkgGuid='', PkgVersion=''):
+ (ModuleGuid, ModuleVersion, ModuleName, InstallPath) = (Guid, Version, Name, Path)
if PkgVersion == '' or PkgGuid == '':
-
- (ModuleGuid, ModuleVersion) = (Guid, Version)
SqlCommand = """select * from %s where ModuleGuid ='%s' and
- ModuleVersion = '%s'""" % (self.ModInPkgTable, ModuleGuid, \
- ModuleVersion)
+ ModuleVersion = '%s' and InstallPath = '%s'
+ and ModuleName = '%s'""" % (self.ModInPkgTable, ModuleGuid, \
+ ModuleVersion, InstallPath, ModuleName)
self.Cur.execute(SqlCommand)
-
else:
- (ModuleGuid, ModuleVersion) = (Guid, Version)
SqlCommand = """select * from %s where ModuleGuid ='%s' and
- ModuleVersion = '%s' and PackageGuid ='%s'
+ ModuleVersion = '%s' and InstallPath = '%s'
+ and ModuleName = '%s' and PackageGuid ='%s'
and PackageVersion = '%s'
""" % (self.ModInPkgTable, ModuleGuid, \
- ModuleVersion, PkgGuid, PkgVersion)
+ ModuleVersion, InstallPath, ModuleName, PkgGuid, PkgVersion)
self.Cur.execute(SqlCommand)
ModList = []
@@ -662,21 +683,20 @@ class IpiDatabase(object): # @param Guid: A module guid
# @param Version: A module version
#
- def GetStandaloneModule(self, Guid, Version, DpGuid='', DpVersion=''):
-
+ def GetStandaloneModule(self, Guid, Version, Name, Path, DpGuid='', DpVersion=''):
+ (ModuleGuid, ModuleVersion, ModuleName, InstallPath) = (Guid, Version, Name, Path)
if DpGuid == '':
- (ModuleGuid, ModuleVersion) = (Guid, Version)
SqlCommand = """select * from %s where ModuleGuid ='%s' and
- ModuleVersion = '%s'""" % (self.StandaloneModTable, ModuleGuid, \
- ModuleVersion)
+ ModuleVersion = '%s' and InstallPath = '%s'
+ and ModuleName = '%s'""" % (self.StandaloneModTable, ModuleGuid, \
+ ModuleVersion, InstallPath, ModuleName)
self.Cur.execute(SqlCommand)
else:
- (ModuleGuid, ModuleVersion) = (Guid, Version)
SqlCommand = """select * from %s where ModuleGuid ='%s' and
- ModuleVersion = '%s' and DpGuid ='%s' and DpVersion = '%s'
+ ModuleVersion = '%s' and InstallPath = '%s' and ModuleName = '%s' and DpGuid ='%s' and DpVersion = '%s'
""" % (self.StandaloneModTable, ModuleGuid, \
- ModuleVersion, DpGuid, DpVersion)
+ ModuleVersion, ModuleName, InstallPath, DpGuid, DpVersion)
self.Cur.execute(SqlCommand)
ModList = []
diff --git a/BaseTools/Source/Python/UPT/InstallPkg.py b/BaseTools/Source/Python/UPT/InstallPkg.py index c258222d6d..1c75dad80b 100644 --- a/BaseTools/Source/Python/UPT/InstallPkg.py +++ b/BaseTools/Source/Python/UPT/InstallPkg.py @@ -265,11 +265,11 @@ def GetModuleList(DistPkg, Dep, WorkspaceDir, ContentZipFile, ModuleList): #
Module = None
NewDict = Sdict()
- for Guid, Version, Path in DistPkg.ModuleSurfaceArea:
+ for Guid, Version, Name, Path in DistPkg.ModuleSurfaceArea:
ModulePath = Path
- Module = DistPkg.ModuleSurfaceArea[Guid, Version, Path]
+ Module = DistPkg.ModuleSurfaceArea[Guid, Version, Name, Path]
Logger.Info(ST.MSG_INSTALL_MODULE % Module.GetName())
- if Dep.CheckModuleExists(Guid, Version):
+ if Dep.CheckModuleExists(Guid, Version, Name, Path):
Logger.Quiet(ST.WRN_MODULE_EXISTED %Path)
#
# here check for the multiple inf share the same module path cases:
@@ -291,7 +291,7 @@ def GetModuleList(DistPkg, Dep, WorkspaceDir, ContentZipFile, ModuleList): #
Module.SetModulePath(Module.GetModulePath().replace(Path, NewModulePath, 1))
- NewDict[Guid, Version, Module.GetModulePath()] = Module
+ NewDict[Guid, Version, Name, Module.GetModulePath()] = Module
#
# generate all inf for modules
@@ -737,8 +737,8 @@ def InstallPackageContent(FromPath, ToPath, Package, ContentZipFile, Dep, #
Module = None
ModuleDict = Package.GetModuleDict()
- for ModuleGuid, ModuleVersion, ModulePath in ModuleDict:
- Module = ModuleDict[ModuleGuid, ModuleVersion, ModulePath]
+ for ModuleGuid, ModuleVersion, ModuleName, ModulePath in ModuleDict:
+ Module = ModuleDict[ModuleGuid, ModuleVersion, ModuleName, ModulePath]
InstallModuleContent(FromPath, ToPath, ModulePath, Module,
ContentZipFile, WorkspaceDir, ModuleList, Package, ReadOnly)
diff --git a/BaseTools/Source/Python/UPT/Library/Misc.py b/BaseTools/Source/Python/UPT/Library/Misc.py index b67cd102d1..889b777d19 100644 --- a/BaseTools/Source/Python/UPT/Library/Misc.py +++ b/BaseTools/Source/Python/UPT/Library/Misc.py @@ -875,7 +875,7 @@ def ProcessEdkComment(LineList): for Index in xrange(StartPos, EndPos+1): LineList[Index] = '' FindEdkBlockComment = False - elif Line.find("//") != -1: + elif Line.find("//") != -1 and not Line.startswith("#"): # # handling cpp style comment # diff --git a/BaseTools/Source/Python/UPT/Logger/StringTable.py b/BaseTools/Source/Python/UPT/Logger/StringTable.py index 063ca52d2b..8a94d71046 100644 --- a/BaseTools/Source/Python/UPT/Logger/StringTable.py +++ b/BaseTools/Source/Python/UPT/Logger/StringTable.py @@ -524,6 +524,7 @@ ERR_UNKNOWN_ERROR = _("Unknown error") ERR_UPT_ALREADY_INSTALLED_ERROR = _("Already installed")
ERR_UPT_ENVIRON_MISSING_ERROR = _("Environ missing")
ERR_UPT_REPKG_ERROR = _("File not allowed for RePackage")
+ERR_UPT_DB_UPDATE_ERROR = _("Update database did not complete successfully")
ERR_UPT_INI_PARSE_ERROR = _("INI file parse error")
ERR_COPYRIGHT_MISSING = \
_("Header comment section must have copyright information")
diff --git a/BaseTools/Source/Python/UPT/Logger/ToolError.py b/BaseTools/Source/Python/UPT/Logger/ToolError.py index 69600b2c01..906d03337c 100644 --- a/BaseTools/Source/Python/UPT/Logger/ToolError.py +++ b/BaseTools/Source/Python/UPT/Logger/ToolError.py @@ -97,6 +97,7 @@ UPT_ENVIRON_MISSING_ERROR = 0xD001 UPT_REPKG_ERROR = 0xD002 UPT_ALREADY_RUNNING_ERROR = 0xD003 UPT_MUL_DEC_ERROR = 0xD004 +UPT_DB_UPDATE_ERROR = 0xD005 UPT_INI_PARSE_ERROR = 0xE000 ## Error message of each error code diff --git a/BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py b/BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py index f340805f32..85062ac883 100644 --- a/BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py +++ b/BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py @@ -273,7 +273,8 @@ class PackageSurfaceAreaXml(object): for SubItem in XmlList(Item, '/PackageSurfaceArea/Modules/ModuleSurfaceArea'):
Tmp = ModuleSurfaceAreaXml()
Module = Tmp.FromXml(SubItem, 'ModuleSurfaceArea')
- Package.ModuleDict[(Module.GetGuid(), Module.GetVersion(), Module.GetModulePath())] = Module
+ ModuleDictKey = (Module.GetGuid(), Module.GetVersion(), Module.GetName(), Module.GetModulePath())
+ Package.ModuleDict[ModuleDictKey] = Module
#
# MiscellaneousFile
#
diff --git a/BaseTools/Source/Python/UPT/Xml/XmlParser.py b/BaseTools/Source/Python/UPT/Xml/XmlParser.py index adfeca81a0..5a2f0dc705 100644 --- a/BaseTools/Source/Python/UPT/Xml/XmlParser.py +++ b/BaseTools/Source/Python/UPT/Xml/XmlParser.py @@ -180,7 +180,9 @@ class DistributionPackageXml(object): for Item in XmlList(self.Pkg, '/DistributionPackage/ModuleSurfaceArea'):
Msa = ModuleSurfaceAreaXml()
Module = Msa.FromXml(Item, 'ModuleSurfaceArea', True)
- self.DistP.ModuleSurfaceArea[(Module.GetGuid(), Module.GetVersion(), Module.GetModulePath())] = Module
+ ModuleKey = (Module.GetGuid(), Module.GetVersion(), Module.GetName(), Module.GetModulePath())
+ self.DistP.ModuleSurfaceArea[ModuleKey] = Module
+
#
# Parse Tools
#
|