change incremental OTA file install order
(Cherry-pick from donut.)
Delete the old recovery-from-boot patch before patching system files,
then install the new one at the end of the process. Also fix an issue
with applypatch returning the wrong status.
Change-Id: I614fce39f307eded696ba792912b863f9fb0580b
diff --git a/tools/applypatch/applypatch.c b/tools/applypatch/applypatch.c
index e69a2fb..9b0c915 100644
--- a/tools/applypatch/applypatch.c
+++ b/tools/applypatch/applypatch.c
@@ -839,7 +839,7 @@
if (result != 0) {
if (retry == 0) {
printf("applying patch failed\n");
- return result;
+ return result != 0;
} else {
printf("applying patch failed; retrying\n");
}