Reland: Pass apex_info.pb file to delta_generator
target_files contain META/apex_info.pb, which contains metadata about
compressed apexes. Extract this file from target_file.zip, and pass it
to delta_generator. delta_generator will then copy these data to
update_metadata
Test: generate an OTA, make sure a device running an older build can
install the OTA
Bug: 172911822
Change-Id: If0e185a32262a849d533c3316ffdf205cb6628b6
diff --git a/common/utils.cc b/common/utils.cc
index 3a89c2a..0f3b6c6 100644
--- a/common/utils.cc
+++ b/common/utils.cc
@@ -492,6 +492,11 @@
return lstat(path, &stbuf) == 0 && S_ISLNK(stbuf.st_mode) != 0;
}
+bool IsRegFile(const char* path) {
+ struct stat stbuf;
+ return lstat(path, &stbuf) == 0 && S_ISREG(stbuf.st_mode) != 0;
+}
+
bool MakeTempFile(const string& base_filename_template,
string* filename,
int* fd) {