| 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 #include "update_engine/omaha_response_handler_action.h" | 5 #include "update_engine/omaha_response_handler_action.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include <base/logging.h> | 9 #include <base/logging.h> |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 LOG(INFO) << "There are no updates. Aborting."; | 25 LOG(INFO) << "There are no updates. Aborting."; |
| 26 return; | 26 return; |
| 27 } | 27 } |
| 28 install_plan_.download_url = response.codebase; | 28 install_plan_.download_url = response.codebase; |
| 29 install_plan_.size = response.size; | 29 install_plan_.size = response.size; |
| 30 install_plan_.download_hash = response.hash; | 30 install_plan_.download_hash = response.hash; |
| 31 | 31 |
| 32 install_plan_.is_resume = | 32 install_plan_.is_resume = |
| 33 DeltaPerformer::CanResumeUpdate(prefs_, response.hash); | 33 DeltaPerformer::CanResumeUpdate(prefs_, response.hash); |
| 34 if (!install_plan_.is_resume) { | 34 if (!install_plan_.is_resume) { |
| 35 LOG_IF(WARNING, !DeltaPerformer::ResetUpdateProgress(prefs_)) | 35 LOG_IF(WARNING, !DeltaPerformer::ResetUpdateProgress(prefs_, false)) |
| 36 << "Unable to reset the update progress."; | 36 << "Unable to reset the update progress."; |
| 37 LOG_IF(WARNING, !prefs_->SetString(kPrefsUpdateCheckResponseHash, | 37 LOG_IF(WARNING, !prefs_->SetString(kPrefsUpdateCheckResponseHash, |
| 38 response.hash)) | 38 response.hash)) |
| 39 << "Unable to save the update check response hash."; | 39 << "Unable to save the update check response hash."; |
| 40 } | 40 } |
| 41 | 41 |
| 42 TEST_AND_RETURN(GetInstallDev( | 42 TEST_AND_RETURN(GetInstallDev( |
| 43 (!boot_device_.empty() ? boot_device_ : utils::BootDevice()), | 43 (!boot_device_.empty() ? boot_device_ : utils::BootDevice()), |
| 44 &install_plan_.install_path)); | 44 &install_plan_.install_path)); |
| 45 install_plan_.kernel_install_path = | 45 install_plan_.kernel_install_path = |
| (...skipping 16 matching lines...) Expand all Loading... |
| 62 string ret(boot_dev); | 62 string ret(boot_dev); |
| 63 string::reverse_iterator it = ret.rbegin(); // last character in string | 63 string::reverse_iterator it = ret.rbegin(); // last character in string |
| 64 // Right now, we just switch '3' and '5' partition numbers. | 64 // Right now, we just switch '3' and '5' partition numbers. |
| 65 TEST_AND_RETURN_FALSE((*it == '3') || (*it == '5')); | 65 TEST_AND_RETURN_FALSE((*it == '3') || (*it == '5')); |
| 66 *it = (*it == '3') ? '5' : '3'; | 66 *it = (*it == '3') ? '5' : '3'; |
| 67 *install_dev = ret; | 67 *install_dev = ret; |
| 68 return true; | 68 return true; |
| 69 } | 69 } |
| 70 | 70 |
| 71 } // namespace chromeos_update_engine | 71 } // namespace chromeos_update_engine |
| OLD | NEW |