Implement REPLACE_XZ on the update_engine.
This patch introduces the REPLACE_XZ operation, very similar to
REPLACE_BZ but using the XzExtentWriter instead. Minor cleanup of the
growing list of operations included in this patch.
Bug: 23604708
Test: Added unittests.
Change-Id: Iefa9e2cda609fceab9311add16b7369cb88c98a2
diff --git a/payload_constants.cc b/payload_constants.cc
index aeddf11..b28461b 100644
--- a/payload_constants.cc
+++ b/payload_constants.cc
@@ -31,4 +31,28 @@
const char kDeltaMagic[] = "CrAU";
const char kBspatchPath[] = "bspatch";
+const char* InstallOperationTypeName(InstallOperation_Type op_type) {
+ switch (op_type) {
+ case InstallOperation::BSDIFF:
+ return "BSDIFF";
+ case InstallOperation::MOVE:
+ return "MOVE";
+ case InstallOperation::REPLACE:
+ return "REPLACE";
+ case InstallOperation::REPLACE_BZ:
+ return "REPLACE_BZ";
+ case InstallOperation::SOURCE_COPY:
+ return "SOURCE_COPY";
+ case InstallOperation::SOURCE_BSDIFF:
+ return "SOURCE_BSDIFF";
+ case InstallOperation::ZERO:
+ return "ZERO";
+ case InstallOperation::DISCARD:
+ return "DISCARD";
+ case InstallOperation::REPLACE_XZ:
+ return "REPLACE_XZ";
+ }
+ return "<unknown_op>";
+}
+
}; // namespace chromeos_update_engine