public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: BobCF <bob.c.feng@intel.com>
To: edk2-devel@lists.01.org
Cc: Bob Feng <bob.c.feng@intel.com>,
	Liming Gao <liming.gao@intel.com>,
	Yonghong Zhu <yonghong.zhu@intel.com>
Subject: [Patch] BaseTools: Remove a unused function.
Date: Tue, 10 Jul 2018 10:05:44 +0800	[thread overview]
Message-ID: <20180710020544.104832-1-bob.c.feng@intel.com> (raw)

the call statement of _CheckDuplicateInFV() was commented out
in 2014. There is no call statement of _CheckDuplicateInFV(),
so remove it.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
---
 BaseTools/Source/Python/AutoGen/AutoGen.py | 128 -----------------------------
 1 file changed, 128 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
index d100648606..57a4b4923f 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -617,13 +617,10 @@ class WorkspaceAutoGen(AutoGen):
         #
         # Check PCD type and definition between DSC and DEC
         #
         self._CheckPcdDefineAndType()
 
-#         if self.FdfFile:
-#             self._CheckDuplicateInFV(Fdf)
-
         #
         # Create BuildOptions Macro & PCD metafile, also add the Active Platform and FDF file.
         #
         content = 'gCommandLineDefines: '
         content += str(GlobalData.gCommandLineDefines)
@@ -759,135 +756,10 @@ class WorkspaceAutoGen(AutoGen):
             for filePath in self.BuildDatabase[self.MetaFile, Arch, Target, Toolchain]._RawData.IncludedFiles:
                 AllWorkSpaceMetaFiles.add(filePath.Path)
 
         return AllWorkSpaceMetaFiles
 
-    ## _CheckDuplicateInFV() method
-    #
-    # Check whether there is duplicate modules/files exist in FV section.
-    # The check base on the file GUID;
-    #
-    def _CheckDuplicateInFV(self, Fdf):
-        for Fv in Fdf.Profile.FvDict:
-            _GuidDict = {}
-            for FfsFile in Fdf.Profile.FvDict[Fv].FfsList:
-                if FfsFile.InfFileName and FfsFile.NameGuid is None:
-                    #
-                    # Get INF file GUID
-                    #
-                    InfFoundFlag = False
-                    for Pa in self.AutoGenObjectList:
-                        if InfFoundFlag:
-                            break
-                        for Module in Pa.ModuleAutoGenList:
-                            if path.normpath(Module.MetaFile.File) == path.normpath(FfsFile.InfFileName):
-                                InfFoundFlag = True
-                                if Module.Guid.upper() not in _GuidDict:
-                                    _GuidDict[Module.Guid.upper()] = FfsFile
-                                    break
-                                else:
-                                    EdkLogger.error("build",
-                                                    FORMAT_INVALID,
-                                                    "Duplicate GUID found for these lines: Line %d: %s and Line %d: %s. GUID: %s" % (FfsFile.CurrentLineNum,
-                                                                                                                                   FfsFile.CurrentLineContent,
-                                                                                                                                   _GuidDict[Module.Guid.upper()].CurrentLineNum,
-                                                                                                                                   _GuidDict[Module.Guid.upper()].CurrentLineContent,
-                                                                                                                                   Module.Guid.upper()),
-                                                    ExtraData=self.FdfFile)
-                    #
-                    # Some INF files not have entity in DSC file.
-                    #
-                    if not InfFoundFlag:
-                        if FfsFile.InfFileName.find('$') == -1:
-                            InfPath = NormPath(FfsFile.InfFileName)
-                            if not os.path.exists(InfPath):
-                                EdkLogger.error('build', GENFDS_ERROR, "Non-existant Module %s !" % (FfsFile.InfFileName))
-
-                            PathClassObj = PathClass(FfsFile.InfFileName, self.WorkspaceDir)
-                            #
-                            # Here we just need to get FILE_GUID from INF file, use 'COMMON' as ARCH attribute. and use
-                            # BuildObject from one of AutoGenObjectList is enough.
-                            #
-                            InfObj = self.AutoGenObjectList[0].BuildDatabase.WorkspaceDb.BuildObject[PathClassObj, TAB_ARCH_COMMON, self.BuildTarget, self.ToolChain]
-                            if InfObj.Guid.upper() not in _GuidDict:
-                                _GuidDict[InfObj.Guid.upper()] = FfsFile
-                            else:
-                                EdkLogger.error("build",
-                                                FORMAT_INVALID,
-                                                "Duplicate GUID found for these lines: Line %d: %s and Line %d: %s. GUID: %s" % (FfsFile.CurrentLineNum,
-                                                                                                                               FfsFile.CurrentLineContent,
-                                                                                                                               _GuidDict[InfObj.Guid.upper()].CurrentLineNum,
-                                                                                                                               _GuidDict[InfObj.Guid.upper()].CurrentLineContent,
-                                                                                                                               InfObj.Guid.upper()),
-                                                ExtraData=self.FdfFile)
-                        InfFoundFlag = False
-
-                if FfsFile.NameGuid is not None:
-                    #
-                    # If the NameGuid reference a PCD name.
-                    # The style must match: PCD(xxxx.yyy)
-                    #
-                    if gPCDAsGuidPattern.match(FfsFile.NameGuid):
-                        #
-                        # Replace the PCD value.
-                        #
-                        _PcdName = FfsFile.NameGuid.lstrip("PCD(").rstrip(")")
-                        PcdFoundFlag = False
-                        for Pa in self.AutoGenObjectList:
-                            if not PcdFoundFlag:
-                                for PcdItem in Pa.AllPcdList:
-                                    if (PcdItem.TokenSpaceGuidCName + "." + PcdItem.TokenCName) == _PcdName:
-                                        #
-                                        # First convert from CFormatGuid to GUID string
-                                        #
-                                        _PcdGuidString = GuidStructureStringToGuidString(PcdItem.DefaultValue)
-
-                                        if not _PcdGuidString:
-                                            #
-                                            # Then try Byte array.
-                                            #
-                                            _PcdGuidString = GuidStructureByteArrayToGuidString(PcdItem.DefaultValue)
-
-                                        if not _PcdGuidString:
-                                            #
-                                            # Not Byte array or CFormat GUID, raise error.
-                                            #
-                                            EdkLogger.error("build",
-                                                            FORMAT_INVALID,
-                                                            "The format of PCD value is incorrect. PCD: %s , Value: %s\n" % (_PcdName, PcdItem.DefaultValue),
-                                                            ExtraData=self.FdfFile)
-
-                                        if _PcdGuidString.upper() not in _GuidDict:
-                                            _GuidDict[_PcdGuidString.upper()] = FfsFile
-                                            PcdFoundFlag = True
-                                            break
-                                        else:
-                                            EdkLogger.error("build",
-                                                            FORMAT_INVALID,
-                                                            "Duplicate GUID found for these lines: Line %d: %s and Line %d: %s. GUID: %s" % (FfsFile.CurrentLineNum,
-                                                                                                                                           FfsFile.CurrentLineContent,
-                                                                                                                                           _GuidDict[_PcdGuidString.upper()].CurrentLineNum,
-                                                                                                                                           _GuidDict[_PcdGuidString.upper()].CurrentLineContent,
-                                                                                                                                           FfsFile.NameGuid.upper()),
-                                                            ExtraData=self.FdfFile)
-
-                    if FfsFile.NameGuid.upper() not in _GuidDict:
-                        _GuidDict[FfsFile.NameGuid.upper()] = FfsFile
-                    else:
-                        #
-                        # Two raw file GUID conflict.
-                        #
-                        EdkLogger.error("build",
-                                        FORMAT_INVALID,
-                                        "Duplicate GUID found for these lines: Line %d: %s and Line %d: %s. GUID: %s" % (FfsFile.CurrentLineNum,
-                                                                                                                       FfsFile.CurrentLineContent,
-                                                                                                                       _GuidDict[FfsFile.NameGuid.upper()].CurrentLineNum,
-                                                                                                                       _GuidDict[FfsFile.NameGuid.upper()].CurrentLineContent,
-                                                                                                                       FfsFile.NameGuid.upper()),
-                                        ExtraData=self.FdfFile)
-
-
     def _CheckPcdDefineAndType(self):
         PcdTypeSet = {TAB_PCDS_FIXED_AT_BUILD,
             TAB_PCDS_PATCHABLE_IN_MODULE,
             TAB_PCDS_FEATURE_FLAG,
             TAB_PCDS_DYNAMIC,
-- 
2.16.2.windows.1



                 reply	other threads:[~2018-07-10  2:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180710020544.104832-1-bob.c.feng@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox