diff options
author | Tao Bao <tbao@google.com> | 2018-03-07 21:40:24 -0800 |
---|---|---|
committer | Tao Bao <tbao@google.com> | 2018-03-07 21:45:40 -0800 |
commit | c63626b4a31d202f304e56f22f6d66b00f61f60c (patch) | |
tree | 7d4d1ac6db2b7e444ff8c7461bd43d180bb493ab | |
parent | f99efebc75443238127f147865f7c4f01c9203b8 (diff) | |
download | build-c63626b4a31d202f304e56f22f6d66b00f61f60c.tar.gz |
releasetools: Fix the broken validate_target_files.py.
The file was broken due to earlier touches:
- Missing 'import zipfile';
- Mismatching arguments when calling GetSparseImage().
Bug: 73996151
Test: Run validate_target_files.py with a walleye-target_files.zip.
Test: pylint --rcfile=pylintrc validate_target_files.py
Change-Id: I3692bd51fb27a3da698e06b75155e84502549f66
-rwxr-xr-x | tools/releasetools/validate_target_files.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/releasetools/validate_target_files.py b/tools/releasetools/validate_target_files.py index f417129626..db1ba2eb65 100755 --- a/tools/releasetools/validate_target_files.py +++ b/tools/releasetools/validate_target_files.py @@ -27,6 +27,7 @@ import logging import os.path import re import sys +import zipfile import common @@ -61,7 +62,10 @@ def ValidateFileConsistency(input_zip, input_tmp): def CheckAllFiles(which): logging.info('Checking %s image.', which) - image = common.GetSparseImage(which, input_tmp, input_zip) + # Allow having shared blocks when loading the sparse image, because allowing + # that doesn't affect the checks below (we will have all the blocks on file, + # unless it's skipped due to the holes). + image = common.GetSparseImage(which, input_tmp, input_zip, True) prefix = '/' + which for entry in image.file_map: # Skip entries like '__NONZERO-0'. |