]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/UPT/Core/DependencyRules.py
BaseTool/UPT: Add Test Install
[mirror_edk2.git] / BaseTools / Source / Python / UPT / Core / DependencyRules.py
index 4608ed60303b842e4334463492e0291302d84f70..7039a7d6262b957cec8572735210c7dcd9eee44e 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is for installed package information database operations\r
 #\r
-# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>\r
 #\r
 # This program and the accompanying materials are licensed and made available \r
 # under the terms and conditions of the BSD License which accompanies this \r
@@ -184,6 +184,25 @@ class DependencyRules(object):
         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
+    #\r
+    # @param DpObjList:  A distribution object list\r
+    # @return: True if distribution depex satisfied\r
+    #          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
+                    PkgObj = DpObj.PackageSurfaceArea[PkgKey]\r
+                    self.PkgsToBeDepend.append((PkgObj.Guid, PkgObj.Version))\r
+            else:\r
+                return False, DpObj\r
+\r
+        return True, DpObj\r
+\r
+\r
     ## Check whether a DP depex satisfied by current workspace \r
     #  (excluding the original distribution's packages to be replaced) for Replace\r
     #\r