|
From: <xf...@us...> - 2012-04-05 06:57:31
|
Revision: 2516
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2516&view=rev
Author: xfzyr
Date: 2012-04-05 06:57:23 +0000 (Thu, 05 Apr 2012)
Log Message:
-----------
Fix some regression issues with BRG:
1) Eliminate unnecessary blank lines in report.
2) Change the case for some keyword to align with spec.
3) Add the slash flag ?\226?\128?\152\\?\226?\128?\153 and space flag ?\226?\128?\152 ?\226?\128?\152 to break a long long line.
Fix a regression build break on Linux with debug and release as TARGET, GCC44 as TOOL_CHAIN.
Signed-off-by: Yurui Zeng <yur...@in...>
Reviewed-by: Liming Gao <lim...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Common/DataType.py
trunk/BaseTools/Source/Python/build/BuildReport.py
trunk/BaseTools/Source/Python/build/build.py
Modified: trunk/BaseTools/Source/Python/Common/DataType.py
===================================================================
--- trunk/BaseTools/Source/Python/Common/DataType.py 2012-04-03 20:14:31 UTC (rev 2515)
+++ trunk/BaseTools/Source/Python/Common/DataType.py 2012-04-05 06:57:23 UTC (rev 2516)
@@ -422,6 +422,10 @@
TAB_UNKNOWN_FILE = "UNKNOWN-TYPE-FILE"
TAB_DEFAULT_BINARY_FILE = "_BINARY_FILE_"
+# used by BRG
+TAB_BRG_PCD = 'PCD'
+TAB_BRG_LIBRARY = 'Library'
+
#
# Build Rule File Version Definition
#
Modified: trunk/BaseTools/Source/Python/build/BuildReport.py
===================================================================
--- trunk/BaseTools/Source/Python/build/BuildReport.py 2012-04-03 20:14:31 UTC (rev 2515)
+++ trunk/BaseTools/Source/Python/build/BuildReport.py 2012-04-05 06:57:23 UTC (rev 2516)
@@ -34,9 +34,11 @@
from Common.BuildToolError import FILE_WRITE_FAILURE
from Common.BuildToolError import CODE_ERROR
from Common.DataType import TAB_LINE_BREAK
-from Common.DataType import TAB_INF_PCD
-from Common.DataType import EDK_COMPONENT_TYPE_LIBRARY
from Common.DataType import TAB_DEPEX
+from Common.DataType import TAB_SLASH
+from Common.DataType import TAB_SPACE_SPLIT
+from Common.DataType import TAB_BRG_PCD
+from Common.DataType import TAB_BRG_LIBRARY
## Pattern to extract contents in EDK DXS files
gDxsDependencyPattern = re.compile(r"DEPENDENCY_START(.+)DEPENDENCY_END", re.DOTALL)
@@ -182,17 +184,24 @@
# @param MaxLength The Max Length of the line
#
def FileLinesSplit(Content=None, MaxLength=None):
- ContentList = Content.split(os.linesep)
+ ContentList = Content.split(TAB_LINE_BREAK)
NewContent = ''
NewContentList = []
for Line in ContentList:
- while len(Line) > MaxLength:
- NewContentList.append(Line[:MaxLength])
- Line = Line[MaxLength:]
+ while len(Line.rstrip()) > MaxLength:
+ LineSpaceIndex = Line.rfind(TAB_SPACE_SPLIT, 0, MaxLength)
+ LineSlashIndex = Line.rfind(TAB_SLASH, 0, MaxLength)
+ LineBreakIndex = MaxLength
+ if LineSpaceIndex > LineSlashIndex:
+ LineBreakIndex = LineSpaceIndex
+ elif LineSlashIndex > LineSpaceIndex:
+ LineBreakIndex = LineSlashIndex
+ NewContentList.append(Line[:LineBreakIndex])
+ Line = Line[LineBreakIndex:]
if Line:
NewContentList.append(Line)
for NewLine in NewContentList:
- NewContent += NewLine + os.linesep
+ NewContent += NewLine + TAB_LINE_BREAK
return NewContent
@@ -294,7 +303,7 @@
#
def GenerateReport(self, File):
FileWrite(File, gSubSectionStart)
- FileWrite(File, EDK_COMPONENT_TYPE_LIBRARY)
+ FileWrite(File, TAB_BRG_LIBRARY)
if len(self.LibraryList) > 0:
FileWrite(File, gSubSectionSep)
for LibraryItem in self.LibraryList:
@@ -718,7 +727,7 @@
# For module PCD sub-section
#
FileWrite(File, gSubSectionStart)
- FileWrite(File, TAB_INF_PCD)
+ FileWrite(File, TAB_BRG_PCD)
FileWrite(File, gSubSectionSep)
for Key in self.AllPcds:
Modified: trunk/BaseTools/Source/Python/build/build.py
===================================================================
--- trunk/BaseTools/Source/Python/build/build.py 2012-04-03 20:14:31 UTC (rev 2515)
+++ trunk/BaseTools/Source/Python/build/build.py 2012-04-05 06:57:23 UTC (rev 2516)
@@ -60,6 +60,7 @@
gToolsDefinition = "Conf/tools_def.txt"
TemporaryTablePattern = re.compile(r'^_\d+_\d+_[a-fA-F0-9]+$')
+TmpTableDict = {}
## Check environment PATH variable to make sure the specified tool is found
#
@@ -1450,14 +1451,13 @@
if BuildTask.HasError():
EdkLogger.error("build", BUILD_ERROR, "Failed to build module", ExtraData=GlobalData.gBuildingModule)
- #
- # Drop temp tables to avoid database be locked.
#
+ # Save temp tables to a TmpTableDict.
+ #
for Key in Wa.BuildDatabase._CACHE_:
if Wa.BuildDatabase._CACHE_[Key]._RawData and Wa.BuildDatabase._CACHE_[Key]._RawData._Table and Wa.BuildDatabase._CACHE_[Key]._RawData._Table.Table:
if TemporaryTablePattern.match(Wa.BuildDatabase._CACHE_[Key]._RawData._Table.Table):
- Wa.BuildDatabase._CACHE_[Key]._RawData._Table.Drop()
- Wa.BuildDatabase._CACHE_[Key]._RawData._Table.Table = 0
+ TmpTableDict[Wa.BuildDatabase._CACHE_[Key]._RawData._Table.Table] = Wa.BuildDatabase._CACHE_[Key]._RawData._Table.Cur
#
#
# All modules have been put in build tasks queue. Tell task scheduler
@@ -1822,6 +1822,10 @@
MyBuild = Build(Target, Workspace, Option)
GlobalData.gCommandLineDefines['ARCH'] = ' '.join(MyBuild.ArchList)
MyBuild.Launch()
+ # Drop temp tables to avoid database locked.
+ for TmpTableName in TmpTableDict:
+ SqlCommand = """drop table IF EXISTS %s""" % TmpTableName
+ TmpTableDict[TmpTableName].execute(SqlCommand)
#MyBuild.DumpBuildData()
except FatalError, X:
if MyBuild != None:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|