From fb0f8067ea4bfe21b8bc3bd2b2617f5b3d8d87aa Mon Sep 17 00:00:00 2001 From: Hesheng Chen <hesheng.chen@intel.com> Date: Thu, 8 Oct 2015 09:28:15 +0000 Subject: 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 --- BaseTools/Source/Python/UPT/Library/Parsing.py | 32 ++++++++++++++------------ 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'BaseTools/Source/Python/UPT/Library/Parsing.py') diff --git a/BaseTools/Source/Python/UPT/Library/Parsing.py b/BaseTools/Source/Python/UPT/Library/Parsing.py index ace3e0d118..c34e775144 100644 --- a/BaseTools/Source/Python/UPT/Library/Parsing.py +++ b/BaseTools/Source/Python/UPT/Library/Parsing.py @@ -827,21 +827,23 @@ def GetPkgInfoFromDec(Path): def GetWorkspacePackage(): DecFileList = [] WorkspaceDir = GlobalData.gWORKSPACE - for Root, Dirs, Files in os.walk(WorkspaceDir): - if 'CVS' in Dirs: - Dirs.remove('CVS') - if '.svn' in Dirs: - Dirs.remove('.svn') - for Dir in Dirs: - if Dir.startswith('.'): - Dirs.remove(Dir) - for FileSp in Files: - if FileSp.startswith('.'): - continue - Ext = os.path.splitext(FileSp)[1] - if Ext.lower() in ['.dec']: - DecFileList.append\ - (os.path.normpath(os.path.join(Root, FileSp))) + PackageDir = GlobalData.gPACKAGE_PATH + for PkgRoot in [WorkspaceDir] + PackageDir: + for Root, Dirs, Files in os.walk(PkgRoot): + if 'CVS' in Dirs: + Dirs.remove('CVS') + if '.svn' in Dirs: + Dirs.remove('.svn') + for Dir in Dirs: + if Dir.startswith('.'): + Dirs.remove(Dir) + for FileSp in Files: + if FileSp.startswith('.'): + continue + Ext = os.path.splitext(FileSp)[1] + if Ext.lower() in ['.dec']: + DecFileList.append\ + (os.path.normpath(os.path.join(Root, FileSp))) # # abstract package guid, version info from DecFile List # -- cgit v1.2.3