summaryrefslogtreecommitdiffstats
path: root/applypatch/applypatch.c
diff options
context:
space:
mode:
authorDoug Zongker <dougz@google.com>2012-08-21 00:50:19 +0200
committerAndroid Git Automerger <android-git-automerger@android.com>2012-08-21 00:50:19 +0200
commit13a29ea9688fd6169d69f506d5028a49038c5434 (patch)
tree5f2a722ebb6f9c7d58da206c04e077a7685c646c /applypatch/applypatch.c
parentam 55850258: am 3733d218: Merge changes I664f8dc7,I4154db06,I5e1df90f (diff)
parentadd bonus data feature to imgdiff/imgpatch/applypatch (diff)
downloadandroid_bootable_recovery-13a29ea9688fd6169d69f506d5028a49038c5434.tar
android_bootable_recovery-13a29ea9688fd6169d69f506d5028a49038c5434.tar.gz
android_bootable_recovery-13a29ea9688fd6169d69f506d5028a49038c5434.tar.bz2
android_bootable_recovery-13a29ea9688fd6169d69f506d5028a49038c5434.tar.lz
android_bootable_recovery-13a29ea9688fd6169d69f506d5028a49038c5434.tar.xz
android_bootable_recovery-13a29ea9688fd6169d69f506d5028a49038c5434.tar.zst
android_bootable_recovery-13a29ea9688fd6169d69f506d5028a49038c5434.zip
Diffstat (limited to 'applypatch/applypatch.c')
-rw-r--r--applypatch/applypatch.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/applypatch/applypatch.c b/applypatch/applypatch.c
index 488fd8c6f..7b8a010e3 100644
--- a/applypatch/applypatch.c
+++ b/applypatch/applypatch.c
@@ -39,7 +39,8 @@ static int GenerateTarget(FileContents* source_file,
const char* source_filename,
const char* target_filename,
const uint8_t target_sha1[SHA_DIGEST_SIZE],
- size_t target_size);
+ size_t target_size,
+ const Value* bonus_data);
static int mtd_partitions_scanned = 0;
@@ -617,7 +618,8 @@ int applypatch(const char* source_filename,
size_t target_size,
int num_patches,
char** const patch_sha1_str,
- Value** patch_data) {
+ Value** patch_data,
+ Value* bonus_data) {
printf("\napplying patch to %s\n", source_filename);
if (target_filename[0] == '-' &&
@@ -699,7 +701,7 @@ int applypatch(const char* source_filename,
int result = GenerateTarget(&source_file, source_patch_value,
&copy_file, copy_patch_value,
source_filename, target_filename,
- target_sha1, target_size);
+ target_sha1, target_size, bonus_data);
free(source_file.data);
free(copy_file.data);
@@ -713,7 +715,8 @@ static int GenerateTarget(FileContents* source_file,
const char* source_filename,
const char* target_filename,
const uint8_t target_sha1[SHA_DIGEST_SIZE],
- size_t target_size) {
+ size_t target_size,
+ const Value* bonus_data) {
int retry = 1;
SHA_CTX ctx;
int output;
@@ -867,7 +870,7 @@ static int GenerateTarget(FileContents* source_file,
} else if (header_bytes_read >= 8 &&
memcmp(header, "IMGDIFF2", 8) == 0) {
result = ApplyImagePatch(source_to_use->data, source_to_use->size,
- patch, sink, token, &ctx);
+ patch, sink, token, &ctx, bonus_data);
} else {
printf("Unknown patch file format\n");
return 1;