diff options
author | Hesheng Chen <hesheng.chen@intel.com> | 2015-10-08 09:28:15 +0000 |
---|---|---|
committer | lgao4 <lgao4@Edk2> | 2015-10-08 09:28:15 +0000 |
commit | fb0f8067ea4bfe21b8bc3bd2b2617f5b3d8d87aa (patch) | |
tree | 882a5514c217ca069268fd4cbbece6ad738fcb85 /BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py | |
parent | 05cc51ad5894c8904d0fe5cdcf3f4d0a07dab85d (diff) | |
download | edk2-platforms-fb0f8067ea4bfe21b8bc3bd2b2617f5b3d8d87aa.tar.xz |
BaseTools: Update UPT tool to support multiple workspaces
Update UPT to refer MultipleWorkspace class to convert
the file path from WORKSPACE and PACKAGES_PATH.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hesheng Chen <hesheng.chen@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18580 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py')
-rw-r--r-- | BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py b/BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py index bfe6dcc70f..9c55e0ea88 100644 --- a/BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py +++ b/BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py @@ -32,6 +32,7 @@ from Logger.ToolError import EDK1_INF_ERROR from Object.POM.CommonObject import IdentificationObject
from Object.POM.CommonObject import CommonHeaderObject
from Object.POM.CommonObject import MiscFileObject
+from Common.MultipleWorkspace import MultipleWorkspace as mws
## DistributionPackageHeaderClass
#
@@ -110,14 +111,17 @@ class DistributionPackageClass(object): # @param ModuleList: A list of all modules
#
def GetDistributionPackage(self, WorkspaceDir, PackageList, ModuleList):
+ # Backup WorkspaceDir
+ Root = WorkspaceDir
+
#
# Get Packages
#
if PackageList:
for PackageFile in PackageList:
- PackageFileFullPath = \
- os.path.normpath(os.path.join(WorkspaceDir, PackageFile))
- DecObj = DecPomAlignment(PackageFileFullPath, WorkspaceDir, CheckMulDec = True)
+ PackageFileFullPath = mws.join(Root, PackageFile)
+ WorkspaceDir = mws.getWs(Root, PackageFile)
+ DecObj = DecPomAlignment(PackageFileFullPath, WorkspaceDir, CheckMulDec=True)
PackageObj = DecObj
#
# Parser inf file one bye one
@@ -140,8 +144,7 @@ class DistributionPackageClass(object): # Inf class in InfPomAlignment.
#
try:
- ModuleObj = InfPomAlignment(Filename, WorkspaceDir, \
- PackageObj.GetPackagePath())
+ ModuleObj = InfPomAlignment(Filename, WorkspaceDir, PackageObj.GetPackagePath())
#
# Add module to package
@@ -168,11 +171,11 @@ class DistributionPackageClass(object): #
if ModuleList:
for ModuleFile in ModuleList:
- ModuleFileFullPath = \
- os.path.normpath(os.path.join(WorkspaceDir, ModuleFile))
+ ModuleFileFullPath = mws.join(Root, ModuleFile)
+ WorkspaceDir = mws.getWs(Root, ModuleFile)
+
try:
- ModuleObj = InfPomAlignment(ModuleFileFullPath,
- WorkspaceDir)
+ ModuleObj = InfPomAlignment(ModuleFileFullPath, WorkspaceDir)
ModuleKey = (ModuleObj.GetGuid(),
ModuleObj.GetVersion(),
ModuleObj.GetName(),
@@ -185,7 +188,10 @@ class DistributionPackageClass(object): ST.WRN_EDK1_INF_FOUND%ModuleFileFullPath,
ExtraData=ST.ERR_NOT_SUPPORTED_SA_MODULE)
else:
- raise
+ raise
+
+ # Recover WorkspaceDir
+ WorkspaceDir = Root
## Get all files included for a distribution package, except tool/misc of
# distribution level
|