summaryrefslogtreecommitdiffstats
path: root/updater/updater.c
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2009-06-15 06:12:26 +0200
committerThe Android Open Source Project <initial-contribution@android.com>2009-06-15 06:12:26 +0200
commit84cbfb6cb4a82824a662137282c689f40057b28b (patch)
tree30b5d33a047b5ae2eb86f53fa16de49d47486b1f /updater/updater.c
parentam 8edb00c9: edify extensions for OTA package installation, part 2 (diff)
parentfixes to edify and updater script (diff)
downloadandroid_bootable_recovery-84cbfb6cb4a82824a662137282c689f40057b28b.tar
android_bootable_recovery-84cbfb6cb4a82824a662137282c689f40057b28b.tar.gz
android_bootable_recovery-84cbfb6cb4a82824a662137282c689f40057b28b.tar.bz2
android_bootable_recovery-84cbfb6cb4a82824a662137282c689f40057b28b.tar.lz
android_bootable_recovery-84cbfb6cb4a82824a662137282c689f40057b28b.tar.xz
android_bootable_recovery-84cbfb6cb4a82824a662137282c689f40057b28b.tar.zst
android_bootable_recovery-84cbfb6cb4a82824a662137282c689f40057b28b.zip
Diffstat (limited to 'updater/updater.c')
-rw-r--r--updater/updater.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/updater/updater.c b/updater/updater.c
index 09776256b..5a2ed2ccf 100644
--- a/updater/updater.c
+++ b/updater/updater.c
@@ -94,12 +94,26 @@ int main(int argc, char** argv) {
updater_info.cmd_pipe = cmd_pipe;
updater_info.package_zip = &za;
- char* result = Evaluate(&updater_info, root);
+ State state;
+ state.cookie = &updater_info;
+ state.script = script;
+ state.errmsg = NULL;
+
+ char* result = Evaluate(&state, root);
if (result == NULL) {
- const char* errmsg = GetError();
- fprintf(stderr, "script aborted with error: %s\n",
- errmsg == NULL ? "(none)" : errmsg);
- ClearError();
+ if (state.errmsg == NULL) {
+ fprintf(stderr, "script aborted (no error message)\n");
+ fprintf(cmd_pipe, "ui_print script aborted (no error message)\n");
+ } else {
+ fprintf(stderr, "script aborted: %s\n", state.errmsg);
+ char* line = strtok(state.errmsg, "\n");
+ while (line) {
+ fprintf(cmd_pipe, "ui_print %s\n", line);
+ line = strtok(NULL, "\n");
+ }
+ fprintf(cmd_pipe, "ui_print\n");
+ }
+ free(state.errmsg);
return 7;
} else {
fprintf(stderr, "script result was [%s]\n", result);
@@ -107,6 +121,7 @@ int main(int argc, char** argv) {
}
mzCloseZipArchive(&za);
+ free(script);
return 0;
}