X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=IntelFsp2Pkg%2FTools%2FGenCfgOpt.py;fp=IntelFsp2Pkg%2FTools%2FGenCfgOpt.py;h=a0b8bba81e6ba46d7be799538329b9ce686a1d7d;hb=f95e80d832e923046c92cd6f0b8208cec147138e;hp=af7e14a10ad95c82fb99e4e01578bcbc632063df;hpb=7061294be500de021bef3d4bc5218134d223315f;p=mirror_edk2.git diff --git a/IntelFsp2Pkg/Tools/GenCfgOpt.py b/IntelFsp2Pkg/Tools/GenCfgOpt.py index af7e14a10a..a0b8bba81e 100644 --- a/IntelFsp2Pkg/Tools/GenCfgOpt.py +++ b/IntelFsp2Pkg/Tools/GenCfgOpt.py @@ -313,6 +313,7 @@ EndList self._DscFile = '' self._FvDir = '' self._MapVer = 0 + self._DscTime = 0 def ParseMacros (self, MacroDefStr): # ['-DABC=1', '-D', 'CFG_DEBUG=1', '-D', 'CFG_OUTDIR=Build'] @@ -423,6 +424,9 @@ EndList self._DscFile = DscFile self._FvDir = FvDir + # Initial DSC time is parent DSC time. + self._DscTime = os.path.getmtime(DscFile) + IsDefSect = False IsPcdSect = False IsUpdSect = False @@ -530,6 +534,12 @@ EndList if IncludeDsc == None: print("ERROR: Cannot open file '%s'" % IncludeFilePath) raise SystemExit + + # Update DscTime when newer DSC time found. + CurrentDscTime = os.path.getmtime(os.path.realpath(IncludeDsc.name)) + if CurrentDscTime > self._DscTime: + self._DscTime = CurrentDscTime + NewDscLines = IncludeDsc.readlines() IncludeDsc.close() DscLines = NewDscLines + DscLines @@ -815,9 +825,8 @@ EndList if not os.path.exists(OutPutFile): NoFileChange = False else: - DscTime = os.path.getmtime(self._DscFile) OutputTime = os.path.getmtime(OutPutFile) - if DscTime > OutputTime: + if self._DscTime > OutputTime: NoFileChange = False return NoFileChange