OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium 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_INSTALL_PLAN_H__ | 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_INSTALL_PLAN_H__ |
6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_INSTALL_PLAN_H__ | 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_INSTALL_PLAN_H__ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include "chromeos/obsolete_logging.h" | 9 #include "chromeos/obsolete_logging.h" |
10 | 10 |
11 // InstallPlan is a simple struct that contains relevant info for many | 11 // InstallPlan is a simple struct that contains relevant info for many |
12 // parts of the update system about the install that should happen. | 12 // parts of the update system about the install that should happen. |
13 | 13 |
14 namespace chromeos_update_engine { | 14 namespace chromeos_update_engine { |
15 | 15 |
16 struct InstallPlan { | 16 struct InstallPlan { |
17 InstallPlan(bool is_full, | 17 InstallPlan(bool is_full, |
18 const std::string& url, | 18 const std::string& url, |
19 const std::string& hash, | 19 const std::string& hash, |
20 const std::string& install_path) | 20 const std::string& install_path, |
| 21 const std::string& kernel_install_path) |
21 : is_full_update(is_full), | 22 : is_full_update(is_full), |
22 download_url(url), | 23 download_url(url), |
23 download_hash(hash), | 24 download_hash(hash), |
24 install_path(install_path) {} | 25 install_path(install_path), |
| 26 kernel_install_path(kernel_install_path) {} |
25 InstallPlan() : is_full_update(false) {} | 27 InstallPlan() : is_full_update(false) {} |
26 | 28 |
27 bool is_full_update; | 29 bool is_full_update; |
28 std::string download_url; // url to download from | 30 std::string download_url; // url to download from |
29 std::string download_hash; // hash of the data at the url | 31 std::string download_hash; // hash of the data at the url |
30 std::string install_path; // path to install device | 32 std::string install_path; // path to install device |
| 33 std::string kernel_install_path; // path to kernel install device |
31 | 34 |
32 bool operator==(const InstallPlan& that) const { | 35 bool operator==(const InstallPlan& that) const { |
33 return (is_full_update == that.is_full_update) && | 36 return (is_full_update == that.is_full_update) && |
34 (download_url == that.download_url) && | 37 (download_url == that.download_url) && |
35 (download_hash == that.download_hash) && | 38 (download_hash == that.download_hash) && |
36 (install_path == that.install_path); | 39 (install_path == that.install_path) && |
| 40 (kernel_install_path == that.kernel_install_path); |
37 } | 41 } |
38 bool operator!=(const InstallPlan& that) const { | 42 bool operator!=(const InstallPlan& that) const { |
39 return !((*this) == that); | 43 return !((*this) == that); |
40 } | 44 } |
41 void Dump() const { | 45 void Dump() const { |
42 LOG(INFO) << "InstallPlan: " | 46 LOG(INFO) << "InstallPlan: " |
43 << (is_full_update ? "full_update" : "delta_update") | 47 << (is_full_update ? "full_update" : "delta_update") |
44 << ", url: " << download_url << ", hash: " << download_hash | 48 << ", url: " << download_url << ", hash: " << download_hash |
45 << ", install_path: " << install_path; | 49 << ", install_path: " << install_path |
| 50 << ", kernel_install_path: " << kernel_install_path; |
46 } | 51 } |
47 }; | 52 }; |
48 | 53 |
49 } // namespace chromeos_update_engine | 54 } // namespace chromeos_update_engine |
50 | 55 |
51 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_INSTALL_PLAN_H__ | 56 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_INSTALL_PLAN_H__ |
OLD | NEW |