Enable incremental builder to find files that moved, and

try to process them via patch + rename, instead of
delete + add.

b/11437930

Change-Id: Ie70632a2fa0a13d4bb259f61c620bb01812494e5
This commit is contained in:
Michael Runge
2013-11-06 17:59:29 -08:00
parent 241dbd1565
commit 37335b4238
3 changed files with 60 additions and 5 deletions

View File

@@ -184,6 +184,11 @@ class EdifyGenerator(object):
cmd = "delete(" + ",\0".join(['"%s"' % (i,) for i in file_list]) + ");"
self.script.append(self._WordWrap(cmd))
def RenameFile(self, srcfile, tgtfile):
"""Moves a file from one location to another."""
if self.info.get("update_rename_support", False):
self.script.append('rename("%s", "%s");' % (srcfile, tgtfile))
def ApplyPatch(self, srcfile, tgtfile, tgtsize, tgtsha1, *patchpairs):
"""Apply binary patches (in *patchpairs) to the given srcfile to
produce tgtfile (which may be "-" to indicate overwriting the