platform_system_core/libziparchive
Elliott Hughes 4089d34b93 fastboot should fail if it runs out of space while unzipping.
Previously fastboot would carry on regardless if decompression failed:

  fastboot: archive does not contain 'vbmeta.img'
  fastboot: extracting vendor.img (260 MB)...
  fastboot: W/ziparchive(56777): Zip: unable to allocate  272781472 bytes at offset 0 : No space left on device
  fastboot: failed to extract 'vendor.img': I/O error
  fastboot: archive does not contain 'vendor_other.img'
  fastboot: wiping userdata...

This is because all but "boot" and "system" are considered "optional",
and the implementation of "optional" was "ignore any failures". What it
_should_ have meant was "it's okay if these don't exist, but if they do,
failures matter".

Fix this logic, use die() more aggressively, and remove spurious "\n"s
from die() format strings.

Also fix spurious whitespace in the libziparchive format string. Before:

  Zip: unable to allocate  272781472 bytes at offset 0 : No space left on device

After:

  Zip: unable to allocate 272781472 bytes at offset 0: No space left on device

Bug: http://b/68383022
Test: `fastboot update` on marlin
Change-Id: I3cbf55f1a33ca125f293f873eafbcfb86c880ba8
2017-10-27 14:21:12 -07:00
..
include/ziparchive libziparchive: Use ReadAtOffset exclusively 2017-07-25 18:12:12 +00:00
testdata Check filename memory bound when parsing ziparchive 2017-06-30 17:19:28 +09:00
.clang-format add a performance benchmark for libziparchive 2017-05-30 10:50:14 -07:00
Android.bp Rename libz-host -> libz 2017-09-27 16:24:45 -07:00
entry_name_utils-inl.h Ran clang-format on libziparchive sources and headers 2017-07-02 11:46:53 +09:00
entry_name_utils_test.cc Ran clang-format on libziparchive sources and headers 2017-07-02 11:46:53 +09:00
unzip.cpp Add libziparchive-based unzip. 2017-06-04 11:53:48 -07:00
zip_archive.cc fastboot should fail if it runs out of space while unzipping. 2017-10-27 14:21:12 -07:00
zip_archive_benchmark.cpp add a performance benchmark for libziparchive 2017-05-30 10:50:14 -07:00
zip_archive_common.h Ran clang-format on libziparchive sources and headers 2017-07-02 11:46:53 +09:00
zip_archive_private.h libziparchive: Use ReadAtOffset exclusively 2017-07-25 18:12:12 +00:00
zip_archive_stream_entry.cc libziparchive: Use ReadAtOffset exclusively 2017-07-25 18:12:12 +00:00
zip_archive_test.cc Ran clang-format on libziparchive sources and headers 2017-07-02 11:46:53 +09:00
zip_writer.cc Ran clang-format on libziparchive sources and headers 2017-07-02 11:46:53 +09:00
zip_writer_test.cc Ran clang-format on libziparchive sources and headers 2017-07-02 11:46:53 +09:00