summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2015-07-02 00:47:51 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-07-02 00:47:51 +0000
commit608d9d2452ba547875691f4df7ba313239177395 (patch)
tree8cafc90d2fd3e0961bdfd0450cbc0f4d8f7a6fa2 /tools
parente416a41f3ae1132c0eb53d78d3d6bc60f2f0d052 (diff)
parent1aa1af0e997699bc025e4f0a754692068328d7e6 (diff)
downloadbuild-608d9d2452ba547875691f4df7ba313239177395.zip
build-608d9d2452ba547875691f4df7ba313239177395.tar.gz
build-608d9d2452ba547875691f4df7ba313239177395.tar.bz2
am 1aa1af0e: sparse_img.py: Don\'t write empty map groups.
* commit '1aa1af0e997699bc025e4f0a754692068328d7e6': sparse_img.py: Don't write empty map groups.
Diffstat (limited to 'tools')
-rw-r--r--tools/releasetools/sparse_img.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/releasetools/sparse_img.py b/tools/releasetools/sparse_img.py
index c9e7e76..d2955c3 100644
--- a/tools/releasetools/sparse_img.py
+++ b/tools/releasetools/sparse_img.py
@@ -201,8 +201,12 @@ class SparseImage(object):
nonzero_blocks.append(b)
nonzero_blocks.append(b+1)
- out["__ZERO"] = RangeSet(data=zero_blocks)
- out["__NONZERO"] = RangeSet(data=nonzero_blocks)
+ assert zero_blocks or nonzero_blocks
+
+ if zero_blocks:
+ out["__ZERO"] = RangeSet(data=zero_blocks)
+ if nonzero_blocks:
+ out["__NONZERO"] = RangeSet(data=nonzero_blocks)
def ResetFileMap(self):
"""Throw away the file map and treat the entire image as