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 <hesheng.chen@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
Hess Chen
2016-07-29 15:58:23 +08:00
committed by Yonghong Zhu
parent 17f3e942bc
commit 6cf9903481
4 changed files with 141 additions and 1 deletions

View File

@ -1,7 +1,7 @@
## @file
# This file is for installed package information database operations
#
# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>
#
# 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
#