|
From: <xf...@us...> - 2011-12-06 07:00:48
|
Revision: 2460
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2460&view=rev
Author: xfzyr
Date: 2011-12-06 07:00:42 +0000 (Tue, 06 Dec 2011)
Log Message:
-----------
Fix a bug of ECC can't figure out the duplicate GUID if they are defined in different string format.
Signed-off-by: yzeng15
Reviewed-by: hchen30
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Ecc/Check.py
trunk/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
Modified: trunk/BaseTools/Source/Python/Ecc/Check.py
===================================================================
--- trunk/BaseTools/Source/Python/Ecc/Check.py 2011-12-06 05:06:47 UTC (rev 2459)
+++ trunk/BaseTools/Source/Python/Ecc/Check.py 2011-12-06 07:00:42 UTC (rev 2460)
@@ -438,14 +438,14 @@
#
# check whether file header comment section started
#
- if Line.startswith('##') and \
+ if Line.startswith('#') and \
(Line.find('@file') > -1) and \
not HeaderCommentStart:
if CurrentSection != MODEL_UNKNOWN:
SqlStatement = """ select ID from File where FullPath like '%s'""" % FullName
ResultSet = EccGlobalData.gDb.TblFile.Exec(SqlStatement)
for Result in ResultSet:
- Msg = 'INF/DEC/DSC/FDF file header comment should begin with ""## @file"" at the very top file'
+ Msg = 'INF/DEC/DSC/FDF file header comment should begin with ""## @file"" or ""# @file""at the very top file'
EccGlobalData.gDb.TblReport.Insert(ERROR_DOXYGEN_CHECK_FILE_HEADER, Msg, "File", Result[0])
else:
@@ -479,7 +479,7 @@
SqlStatement = """ select ID from File where FullPath like '%s'""" % FullName
ResultSet = EccGlobalData.gDb.TblFile.Exec(SqlStatement)
for Result in ResultSet:
- Msg = 'INF/DEC/DSC/FDF file header comment should begin with ""## @file"" at the very top file'
+ Msg = 'INF/DEC/DSC/FDF file header comment should begin with ""## @file"" or ""# @file"" at the very top file'
EccGlobalData.gDb.TblReport.Insert(ERROR_DOXYGEN_CHECK_FILE_HEADER, Msg, "File", Result[0])
if HeaderCommentEnd == False:
SqlStatement = """ select ID from File where FullPath like '%s'""" % FullName
@@ -932,16 +932,16 @@
if Model == MODEL_EFI_PPI:
Name = 'ppi'
SqlCommand = """
- select A.ID, A.Value2 from %s as A, %s as B
+ select A.ID, A.Value1, A.Value2 from %s as A, %s as B
where A.Model = %s and B.Model = %s
and A.Value2 = B.Value2 and A.ID <> B.ID
- and A.Scope1 = B.Scope1
+ and A.Scope1 = B.Scope1 and A.Value1 <> B.Value1
group by A.ID
""" % (Table.Table, Table.Table, Model, Model)
RecordSet = Table.Exec(SqlCommand)
- for Record in RecordSet:
- if not EccGlobalData.gException.IsException(ErrorID, Record[1]):
- EccGlobalData.gDb.TblReport.Insert(ErrorID, OtherMsg="The %s value [%s] is used more than one time" % (Name.upper(), Record[1]), BelongsToTable=Table.Table, BelongsToItem=Record[0])
+ for Record in RecordSet:
+ if not EccGlobalData.gException.IsException(ErrorID, Record[1] + ':' + Record[2]):
+ EccGlobalData.gDb.TblReport.Insert(ErrorID, OtherMsg="The %s value [%s] is used more than one time" % (Name.upper(), Record[2]), BelongsToTable=Table.Table, BelongsToItem=Record[0])
# Naming Convention Check
def NamingConventionCheck(self):
Modified: trunk/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
===================================================================
--- trunk/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py 2011-12-06 05:06:47 UTC (rev 2459)
+++ trunk/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py 2011-12-06 07:00:42 UTC (rev 2460)
@@ -1636,7 +1636,28 @@
" (<CName> = <GuidValueInCFormat:{8,4,4,{2,2,2,2,2,2,2,2}}>)",
File=self.MetaFile, Line=self._LineIndex+1)
self._ValueList[0] = TokenList[0]
- self._ValueList[1] = TokenList[1]
+ #Parse the Guid value format
+ GuidValueList = TokenList[1].strip(' {}').split(',')
+ Index = 0
+ HexList = []
+ if len(GuidValueList) == 11:
+ for GuidValue in GuidValueList:
+ GuidValue = GuidValue.strip()
+ if GuidValue.startswith('0x') or GuidValue.startswith('0X'):
+ HexList.append('0x' + str(GuidValue[2:]))
+ Index += 1
+ continue
+ else:
+ if GuidValue.startswith('{'):
+ HexList.append('0x' + str(GuidValue[3:]))
+ Index += 1
+ self._ValueList[1] = "{ %s, %s, %s, { %s, %s, %s, %s, %s, %s, %s, %s }}" % (HexList[0], HexList[1], HexList[2],HexList[3],HexList[4],HexList[5],HexList[6],HexList[7],HexList[8],HexList[9],HexList[10])
+ else:
+ EdkLogger.error('Parser', FORMAT_INVALID, "Invalid GUID value format",
+ ExtraData=self._CurrentLine + \
+ " (<CName> = <GuidValueInCFormat:{8,4,4,{2,2,2,2,2,2,2,2}}>)",
+ File=self.MetaFile, Line=self._LineIndex+1)
+ self._ValueList[0] = ''
## PCD sections parser
#
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|