|
From: <js...@us...> - 2011-10-24 08:49:55
|
Revision: 2376
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2376&view=rev
Author: jsu1
Date: 2011-10-24 08:49:49 +0000 (Mon, 24 Oct 2011)
Log Message:
-----------
fix EDKI modules [nmake] section /DFLAG issue
Reviewed-by: gikidy
Reviewed-by: yingke
Signed-off-by: jsu1
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Common/String.py
trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
Modified: trunk/BaseTools/Source/Python/Common/String.py
===================================================================
--- trunk/BaseTools/Source/Python/Common/String.py 2011-10-24 06:11:20 UTC (rev 2375)
+++ trunk/BaseTools/Source/Python/Common/String.py 2011-10-24 08:49:49 UTC (rev 2376)
@@ -72,6 +72,21 @@
return ValueList
+## GetSplitList
+#
+# Get a value list from a string with multiple values splited with SplitString
+# The default SplitTag is DataType.TAB_VALUE_SPLIT
+# 'AAA|BBB|CCC' -> ['AAA', 'BBB', 'CCC']
+#
+# @param String: The input string to be splitted
+# @param SplitStr: The split key, default is DataType.TAB_VALUE_SPLIT
+# @param MaxSplit: The max number of split values, default is -1
+#
+# @retval list() A list for splitted string
+#
+def GetSplitList(String, SplitStr = DataType.TAB_VALUE_SPLIT, MaxSplit = -1):
+ return map(lambda l: l.strip(), String.split(SplitStr, MaxSplit))
+
## MergeArches
#
# Find a key's all arches in dict, add the new arch to the list
Modified: trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
===================================================================
--- trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py 2011-10-24 06:11:20 UTC (rev 2375)
+++ trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py 2011-10-24 08:49:49 UTC (rev 2376)
@@ -1542,7 +1542,7 @@
ToolChain = "*_*_*_%s_FLAGS" % Tool
ToolChainFamily = 'MSFT' # Edk.x only support MSFT tool chain
#ignore not replaced macros in value
- ValueList = GetSplitValueList(' ' + Value, '/D')
+ ValueList = GetSplitList(' ' + Value, '/D')
Dummy = ValueList[0]
for Index in range(1, len(ValueList)):
if ValueList[Index][-1] == '=' or ValueList[Index] == '':
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|