]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Ecc/MetaDataParser.py
BaseTools: Fix a bug for FixedPcd value generation in AutoGen file
[mirror_edk2.git] / BaseTools / Source / Python / Ecc / MetaDataParser.py
index bbafa00dddd127e0660c40d824a830d97afe87f3..82ede3eb330c93dff68c2ca9692f6f47fb0e2899 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to define common parser functions for meta-data\r
 #\r
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 #\r
 \r
-import os\r
+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