From 6cf9903481f07859cb0013598d2d13309d4e4644 Mon Sep 17 00:00:00 2001 From: Hess Chen Date: Fri, 29 Jul 2016 15:58:23 +0800 Subject: BaseTool/UPT: Add Test Install Add a new function to test if a DIST file list one by one to see if they can meet the requirement of Dependency. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen Reviewed-by: Yonghong Zhu --- BaseTools/Source/Python/UPT/Core/DependencyRules.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'BaseTools/Source/Python/UPT/Core') diff --git a/BaseTools/Source/Python/UPT/Core/DependencyRules.py b/BaseTools/Source/Python/UPT/Core/DependencyRules.py index 4608ed6030..7039a7d626 100644 --- a/BaseTools/Source/Python/UPT/Core/DependencyRules.py +++ b/BaseTools/Source/Python/UPT/Core/DependencyRules.py @@ -1,7 +1,7 @@ ## @file # This file is for installed package information database operations # -# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.
+# Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.
# # This program and the accompanying materials are licensed and made available # under the terms and conditions of the BSD License which accompanies this @@ -184,6 +184,25 @@ class DependencyRules(object): 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 + # + # @param DpObjList: A distribution object list + # @return: True if distribution depex satisfied + # 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(): + PkgObj = DpObj.PackageSurfaceArea[PkgKey] + self.PkgsToBeDepend.append((PkgObj.Guid, PkgObj.Version)) + else: + return False, DpObj + + return True, DpObj + + ## Check whether a DP depex satisfied by current workspace # (excluding the original distribution's packages to be replaced) for Replace # -- cgit v1.2.3