From a7316ce094d4635fa027a99840714af8e579184b Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Sun, 5 Mar 2017 17:43:33 +0000 Subject: [PATCH] Revert "releasetools: Use pattern filter when unzipping." This reverts commit aa3a04f19de6b888be7f58d5e8cf37fe2725e949. Reason for revert: Some AOSP targets don't include RADIO/ in the TF.zip. We may possibly skip unzipping RADIO/, or by always creating a dummy RADIO folder in TF.zip. Revert this CL for now. Change-Id: I8e90d322706a4fe82129bdfab5ffa1eab989c648 --- tools/releasetools/check_target_files_signatures.py | 2 +- tools/releasetools/common.py | 2 +- tools/releasetools/ota_from_target_files.py | 8 ++------ 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/tools/releasetools/check_target_files_signatures.py b/tools/releasetools/check_target_files_signatures.py index f9aa4fa8bc..3048488d30 100755 --- a/tools/releasetools/check_target_files_signatures.py +++ b/tools/releasetools/check_target_files_signatures.py @@ -235,7 +235,7 @@ class TargetFiles(object): self.certmap = None def LoadZipFile(self, filename): - d, z = common.UnzipTemp(filename, ['*.apk']) + d, z = common.UnzipTemp(filename, '*.apk') try: self.apks = {} self.apks_by_basename = {} diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py index 1b474cac21..b57c1b533a 100644 --- a/tools/releasetools/common.py +++ b/tools/releasetools/common.py @@ -564,7 +564,7 @@ def UnzipTemp(filename, pattern=None): def unzip_to_dir(filename, dirname): cmd = ["unzip", "-o", "-q", filename, "-d", dirname] if pattern is not None: - cmd.extend(pattern) + cmd.append(pattern) p = Run(cmd, stdout=subprocess.PIPE) p.communicate() if p.returncode != 0: diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py index 56f9be9961..be01a6d341 100755 --- a/tools/releasetools/ota_from_target_files.py +++ b/tools/releasetools/ota_from_target_files.py @@ -184,8 +184,6 @@ OPTIONS.payload_signer = None OPTIONS.payload_signer_args = [] METADATA_NAME = 'META-INF/com/android/metadata' -UNZIP_PATTERN = ['IMAGES/*', 'META/*', 'RADIO/*'] - def MostPopularKey(d, default): """Given a dict, return the key corresponding to the largest @@ -2216,8 +2214,7 @@ def main(argv): OPTIONS.extra_script = open(OPTIONS.extra_script).read() print("unzipping target target-files...") - OPTIONS.input_tmp, input_zip = common.UnzipTemp( - args[0], UNZIP_PATTERN if OPTIONS.block_based else None) + OPTIONS.input_tmp, input_zip = common.UnzipTemp(args[0]) OPTIONS.target_tmp = OPTIONS.input_tmp OPTIONS.info_dict = common.LoadInfoDict(input_zip, OPTIONS.target_tmp) @@ -2285,8 +2282,7 @@ def main(argv): else: print("unzipping source target-files...") OPTIONS.source_tmp, source_zip = common.UnzipTemp( - OPTIONS.incremental_source, - UNZIP_PATTERN if OPTIONS.block_based else None) + OPTIONS.incremental_source) OPTIONS.target_info_dict = OPTIONS.info_dict OPTIONS.source_info_dict = common.LoadInfoDict(source_zip, OPTIONS.source_tmp)