From ebe39a096a1c8c618f0bc34e1a5c1ab4f8d1ee44 Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Thu, 14 Jan 2016 14:12:26 -0800 Subject: [PATCH] Fix print error of numbers of blocks The total number of blocks to pack as new data was printed incorrectly. Fix printing. Change-Id: I6a6bb8dd6682d9c57943ceb1a728995f9529e2fd --- tools/releasetools/blockimgdiff.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/releasetools/blockimgdiff.py b/tools/releasetools/blockimgdiff.py index cef0c6ff4..1d338eebc 100644 --- a/tools/releasetools/blockimgdiff.py +++ b/tools/releasetools/blockimgdiff.py @@ -613,12 +613,15 @@ class BlockImageDiff(object): def_cmd = stashes[idx][1] assert (idx, sr) in def_cmd.stash_before def_cmd.stash_before.remove((idx, sr)) - new_blocks += sr.size() + # Add up blocks that violates space limit and print total number to + # screen later. + new_blocks += cmd.tgt_ranges.size() cmd.ConvertToNew() - print(" Total %d blocks are packed as new blocks due to insufficient " - "cache size." % (new_blocks,)) + num_of_bytes = new_blocks * self.tgt.blocksize + print(" Total %d blocks (%d bytes) are packed as new blocks due to " + "insufficient cache size." % (new_blocks, num_of_bytes)) def ComputePatches(self, prefix): print("Reticulating splines...")