]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Ecc/MetaDataParser.py
Sync EDKII BaseTools to BaseTools project r2042.
[mirror_edk2.git] / BaseTools / Source / Python / Ecc / MetaDataParser.py
index 36ad6e492fb25f99888c06ec08069ee719e45c5b..4dda2e53600126c91c84abda4fed36d018b581b4 100644 (file)
@@ -26,7 +26,7 @@ def GetIncludeListOfFile(WorkSpace, Filepath, Db):
     Filepath = os.path.normpath(Filepath)\r
     SqlCommand = """\r
                 select Value1, FullPath from Inf, File where Inf.Model = %s and Inf.BelongsToFile in(\r
-                    select distinct B.BelongsToFile from File as A left join Inf as B \r
+                    select distinct B.BelongsToFile from File as A left join Inf as B\r
                         where A.ID = B.BelongsToFile and B.Model = %s and (A.Path || '%s' || B.Value1) = '%s')\r
                         and Inf.BelongsToFile = File.ID""" \\r
                 % (MODEL_META_DATA_PACKAGE, MODEL_EFI_SOURCE_FILE, '\\', Filepath)\r
@@ -36,7 +36,7 @@ def GetIncludeListOfFile(WorkSpace, Filepath, Db):
         InfFullPath = os.path.normpath(os.path.join(WorkSpace, Record[1]))\r
         (DecPath, DecName) = os.path.split(DecFullPath)\r
         (InfPath, InfName) = os.path.split(InfFullPath)\r
-        SqlCommand = """select Value1 from Dec where BelongsToFile = \r
+        SqlCommand = """select Value1 from Dec where BelongsToFile =\r
                            (select ID from File where FullPath = '%s') and Model = %s""" \\r
                     % (DecFullPath, MODEL_EFI_INCLUDE)\r
         NewRecordSet = Db.TblDec.Exec(SqlCommand)\r
@@ -46,9 +46,22 @@ def GetIncludeListOfFile(WorkSpace, Filepath, Db):
             IncludePath = os.path.normpath(os.path.join(DecPath, NewRecord[0]))\r
             if IncludePath not in IncludeList:\r
                 IncludeList.append(IncludePath)\r
-    \r
+\r
     return IncludeList\r
 \r
+## Get the file list\r
+#\r
+# Search table file and find all specific type files\r
+#\r
+def GetFileList(FileModel, Db):\r
+    FileList = []\r
+    SqlCommand = """select FullPath from File where Model = %s""" % str(FileModel)\r
+    RecordSet = Db.TblFile.Exec(SqlCommand)\r
+    for Record in RecordSet:\r
+        FileList.append(Record[0])\r
+\r
+    return FileList\r
+\r
 ## Get the table list\r
 #\r
 # Search table file and find all small tables\r
@@ -60,6 +73,6 @@ def GetTableList(FileModelList, Table, Db):
     for Record in RecordSet:\r
         TableName = Table + str(Record[0])\r
         TableList.append(TableName)\r
-    \r
+\r
     return TableList\r
 \r