]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Ecc/MetaDataParser.py
BaseTools: Refactor python except statements
[mirror_edk2.git] / BaseTools / Source / Python / Ecc / MetaDataParser.py
index 98b16a0e5c4446ac694aa314d13b39558fb7eb62..82ede3eb330c93dff68c2ca9692f6f47fb0e2899 100644 (file)
@@ -14,6 +14,7 @@
 import Common.LongFilePathOs as os\r
 from CommonDataClass.DataClass import *\r
 from EccToolError import *\r
+from Common.MultipleWorkspace import MultipleWorkspace as mws\r
 import EccGlobalData\r
 import re\r
 ## Get the inlcude path list for a source file\r
@@ -33,8 +34,8 @@ def GetIncludeListOfFile(WorkSpace, Filepath, Db):
                 % (MODEL_META_DATA_PACKAGE, MODEL_EFI_SOURCE_FILE, '\\', Filepath)\r
     RecordSet = Db.TblFile.Exec(SqlCommand)\r
     for Record in RecordSet:\r
-        DecFullPath = os.path.normpath(os.path.join(WorkSpace, Record[0]))\r
-        InfFullPath = os.path.normpath(os.path.join(WorkSpace, Record[1]))\r
+        DecFullPath = os.path.normpath(mws.join(WorkSpace, Record[0]))\r
+        InfFullPath = os.path.normpath(mws.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
@@ -184,19 +185,26 @@ def ParseHeaderCommentSection(CommentList, FileName = None):
                     continue\r
                 License += Comment + EndOfLine\r
     \r
-    if not Copyright:\r
+    if not Copyright.strip():\r
         SqlStatement = """ select ID from File where FullPath like '%s'""" % FileName\r
         ResultSet = EccGlobalData.gDb.TblFile.Exec(SqlStatement)\r
         for Result in ResultSet:\r
             Msg = 'Header comment section must have copyright information'\r
             EccGlobalData.gDb.TblReport.Insert(ERROR_DOXYGEN_CHECK_FILE_HEADER, Msg, "File", Result[0])\r
 \r
-    if not License:\r
+    if not License.strip():\r
         SqlStatement = """ select ID from File where FullPath like '%s'""" % FileName\r
         ResultSet = EccGlobalData.gDb.TblFile.Exec(SqlStatement)\r
         for Result in ResultSet:\r
             Msg = 'Header comment section must have license information'\r
             EccGlobalData.gDb.TblReport.Insert(ERROR_DOXYGEN_CHECK_FILE_HEADER, Msg, "File", Result[0])\r
+                       \r
+    if not Abstract.strip() or Abstract.find('Component description file') > -1:\r
+        SqlStatement = """ select ID from File where FullPath like '%s'""" % FileName\r
+        ResultSet = EccGlobalData.gDb.TblFile.Exec(SqlStatement)\r
+        for Result in ResultSet:\r
+            Msg = 'Header comment section must have Abstract information.'\r
+            EccGlobalData.gDb.TblReport.Insert(ERROR_DOXYGEN_CHECK_FILE_HEADER, Msg, "File", Result[0])\r
                      \r
     return Abstract.strip(), Description.strip(), Copyright.strip(), License.strip()\r
 \r