AU: When applying delta locally, get source checksums
When applying a delta on the host, we need to calculate the original
checksums for the rootfs/kernel for the delta performer. This CL does
that.
Also:
- Log old/new checksums in performer
- Add base64 encode function to OmahaHashCalculator
BUG=8062
TEST=unittests; applied delta on host
Review URL: http://codereview.chromium.org/4042004
Change-Id: I953d7dd34cb65269e9b44e22c87a13a7f52e66d4
diff --git a/delta_diff_generator.cc b/delta_diff_generator.cc
index b447f11..03b59d9 100644
--- a/delta_diff_generator.cc
+++ b/delta_diff_generator.cc
@@ -611,9 +611,9 @@
return true;
}
-bool InitializePartitionInfo(bool is_kernel,
- const string& partition,
- PartitionInfo* info) {
+bool DeltaDiffGenerator::InitializePartitionInfo(bool is_kernel,
+ const string& partition,
+ PartitionInfo* info) {
int64_t size = 0;
if (is_kernel) {
size = utils::FileSize(partition);
@@ -641,25 +641,25 @@
const string& new_rootfs,
DeltaArchiveManifest* manifest) {
if (!old_kernel.empty()) {
- TEST_AND_RETURN_FALSE(
- InitializePartitionInfo(true,
- old_kernel,
- manifest->mutable_old_kernel_info()));
+ TEST_AND_RETURN_FALSE(DeltaDiffGenerator::InitializePartitionInfo(
+ true,
+ old_kernel,
+ manifest->mutable_old_kernel_info()));
}
- TEST_AND_RETURN_FALSE(
- InitializePartitionInfo(true,
- new_kernel,
- manifest->mutable_new_kernel_info()));
+ TEST_AND_RETURN_FALSE(DeltaDiffGenerator::InitializePartitionInfo(
+ true,
+ new_kernel,
+ manifest->mutable_new_kernel_info()));
if (!old_rootfs.empty()) {
- TEST_AND_RETURN_FALSE(
- InitializePartitionInfo(false,
- old_rootfs,
- manifest->mutable_old_rootfs_info()));
+ TEST_AND_RETURN_FALSE(DeltaDiffGenerator::InitializePartitionInfo(
+ false,
+ old_rootfs,
+ manifest->mutable_old_rootfs_info()));
}
- TEST_AND_RETURN_FALSE(
- InitializePartitionInfo(false,
- new_rootfs,
- manifest->mutable_new_rootfs_info()));
+ TEST_AND_RETURN_FALSE(DeltaDiffGenerator::InitializePartitionInfo(
+ false,
+ new_rootfs,
+ manifest->mutable_new_rootfs_info()));
return true;
}