summaryrefslogtreecommitdiffstats
path: root/updater/update_simulator_main.cpp
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2019-05-22 22:59:57 +0200
committerTianjie Xu <xunchang@google.com>2019-06-01 02:55:36 +0200
commit74b0f7cce0cb52d0095d461edfd5731f4d45157f (patch)
tree0c797713cb244044d5b063336456ee0d9b99ce30 /updater/update_simulator_main.cpp
parentMerge "Disable building simulator for mac" (diff)
downloadandroid_bootable_recovery-74b0f7cce0cb52d0095d461edfd5731f4d45157f.tar
android_bootable_recovery-74b0f7cce0cb52d0095d461edfd5731f4d45157f.tar.gz
android_bootable_recovery-74b0f7cce0cb52d0095d461edfd5731f4d45157f.tar.bz2
android_bootable_recovery-74b0f7cce0cb52d0095d461edfd5731f4d45157f.tar.lz
android_bootable_recovery-74b0f7cce0cb52d0095d461edfd5731f4d45157f.tar.xz
android_bootable_recovery-74b0f7cce0cb52d0095d461edfd5731f4d45157f.tar.zst
android_bootable_recovery-74b0f7cce0cb52d0095d461edfd5731f4d45157f.zip
Diffstat (limited to '')
-rw-r--r--updater/update_simulator_main.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/updater/update_simulator_main.cpp b/updater/update_simulator_main.cpp
index d10453c2f..94924e783 100644
--- a/updater/update_simulator_main.cpp
+++ b/updater/update_simulator_main.cpp
@@ -22,9 +22,10 @@
#include "otautil/error_code.h"
#include "otautil/paths.h"
#include "updater/blockimg.h"
+#include "updater/build_info.h"
+#include "updater/dynamic_partitions.h"
#include "updater/install.h"
#include "updater/simulator_runtime.h"
-#include "updater/target_files.h"
#include "updater/updater.h"
int main(int argc, char** argv) {
@@ -34,7 +35,7 @@ int main(int argc, char** argv) {
if (argc != 3 && argc != 4) {
LOG(ERROR) << "unexpected number of arguments: " << argc << std::endl
<< "Usage: " << argv[0] << " <source_target-file> <ota_package>";
- return 1;
+ return EXIT_FAILURE;
}
// TODO(xunchang) implement a commandline parser, e.g. it can take an oem property so that the
@@ -57,17 +58,21 @@ int main(int argc, char** argv) {
Paths::Get().set_stash_directory_base(temp_stash_base.path);
TemporaryFile cmd_pipe;
-
TemporaryDir source_temp_dir;
- TargetFiles source(source_target_file, source_temp_dir.path);
- Updater updater(std::make_unique<SimulatorRuntime>(&source));
+ BuildInfo source_build_info(source_temp_dir.path);
+ if (!source_build_info.ParseTargetFile(source_target_file, false)) {
+ LOG(ERROR) << "Failed to parse the target file " << source_target_file;
+ return EXIT_FAILURE;
+ }
+
+ Updater updater(std::make_unique<SimulatorRuntime>(&source_build_info));
if (!updater.Init(cmd_pipe.release(), package_name, false)) {
- return 1;
+ return EXIT_FAILURE;
}
if (!updater.RunUpdate()) {
- return 1;
+ return EXIT_FAILURE;
}
LOG(INFO) << "\nscript succeeded, result: " << updater.GetResult();