Enabled incrementals to patch + rename moved files
Change-Id: I551fc5291847e3ace15361c203d86f566c26da97
This commit is contained in:
@@ -184,6 +184,20 @@ 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))
|
||||
else:
|
||||
raise ValueError("Rename not supported by update binary")
|
||||
|
||||
def SkipNextActionIfTargetExists(self, tgtfile, tgtsha1):
|
||||
"""Prepend an action with an apply_patch_check in order to
|
||||
skip the action if the file exists. Used when a patch
|
||||
is later renamed."""
|
||||
cmd = ('sha1_check(read_file("%s"), %s) || ' % (tgtfile, tgtsha1))
|
||||
self.script.append(self._WordWrap(cmd))
|
||||
|
||||
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
|
||||
|
Reference in New Issue
Block a user