| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include <gflags/gflags.h> | 7 #include <gflags/gflags.h> |
| 8 #include <glib.h> | 8 #include <glib.h> |
| 9 | 9 |
| 10 #include "update_engine/marshal.glibmarshal.h" | 10 #include "update_engine/marshal.glibmarshal.h" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 GError* error = NULL; | 182 GError* error = NULL; |
| 183 | 183 |
| 184 CHECK(GetProxy(&proxy)); | 184 CHECK(GetProxy(&proxy)); |
| 185 | 185 |
| 186 gboolean rc = | 186 gboolean rc = |
| 187 org_chromium_UpdateEngineInterface_set_track(proxy, | 187 org_chromium_UpdateEngineInterface_set_track(proxy, |
| 188 track.c_str(), | 188 track.c_str(), |
| 189 &error); | 189 &error); |
| 190 CHECK_EQ(rc, true) << "Error setting the track: " | 190 CHECK_EQ(rc, true) << "Error setting the track: " |
| 191 << GetGErrorMessage(error); | 191 << GetGErrorMessage(error); |
| 192 LOG(INFO) << "TODO: Track permanently set to: " << track; | 192 LOG(INFO) << "Track permanently set to: " << track; |
| 193 } | 193 } |
| 194 | 194 |
| 195 static gboolean CompleteUpdateSource(gpointer data) { | 195 static gboolean CompleteUpdateSource(gpointer data) { |
| 196 string current_op; | 196 string current_op; |
| 197 if (!GetStatus(¤t_op) || current_op == "UPDATE_STATUS_IDLE") { | 197 if (!GetStatus(¤t_op) || current_op == "UPDATE_STATUS_IDLE") { |
| 198 LOG(ERROR) << "Update failed."; | 198 LOG(ERROR) << "Update failed."; |
| 199 exit(1); | 199 exit(1); |
| 200 } | 200 } |
| 201 if (current_op == "UPDATE_STATUS_UPDATED_NEED_REBOOT") { | 201 if (current_op == "UPDATE_STATUS_UPDATED_NEED_REBOOT") { |
| 202 LOG(INFO) << "Update succeeded -- reboot needed."; | 202 LOG(INFO) << "Update succeeded -- reboot needed."; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 | 273 |
| 274 if (FLAGS_reboot) { | 274 if (FLAGS_reboot) { |
| 275 LOG(INFO) << "Requesting a reboot..."; | 275 LOG(INFO) << "Requesting a reboot..."; |
| 276 CHECK(RebootIfNeeded()); | 276 CHECK(RebootIfNeeded()); |
| 277 return 0; | 277 return 0; |
| 278 } | 278 } |
| 279 | 279 |
| 280 LOG(INFO) << "Done."; | 280 LOG(INFO) << "Done."; |
| 281 return 0; | 281 return 0; |
| 282 } | 282 } |
| OLD | NEW |