X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;ds=inline;f=BaseTools%2FSource%2FPython%2FUPT%2FCore%2FDependencyRules.py;h=909c584e4ec2a93eefdb6dfa71abae60eb1c2549;hb=566368148c014702f98d6c37a3934b1c1e60dfd4;hp=57f7b40da553ee95927080ed3122de288d6e4560;hpb=ef190542b4dbc4577ef7d1f99209199f0c1b6e66;p=mirror_edk2.git diff --git a/BaseTools/Source/Python/UPT/Core/DependencyRules.py b/BaseTools/Source/Python/UPT/Core/DependencyRules.py index 57f7b40da5..909c584e4e 100644 --- a/BaseTools/Source/Python/UPT/Core/DependencyRules.py +++ b/BaseTools/Source/Python/UPT/Core/DependencyRules.py @@ -44,12 +44,24 @@ DEPEX_CHECK_PACKAGE_NOT_FOUND, DEPEX_CHECK_DP_NOT_FOUND) = (0, 1, 2, 3) # @param object: Inherited from object class # class DependencyRules(object): - def __init__(self, Datab): + def __init__(self, Datab, ToBeInstalledPkgList=None): self.IpiDb = Datab self.WsPkgList = GetWorkspacePackage() self.WsModuleList = GetWorkspaceModule() - self.PkgsToBeDepend = [] + + self.PkgsToBeDepend = [(PkgInfo[1], PkgInfo[2]) for PkgInfo in self.WsPkgList] + + # Add package info from the DIST to be installed. + self.PkgsToBeDepend.extend(self.GenToBeInstalledPkgList(ToBeInstalledPkgList)) + def GenToBeInstalledPkgList(self, ToBeInstalledPkgList): + RtnList = [] + for Dist in ToBeInstalledPkgList: + for Package in Dist.PackageSurfaceArea: + RtnList.append((Package[0], Package[1])) + + return RtnList + ## Check whether a module exists by checking the Guid+Version+Name+Path combination # # @param Guid: Guid of a module @@ -182,7 +194,6 @@ class DependencyRules(object): # False else # def CheckInstallDpDepexSatisfied(self, DpObj): - self.PkgsToBeDepend = [(PkgInfo[1], PkgInfo[2]) for PkgInfo in self.WsPkgList] return self.CheckDpDepexSatisfied(DpObj) # # Check whether multiple DP depex satisfied by current workspace for Install @@ -192,7 +203,6 @@ class DependencyRules(object): # False else # def CheckTestInstallPdDepexSatisfied(self, DpObjList): - self.PkgsToBeDepend = [(PkgInfo[1], PkgInfo[2]) for PkgInfo in self.WsPkgList] for DpObj in DpObjList: if self.CheckDpDepexSatisfied(DpObj): for PkgKey in DpObj.PackageSurfaceArea.keys():