|
From: <lg...@us...> - 2010-04-19 06:38:41
|
Revision: 1953
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=1953&view=rev
Author: lgao4
Date: 2010-04-19 06:38:34 +0000 (Mon, 19 Apr 2010)
Log Message:
-----------
Update the output file (System map file and GUID XREF file) only when the file content is changed.
Modified Paths:
--------------
trunk/BaseTools/Source/Python/GenFds/GenFds.py
trunk/BaseTools/Source/Python/build/build.py
Modified: trunk/BaseTools/Source/Python/GenFds/GenFds.py
===================================================================
--- trunk/BaseTools/Source/Python/GenFds/GenFds.py 2010-04-16 05:30:08 UTC (rev 1952)
+++ trunk/BaseTools/Source/Python/GenFds/GenFds.py 2010-04-19 06:38:34 UTC (rev 1953)
@@ -35,6 +35,7 @@
from Common import EdkLogger
from Common.String import *
from Common.Misc import DirCache,PathClass
+from Common.Misc import SaveFileOnChange
## Version and Copyright
versionNumber = "1.0"
@@ -486,14 +487,15 @@
def GenerateGuidXRefFile(BuildDb, ArchList):
GuidXRefFileName = os.path.join(GenFdsGlobalVariable.FvDir, "Guid.xref")
- GuidXRefFile = open(GuidXRefFileName, "w+")
+ GuidXRefFile = StringIO.StringIO('')
for Arch in ArchList:
PlatformDataBase = BuildDb.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch]
for ModuleFile in PlatformDataBase.Modules:
Module = BuildDb.BuildObject[ModuleFile, Arch]
GuidXRefFile.write("%s %s\n" % (Module.Guid, Module.BaseName))
+ SaveFileOnChange(GuidXRefFileName, GuidXRefFile.getvalue(), False)
GuidXRefFile.close()
- GenFdsGlobalVariable.InfLogger("\nGUID cross reference file saved to %s" % GuidXRefFileName)
+ GenFdsGlobalVariable.InfLogger("\nGUID cross reference file can be found at %s" % GuidXRefFileName)
##Define GenFd as static function
GenFd = staticmethod(GenFd)
Modified: trunk/BaseTools/Source/Python/build/build.py
===================================================================
--- trunk/BaseTools/Source/Python/build/build.py 2010-04-16 05:30:08 UTC (rev 1952)
+++ trunk/BaseTools/Source/Python/build/build.py 2010-04-19 06:38:34 UTC (rev 1953)
@@ -1289,12 +1289,10 @@
#
# Save address map into MAP file.
#
- MapFile = open(MapFilePath, "wb")
- MapFile.write(MapBuffer.getvalue())
- MapFile.close()
- MapBuffer.close()
+ SaveFileOnChange(MapFilePath, MapBuffer.getvalue(), False)
+ MapBuffer.close()
if self.LoadFixAddress != 0:
- sys.stdout.write ("\nLoad Module At Fix Address Map file saved to %s\n" %(MapFilePath))
+ sys.stdout.write ("\nLoad Module At Fix Address Map file can be found at %s\n" %(MapFilePath))
sys.stdout.flush()
## Build active platform for different build targets and different tool chains
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|