BaseTools: Fix the problem using FILE_GUID override in .dsc
authorFeng, Bob C <bob.c.feng@intel.com>
Fri, 16 Nov 2018 02:12:15 +0000 (10:12 +0800)
committerLiming Gao <liming.gao@intel.com>
Tue, 20 Nov 2018 00:10:28 +0000 (08:10 +0800)
https://bugzilla.tianocore.org/show_bug.cgi?id=1330

This patch is going to fix the problem using FILE_GUID override in .dsc.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: BobCF <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/Python/GenFds/FdfParser.py

index 44cc8f6..2fbbad1 100644 (file)
@@ -24,7 +24,7 @@ from uuid import UUID
 \r
 from Common.BuildToolError import *\r
 from Common import EdkLogger\r
-from Common.Misc import PathClass, tdict\r
+from Common.Misc import PathClass, tdict, ProcessDuplicatedInf\r
 from Common.StringUtils import NormPath, ReplaceMacro\r
 from Common import GlobalData\r
 from Common.Expression import *\r
@@ -2416,8 +2416,12 @@ class FdfParser:
             if ErrorCode != 0:\r
                 EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)\r
 \r
-        if not ffsInf.InfFileName in self.Profile.InfList:\r
-            self.Profile.InfList.append(ffsInf.InfFileName)\r
+        NewFileName = ffsInf.InfFileName\r
+        if ffsInf.OverrideGuid:\r
+            NewFileName = ProcessDuplicatedInf(PathClass(ffsInf.InfFileName,GenFdsGlobalVariable.WorkSpaceDir), ffsInf.OverrideGuid, GenFdsGlobalVariable.WorkSpaceDir).Path\r
+\r
+        if not NewFileName in self.Profile.InfList:\r
+            self.Profile.InfList.append(NewFileName)\r
             FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)\r
             self.Profile.InfFileLineList.append(FileLineTuple)\r
             if ffsInf.UseArch:\r
@@ -4346,8 +4350,12 @@ class FdfParser:
             if ErrorCode != 0:\r
                 EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)\r
 \r
-        if not ffsInf.InfFileName in self.Profile.InfList:\r
-            self.Profile.InfList.append(ffsInf.InfFileName)\r
+        NewFileName = ffsInf.InfFileName\r
+        if ffsInf.OverrideGuid:\r
+            NewFileName = ProcessDuplicatedInf(PathClass(ffsInf.InfFileName,GenFdsGlobalVariable.WorkSpaceDir), ffsInf.OverrideGuid, GenFdsGlobalVariable.WorkSpaceDir).Path\r
+\r
+        if not NewFileName in self.Profile.InfList:\r
+            self.Profile.InfList.append(NewFileName)\r
             FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)\r
             self.Profile.InfFileLineList.append(FileLineTuple)\r
             if ffsInf.UseArch:\r