]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/UPT/Core/DependencyRules.py
BaseTools/UPT: Support Multiple Installation
[mirror_edk2.git] / BaseTools / Source / Python / UPT / Core / DependencyRules.py
index 57f7b40da553ee95927080ed3122de288d6e4560..909c584e4ec2a93eefdb6dfa71abae60eb1c2549 100644 (file)
@@ -44,12 +44,24 @@ DEPEX_CHECK_PACKAGE_NOT_FOUND, DEPEX_CHECK_DP_NOT_FOUND) = (0, 1, 2, 3)
 # @param object:      Inherited from object class\r
 #\r
 class DependencyRules(object):\r
-    def __init__(self, Datab):\r
+    def __init__(self, Datab, ToBeInstalledPkgList=None):\r
         self.IpiDb = Datab\r
         self.WsPkgList = GetWorkspacePackage()\r
         self.WsModuleList = GetWorkspaceModule()\r
-        self.PkgsToBeDepend = []\r
+\r
+        self.PkgsToBeDepend = [(PkgInfo[1], PkgInfo[2]) for PkgInfo in self.WsPkgList]\r
+\r
+        # Add package info from the DIST to be installed.\r
+        self.PkgsToBeDepend.extend(self.GenToBeInstalledPkgList(ToBeInstalledPkgList))\r
         \r
+    def GenToBeInstalledPkgList(self, ToBeInstalledPkgList):\r
+        RtnList = []\r
+        for Dist in ToBeInstalledPkgList:\r
+            for Package in Dist.PackageSurfaceArea:\r
+                RtnList.append((Package[0], Package[1]))\r
+\r
+        return RtnList\r
+\r
     ## Check whether a module exists by checking the Guid+Version+Name+Path combination\r
     #\r
     # @param Guid:  Guid of a module\r
@@ -182,7 +194,6 @@ class DependencyRules(object):
     #          False else\r
     #\r
     def CheckInstallDpDepexSatisfied(self, DpObj):\r
-        self.PkgsToBeDepend = [(PkgInfo[1], PkgInfo[2]) for PkgInfo in self.WsPkgList]\r
         return self.CheckDpDepexSatisfied(DpObj)\r
 \r
     # # Check whether multiple DP depex satisfied by current workspace for Install\r
@@ -192,7 +203,6 @@ class DependencyRules(object):
     #          False else\r
     #\r
     def CheckTestInstallPdDepexSatisfied(self, DpObjList):\r
-        self.PkgsToBeDepend = [(PkgInfo[1], PkgInfo[2]) for PkgInfo in self.WsPkgList]\r
         for DpObj in DpObjList:\r
             if self.CheckDpDepexSatisfied(DpObj):\r
                 for PkgKey in DpObj.PackageSurfaceArea.keys():\r