OLD | NEW |
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_DIFF_GENERATOR_H__ | 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_DIFF_GENERATOR_H__ |
6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_DIFF_GENERATOR_H__ | 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_DIFF_GENERATOR_H__ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 const std::vector<CutEdgeVertexes>& cuts); | 206 const std::vector<CutEdgeVertexes>& cuts); |
207 | 207 |
208 // Returns true if |op| is a no-op operation that doesn't do any useful work | 208 // Returns true if |op| is a no-op operation that doesn't do any useful work |
209 // (e.g., a move operation that copies blocks onto themselves). | 209 // (e.g., a move operation that copies blocks onto themselves). |
210 static bool IsNoopOperation(const DeltaArchiveManifest_InstallOperation& op); | 210 static bool IsNoopOperation(const DeltaArchiveManifest_InstallOperation& op); |
211 | 211 |
212 static bool InitializePartitionInfo(bool is_kernel, | 212 static bool InitializePartitionInfo(bool is_kernel, |
213 const std::string& partition, | 213 const std::string& partition, |
214 PartitionInfo* info); | 214 PartitionInfo* info); |
215 | 215 |
| 216 // Runs the bsdiff tool on two files and returns the resulting delta in |
| 217 // |out|. Returns true on success. |
| 218 static bool BsdiffFiles(const std::string& old_file, |
| 219 const std::string& new_file, |
| 220 std::vector<char>* out); |
| 221 |
| 222 // The |blocks| vector contains a reader and writer for each block on the |
| 223 // filesystem that's being in-place updated. We populate the reader/writer |
| 224 // fields of |blocks| by calling this function. |
| 225 // For each block in |operation| that is read or written, find that block |
| 226 // in |blocks| and set the reader/writer field to the vertex passed. |
| 227 // |graph| is not strictly necessary, but useful for printing out |
| 228 // error messages. |
| 229 static bool AddInstallOpToBlocksVector( |
| 230 const DeltaArchiveManifest_InstallOperation& operation, |
| 231 const Graph& graph, |
| 232 Vertex::Index vertex, |
| 233 std::vector<DeltaDiffGenerator::Block>* blocks); |
| 234 |
216 private: | 235 private: |
217 // This should never be constructed | 236 // This should never be constructed |
218 DISALLOW_IMPLICIT_CONSTRUCTORS(DeltaDiffGenerator); | 237 DISALLOW_IMPLICIT_CONSTRUCTORS(DeltaDiffGenerator); |
219 }; | 238 }; |
220 | 239 |
221 extern const char* const kBsdiffPath; | 240 extern const char* const kBsdiffPath; |
222 extern const char* const kBspatchPath; | 241 extern const char* const kBspatchPath; |
223 extern const char* const kDeltaMagic; | 242 extern const char* const kDeltaMagic; |
224 | 243 |
225 }; // namespace chromeos_update_engine | 244 }; // namespace chromeos_update_engine |
226 | 245 |
227 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_DIFF_GENERATOR_H__ | 246 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_DIFF_GENERATOR_H__ |
OLD | NEW |