diff options
author | Doug Zongker <dougz@android.com> | 2010-02-22 15:41:53 -0800 |
---|---|---|
committer | Doug Zongker <dougz@android.com> | 2010-02-22 15:41:53 -0800 |
commit | c8d446bcde877ec94f8e68dd5af68fe34eb1b1f9 (patch) | |
tree | 5dc97330dcdce5fed9c6d7666e5949aed031c28b /tools/releasetools/edify_generator.py | |
parent | 1af09dea7c5d25c806935975da1697af52b5af57 (diff) | |
download | build-c8d446bcde877ec94f8e68dd5af68fe34eb1b1f9.zip build-c8d446bcde877ec94f8e68dd5af68fe34eb1b1f9.tar.gz build-c8d446bcde877ec94f8e68dd5af68fe34eb1b1f9.tar.bz2 |
pass blobs to applypatch in incremental OTAs
applypatch now takes patches as blob-valued arguments instead of just
filenames, eliminating the need to unpack all patches to /tmp before
starting to apply them.
Revert the last change I made where sha1_check(read_file(...)) was
substituted for apply_patch_check(...). apply_patch_check() knows to
check /cache/saved.file if the original source file is missing or has
a bad checksum, which is important if the device loses power or
otherwise restarts during patching.
Change-Id: Ia5b761474b0f809a5a5eed29455b1b145145699e
Diffstat (limited to 'tools/releasetools/edify_generator.py')
-rw-r--r-- | tools/releasetools/edify_generator.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/releasetools/edify_generator.py b/tools/releasetools/edify_generator.py index 900bad1..68b0850 100644 --- a/tools/releasetools/edify_generator.py +++ b/tools/releasetools/edify_generator.py @@ -112,6 +112,14 @@ class EdifyGenerator(object): def PatchCheck(self, filename, *sha1): """Check that the given file (or MTD reference) has one of the + given *sha1 hashes, checking the version saved in cache if the + file does not match.""" + self.script.append('assert(apply_patch_check("%s"' % (filename,) + + "".join([', "%s"' % (i,) for i in sha1]) + + '));') + + def FileCheck(self, filename, *sha1): + """Check that the given file (or MTD reference) has one of the given *sha1 hashes.""" self.script.append('assert(sha1_check(read_file("%s")' % (filename,) + "".join([', "%s"' % (i,) for i in sha1]) + @@ -164,7 +172,7 @@ class EdifyGenerator(object): cmd = ['apply_patch("%s",\0"%s",\0%s,\0%d' % (srcfile, tgtfile, tgtsha1, tgtsize)] for i in range(0, len(patchpairs), 2): - cmd.append(',\0"%s:%s"' % patchpairs[i:i+2]) + cmd.append(',\0%s, package_extract_file("%s")' % patchpairs[i:i+2]) cmd.append(');') cmd = "".join(cmd) self.script.append(self._WordWrap(cmd)) |