summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/UPT/Library
diff options
context:
space:
mode:
authorJeff Fan <jeff.fan@intel.com>2015-11-16 05:29:49 +0000
committervanjeff <vanjeff@Edk2>2015-11-16 05:29:49 +0000
commitaf7fca3649779f0e55220a7acda9bd11bc660fc3 (patch)
tree02585c606e356ce06fefa9ff80bc4529fcde256e /BaseTools/Source/Python/UPT/Library
parent59fd15c5a2174a6a6fc4133964e6d5b520b58663 (diff)
downloadedk2-platforms-af7fca3649779f0e55220a7acda9bd11bc660fc3.tar.xz
Update BaseTools from main trunk r18767.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@18784 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/UPT/Library')
-rw-r--r--BaseTools/Source/Python/UPT/Library/GlobalData.py3
-rw-r--r--BaseTools/Source/Python/UPT/Library/Misc.py7
-rw-r--r--BaseTools/Source/Python/UPT/Library/ParserValidate.py3
-rw-r--r--BaseTools/Source/Python/UPT/Library/Parsing.py32
4 files changed, 27 insertions, 18 deletions
diff --git a/BaseTools/Source/Python/UPT/Library/GlobalData.py b/BaseTools/Source/Python/UPT/Library/GlobalData.py
index d478983c23..8f446d4888 100644
--- a/BaseTools/Source/Python/UPT/Library/GlobalData.py
+++ b/BaseTools/Source/Python/UPT/Library/GlobalData.py
@@ -19,6 +19,7 @@ GlobalData
# The workspace directory
#
gWORKSPACE = '.'
+gPACKAGE_PATH = None
#
# INF module directory
@@ -107,4 +108,4 @@ gPackageDict = {}
# Used by Library instance parser
# {FilePath: FileObj}
#
-gLIBINSTANCEDICT = {} \ No newline at end of file
+gLIBINSTANCEDICT = {}
diff --git a/BaseTools/Source/Python/UPT/Library/Misc.py b/BaseTools/Source/Python/UPT/Library/Misc.py
index bc9e0e172b..0d92cb3767 100644
--- a/BaseTools/Source/Python/UPT/Library/Misc.py
+++ b/BaseTools/Source/Python/UPT/Library/Misc.py
@@ -50,6 +50,7 @@ from Library.ParserValidate import IsValidHexVersion
from Library.ParserValidate import IsValidPath
from Object.POM.CommonObject import TextObject
from Core.FileHook import __FileHookOpen__
+from Common.MultipleWorkspace import MultipleWorkspace as mws
## Convert GUID string in xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx style to C
# structure style
@@ -592,7 +593,11 @@ def GetWorkspace():
if WorkspaceDir[-1] == ':':
WorkspaceDir += os.sep
- return WorkspaceDir
+
+ PackagesPath = os.environ.get("PACKAGES_PATH")
+ mws.setWs(WorkspaceDir, PackagesPath)
+
+ return WorkspaceDir, mws.PACKAGES_PATH
## Get relative path
#
diff --git a/BaseTools/Source/Python/UPT/Library/ParserValidate.py b/BaseTools/Source/Python/UPT/Library/ParserValidate.py
index e973227898..028cf9a54f 100644
--- a/BaseTools/Source/Python/UPT/Library/ParserValidate.py
+++ b/BaseTools/Source/Python/UPT/Library/ParserValidate.py
@@ -27,6 +27,7 @@ from Library.DataType import TAB_SPACE_SPLIT
from Library.String import GetSplitValueList
from Library.ExpressionValidate import IsValidBareCString
from Library.ExpressionValidate import IsValidFeatureFlagExp
+from Common.MultipleWorkspace import MultipleWorkspace as mws
## __HexDigit() method
#
@@ -236,7 +237,7 @@ def IsValidPath(Path, Root):
Path = os.path.normpath(Path).replace('\\', '/')
Root = os.path.normpath(Root).replace('\\', '/')
- FullPath = os.path.normpath(os.path.join(Root, Path)).replace('\\', '/')
+ FullPath = mws.join(Root, Path)
if not os.path.exists(FullPath):
return False
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
#