summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/Ecc
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2012-04-10 07:18:20 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2012-04-10 07:18:20 +0000
commit64b2609fcff9d6412eea4c74c8e74bed33dc3235 (patch)
treeb2fa2c1493272b91a04ff4f12384f3ceaa23f1a7 /BaseTools/Source/Python/Ecc
parent09e4dbeb5c0ef7d9e178e81f73c9e43f8ef48559 (diff)
downloadedk2-platforms-64b2609fcff9d6412eea4c74c8e74bed33dc3235.tar.xz
Sync BaseTools Trunk (version r2518) to EDKII main trunk.
Signed-off-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13178 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/Ecc')
-rw-r--r--BaseTools/Source/Python/Ecc/Ecc.py16
-rw-r--r--BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py5
-rw-r--r--BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py3
3 files changed, 17 insertions, 7 deletions
diff --git a/BaseTools/Source/Python/Ecc/Ecc.py b/BaseTools/Source/Python/Ecc/Ecc.py
index e2e92ef672..b1a0ab8272 100644
--- a/BaseTools/Source/Python/Ecc/Ecc.py
+++ b/BaseTools/Source/Python/Ecc/Ecc.py
@@ -28,6 +28,7 @@ from Common.String import NormPath
from Common.BuildVersion import gBUILD_VERSION
from Common import BuildToolError
from Common.Misc import PathClass
+from Common.Misc import DirCache
from MetaFileWorkspace.MetaFileParser import DscParser
from MetaFileWorkspace.MetaFileParser import DecParser
from MetaFileWorkspace.MetaFileParser import InfParser
@@ -106,6 +107,11 @@ class Ecc(object):
EccGlobalData.gDb = Database.Database(Database.DATABASE_PATH)
EccGlobalData.gDb.InitDatabase(self.IsInit)
+ #
+ # Get files real name in workspace dir
+ #
+ GlobalData.gAllFiles = DirCache(GlobalData.gWorkspace)
+
# Build ECC database
self.BuildDatabase()
@@ -137,13 +143,13 @@ class Ecc(object):
EccGlobalData.gDb.TblReport.Create()
# Build database
- if self.IsInit:
- if self.ScanSourceCode:
- EdkLogger.quiet("Building database for source code ...")
- c.CollectSourceCodeDataIntoDB(EccGlobalData.gTarget)
+ if self.IsInit:
if self.ScanMetaData:
- EdkLogger.quiet("Building database for source code done!")
+ EdkLogger.quiet("Building database for Meta Data File ...")
self.BuildMetaDataFileDatabase()
+ if self.ScanSourceCode:
+ EdkLogger.quiet("Building database for Meta Data File Done!")
+ c.CollectSourceCodeDataIntoDB(EccGlobalData.gTarget)
EccGlobalData.gIdentifierTableList = GetTableList((MODEL_FILE_C, MODEL_FILE_H), 'Identifier', EccGlobalData.gDb)
EccGlobalData.gCFileList = GetFileList(MODEL_FILE_C, EccGlobalData.gDb)
diff --git a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py
index 3060698288..643c228665 100644
--- a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py
+++ b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py
@@ -96,7 +96,10 @@ class Table(object):
#
def Drop(self):
SqlCommand = """drop table IF EXISTS %s""" % self.Table
- self.Cur.execute(SqlCommand)
+ try:
+ self.Cur.execute(SqlCommand)
+ except sqlite3.Error, e:
+ print "An error occurred when Drop a table:", e.args[0]
## Get count
#
diff --git a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
index 9ca00f043b..d10265e973 100644
--- a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
+++ b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
@@ -1162,8 +1162,9 @@ class DscParser(MetaFileParser):
self._IdMapping[Id] = self._LastItem
RecordList = self._Table.GetAll()
- self._Table.Drop()
+
self._RawTable.Drop()
+ self._Table.Drop()
for Record in RecordList:
EccGlobalData.gDb.TblDsc.Insert(Record[1],Record[2],Record[3],Record[4],Record[5],Record[6],Record[7],Record[8],Record[9],Record[10],Record[11],Record[12],Record[13],Record[14])
GlobalData.gPlatformDefines.update(self._FileLocalMacros)