aboutsummaryrefslogtreecommitdiffstats
path: root/edify
diff options
context:
space:
mode:
authorDoug Zongker2010-02-22 16:46:32 -0600
committerDoug Zongker2010-02-22 17:30:33 -0600
commitc4351c791052ad529a4e83c600b1aa6e6420ea86 (patch)
treecdc534868eb58ea980bcca2fbc8e04b68fd9936c /edify
parent583fc12c3dbe09e3a9b759b9466c505b006e6a39 (diff)
downloadplatform-bootable-recovery-c4351c791052ad529a4e83c600b1aa6e6420ea86.tar.gz
platform-bootable-recovery-c4351c791052ad529a4e83c600b1aa6e6420ea86.tar.xz
platform-bootable-recovery-c4351c791052ad529a4e83c600b1aa6e6420ea86.zip
refactor applypatch and friends
Change the applypatch function to take meaningful arguments instead of argc and argv. Move all the parsing of arguments into main.c (for the standalone binary) and into install.c (for the updater function). applypatch() takes patches as Value objects, so we can pass in blobs extracted from the package without ever writing them to temp files. The patching code is changed to read the patch from memory instead of a file. A bunch of compiler warnings (mostly about signed vs unsigned types) are fixed. Support for the IMGDIFF1 format is dropped. (We've been generating IMGDIFF2 packages for some time now.) Change-Id: I217563c500012750f27110db821928a06211323f
Diffstat (limited to 'edify')
-rw-r--r--edify/main.c3
-rw-r--r--edify/yydefs.h2
2 files changed, 4 insertions, 1 deletions
diff --git a/edify/main.c b/edify/main.c
index a2b74ad9..85570438 100644
--- a/edify/main.c
+++ b/edify/main.c
@@ -42,11 +42,12 @@ int expect(const char* expr_str, const char* expected, int* errors) {
42 42
43 State state; 43 State state;
44 state.cookie = NULL; 44 state.cookie = NULL;
45 state.script = expr_str; 45 state.script = strdup(expr_str);
46 state.errmsg = NULL; 46 state.errmsg = NULL;
47 47
48 result = Evaluate(&state, e); 48 result = Evaluate(&state, e);
49 free(state.errmsg); 49 free(state.errmsg);
50 free(state.script);
50 if (result == NULL && expected != NULL) { 51 if (result == NULL && expected != NULL) {
51 fprintf(stderr, "error evaluating \"%s\"\n", expr_str); 52 fprintf(stderr, "error evaluating \"%s\"\n", expr_str);
52 ++*errors; 53 ++*errors;
diff --git a/edify/yydefs.h b/edify/yydefs.h
index 62578625..aca398fb 100644
--- a/edify/yydefs.h
+++ b/edify/yydefs.h
@@ -33,4 +33,6 @@ typedef struct {
33 } \ 33 } \
34 } while (0) 34 } while (0)
35 35
36int yylex();
37
36#endif 38#endif