Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Unified Diff: delta_performer.cc

Issue 4042004: AU: When applying delta locally, get source checksums (Closed) Base URL: http://git.chromium.org/git/update_engine.git
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698