Index: delta_performer.cc |
diff --git a/delta_performer.cc b/delta_performer.cc |
index 134316e0e63c0007e12ed8d1b05a64bbd579303c..0f2e1104267c1447bba41af221c9cdf3f820151b 100644 |
--- a/delta_performer.cc |
+++ b/delta_performer.cc |
@@ -165,6 +165,30 @@ int DeltaPerformer::Close() { |
return -err; |
} |
+namespace { |
+void LogPartitionInfoHash(const PartitionInfo& info, const string& tag) { |
+ string sha256; |
+ if (OmahaHashCalculator::Base64Encode(info.hash().data(), |
+ info.hash().size(), |
+ &sha256)) { |
+ LOG(INFO) << "PartitionInfo " << tag << " sha256:" << sha256 |
+ << " length:" << tag.size(); |
+ } else { |
+ LOG(ERROR) << "Base64Encode failed for tag: " << tag; |
+ } |
+} |
+void LogPartitionInfo(const DeltaArchiveManifest& manifest) { |
petkov
2010/10/22 20:15:16
add blank line before
adlr
2010/10/22 20:40:18
Done.
|
+ if (manifest.has_old_kernel_info()) |
+ LogPartitionInfoHash(manifest.old_kernel_info(), "old_kernel_info"); |
+ if (manifest.has_old_rootfs_info()) |
+ LogPartitionInfoHash(manifest.old_rootfs_info(), "old_rootfs_info"); |
+ if (manifest.has_new_kernel_info()) |
+ LogPartitionInfoHash(manifest.new_kernel_info(), "new_kernel_info"); |
+ if (manifest.has_new_rootfs_info()) |
+ LogPartitionInfoHash(manifest.new_rootfs_info(), "new_rootfs_info"); |
+} |
+} // namespace {} |
+ |
// Wrapper around write. Returns bytes written on success or |
// -errno on error. |
// This function performs as many actions as it can, given the amount of |
@@ -207,6 +231,7 @@ ssize_t DeltaPerformer::Write(const void* bytes, size_t count) { |
manifest_metadata_size_)) |
<< "Unable to save the manifest metadata size."; |
manifest_valid_ = true; |
+ LogPartitionInfo(manifest_); |
if (!PrimeUpdateState()) { |
LOG(ERROR) << "Unable to prime the update state."; |
return -EINVAL; |