diff options
author | Amin Hassani <ahassani@chromium.org> | 2018-03-29 11:39:48 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-04-02 20:12:56 -0700 |
commit | afaaa035ede59ad21e69105de68bd12a32dbd739 (patch) | |
tree | 3402b567fb1c912a08794f97e6196cf7b5dfbfcc /payload_generator/deflate_utils.cc | |
parent | 04df23ae35c562a5c29ca45bea3ec5c029fefe8e (diff) |
update_engine: puffdiff .zvoice files
.zvoice files in speech_synthesis are large zip files. Start using puffin on
them to reduce the payload size whenever they change.
BUG=none
TEST=unittests
TEST=brillo_update_payload
Change-Id: Ib8ec31af831e44aa6bec3c024235728bd2d6aec5
Reviewed-on: https://chromium-review.googlesource.com/986736
Commit-Ready: Amin Hassani <ahassani@chromium.org>
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Nicolas Norvez <norvez@chromium.org>
Diffstat (limited to 'payload_generator/deflate_utils.cc')
-rw-r--r-- | payload_generator/deflate_utils.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/payload_generator/deflate_utils.cc b/payload_generator/deflate_utils.cc index e3311427..2719048c 100644 --- a/payload_generator/deflate_utils.cc +++ b/payload_generator/deflate_utils.cc @@ -287,12 +287,16 @@ bool PreprocessParitionFiles(const PartitionConfig& part, } // Search for deflates if the file is in zip format. + // .zvoice files may eventually move out of rootfs. If that happens, remove + // ".zvoice" (crbug.com/782918). + const string zip_file_extensions[] = {".apk", ".zip", ".jar", ".zvoice"}; bool is_zip = - base::EndsWith( - file.name, ".apk", base::CompareCase::INSENSITIVE_ASCII) || - base::EndsWith( - file.name, ".zip", base::CompareCase::INSENSITIVE_ASCII) || - base::EndsWith(file.name, ".jar", base::CompareCase::INSENSITIVE_ASCII); + any_of(zip_file_extensions, + std::end(zip_file_extensions), + [&file](const string& ext) { + return base::EndsWith( + file.name, ext, base::CompareCase::INSENSITIVE_ASCII); + }); if (is_zip && extract_deflates) { brillo::Blob data; |