From 1bb3b651b14c9cec5cf0104a1dec1550b9c22983 Mon Sep 17 00:00:00 2001 From: Samuel Huang Date: Wed, 21 Mar 2018 18:54:03 +0000 Subject: [Zucchini] Add "-keep" flag; remove redundnat CRC32 check. By defaulti, Zucchini deletes the output (patch or patched "new") file upon failure. The "-keep" debug flag overrides this behavior, so the bad output file can be examined. This CL adds the flag for Zucchini-gen and Zucchini-apply. This CL also removes a duplicated call to Ensemble::CheckOldFile(), which checks the CRC32 of the "old" file. This removal prevents redundant work and slightly speed up Zucchini-apply (by ~5%). Bug: 729154 Change-Id: I9ba8e9b00b7783661de06b39fae010761bedc6e6 Reviewed-on: https://chromium-review.googlesource.com/973746 Reviewed-by: agrieve Commit-Queue: Samuel Huang Cr-Commit-Position: refs/heads/master@{#544786} NOKEYCHECK=True GitOrigin-RevId: 21879c3adbfbbf676e5ee28b9f0a19e60d104d80 --- main_utils.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'main_utils.cc') diff --git a/main_utils.cc b/main_utils.cc index 3a7055a..7a28388 100644 --- a/main_utils.cc +++ b/main_utils.cc @@ -63,8 +63,10 @@ struct Command { /******** List of Zucchini commands ********/ constexpr Command kCommands[] = { - {"gen", "-gen [-raw]", 3, &MainGen}, - {"apply", "-apply ", 3, &MainApply}, + {"gen", "-gen [-raw] [-keep]", 3, + &MainGen}, + {"apply", "-apply [-keep]", 3, + &MainApply}, {"read", "-read [-dump]", 1, &MainRead}, {"detect", "-detect [-dd=format#]", 1, &MainDetect}, {"match", "-match ", 2, &MainMatch}, -- cgit v1.2.3