am 00e1f003: Merge "Check partition hash before resorting to block_image_verify"

* commit '00e1f0033eede8f23ff72097c98b7fd70a4e349d':
  Check partition hash before resorting to block_image_verify
This commit is contained in:
Sami Tolvanen 2015-04-25 08:07:04 +00:00 committed by Android Git Automerger
commit d21d1d273b
1 changed files with 6 additions and 3 deletions

View File

@ -1140,10 +1140,13 @@ class BlockDifference(object):
script.Print("Image %s will be patched unconditionally." % (partition,))
else:
if self.version >= 3:
script.AppendExtra(('if block_image_verify("%s", '
script.AppendExtra(('if (range_sha1("%s", "%s") == "%s" || '
'block_image_verify("%s", '
'package_extract_file("%s.transfer.list"), '
'"%s.new.dat", "%s.patch.dat") then') %
(self.device, partition, partition, partition))
'"%s.new.dat", "%s.patch.dat")) then') % (
self.device, self.src.care_map.to_string_raw(),
self.src.TotalSha1(),
self.device, partition, partition, partition))
else:
script.AppendExtra('if range_sha1("%s", "%s") == "%s" then' % (
self.device, self.src.care_map.to_string_raw(),