1. Ignore depex section for SEC, PEI_CORE & DXE_CORE
authorqhuang8 <qhuang8@c2973edb-eda0-4c78-bc6a-9341b269661f>
Sun, 21 Feb 2010 09:27:58 +0000 (09:27 +0000)
committerqhuang8 <qhuang8@c2973edb-eda0-4c78-bc6a-9341b269661f>
Sun, 21 Feb 2010 09:27:58 +0000 (09:27 +0000)
2. Show (None) if an EDKII module INF does not have [depex] section, although it is the same as TRUE
3. Always add () for library depex for consistency.

git-svn-id: https://edk2-buildtools.svn.sourceforge.net/svnroot/edk2-buildtools/trunk/BaseTools@1879 c2973edb-eda0-4c78-bc6a-9341b269661f

Source/Python/build/BuildReport.py

index 9c690b7..adbc81e 100755 (executable)
@@ -248,6 +248,13 @@ class DepexReport(object):
     # @param M               Module context information
     #
     def __init__(self, M):
     # @param M               Module context information
     #
     def __init__(self, M):
+        self.Depex = ""
+        ModuleType = M.ModuleType
+        if not ModuleType:
+            ModuleType = gComponentType2ModuleType.get(M.ComponentType, "")
+        if ModuleType in ["SEC", "PEI_CORE", "DXE_CORE"]:
+            return
+      
         for Source in M.SourceFileList:
             if os.path.splitext(Source.Path)[1].lower() == ".dxs":
                 Match = gDxsDependencyPattern.search(open(Source.Path).read())
         for Source in M.SourceFileList:
             if os.path.splitext(Source.Path)[1].lower() == ".dxs":
                 Match = gDxsDependencyPattern.search(open(Source.Path).read())
@@ -259,15 +266,13 @@ class DepexReport(object):
             self.Depex = M.DepexExpressionList.get(M.ModuleType, "")
             self.ModuleDepex = " ".join(M.Module.DepexExpression[M.Arch, M.ModuleType])
             if not self.ModuleDepex:
             self.Depex = M.DepexExpressionList.get(M.ModuleType, "")
             self.ModuleDepex = " ".join(M.Module.DepexExpression[M.Arch, M.ModuleType])
             if not self.ModuleDepex:
-                self.ModuleDepex = "TRUE"
+                self.ModuleDepex = "(None)"
 
             LibDepexList = []
             for Lib in M.DependentLibraryList:
                 LibDepex = " ".join(Lib.DepexExpression[M.Arch, M.ModuleType]).strip()
                 if LibDepex != "":
 
             LibDepexList = []
             for Lib in M.DependentLibraryList:
                 LibDepex = " ".join(Lib.DepexExpression[M.Arch, M.ModuleType]).strip()
                 if LibDepex != "":
-                    if " " in LibDepex:
-                        LibDepex = "(" + LibDepex + ")"
-                    LibDepexList.append(LibDepex)
+                    LibDepexList.append("(" + LibDepex + ")")
             self.LibraryDepex = " AND ".join(LibDepexList)
             if not self.LibraryDepex:
                 self.LibraryDepex = "(None)"
             self.LibraryDepex = " AND ".join(LibDepexList)
             if not self.LibraryDepex:
                 self.LibraryDepex = "(None)"
@@ -282,6 +287,9 @@ class DepexReport(object):
     # @param File            The file object for report
     #
     def GenerateReport(self, File):
     # @param File            The file object for report
     #
     def GenerateReport(self, File):
+        if not self.Depex:
+            return
+                
         FileWrite(File, gSubSectionStart)
         FileWrite(File, "Dependency Expression (DEPEX) from %s" % self.Source)
 
         FileWrite(File, gSubSectionStart)
         FileWrite(File, "Dependency Expression (DEPEX) from %s" % self.Source)