Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: omaha_request_prep_action.cc

Issue 2827032: AU: Send board (e.g. x86-generic) to update server in query. (Closed) Base URL: ssh://git@chromiumos-git/update_engine.git
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | omaha_request_prep_action_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "update_engine/omaha_request_prep_action.h" 5 #include "update_engine/omaha_request_prep_action.h"
6 #include <sys/utsname.h> 6 #include <sys/utsname.h>
7 #include <errno.h> 7 #include <errno.h>
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 18 matching lines...) Expand all
29 void OmahaRequestPrepAction::PerformAction() { 29 void OmahaRequestPrepAction::PerformAction() {
30 // TODO(adlr): honor force_full_update_ 30 // TODO(adlr): honor force_full_update_
31 ScopedActionCompleter completer(processor_, this); 31 ScopedActionCompleter completer(processor_, this);
32 string machine_id; 32 string machine_id;
33 TEST_AND_RETURN(GetMachineId(&machine_id)); 33 TEST_AND_RETURN(GetMachineId(&machine_id));
34 const string version(GetLsbValue("CHROMEOS_RELEASE_VERSION", "")); 34 const string version(GetLsbValue("CHROMEOS_RELEASE_VERSION", ""));
35 const string sp(version + "_" + GetMachineType()); 35 const string sp(version + "_" + GetMachineType());
36 const string track(GetLsbValue("CHROMEOS_RELEASE_TRACK", "")); 36 const string track(GetLsbValue("CHROMEOS_RELEASE_TRACK", ""));
37 const string update_url(GetLsbValue("CHROMEOS_AUSERVER", 37 const string update_url(GetLsbValue("CHROMEOS_AUSERVER",
38 UpdateCheckParams::kUpdateUrl)); 38 UpdateCheckParams::kUpdateUrl));
39 const string board(GetLsbValue("CHROMEOS_RELEASE_BOARD", ""));
39 40
40 UpdateCheckParams out(machine_id, // machine_id 41 UpdateCheckParams out(machine_id, // machine_id
41 machine_id, // user_id (use machine_id) 42 machine_id, // user_id (use machine_id)
42 UpdateCheckParams::kOsPlatform, 43 UpdateCheckParams::kOsPlatform,
43 UpdateCheckParams::kOsVersion, 44 UpdateCheckParams::kOsVersion,
44 sp, // e.g. 0.2.3.3_i686 45 sp, // e.g. 0.2.3.3_i686
46 board, // e.g. x86-generic
45 UpdateCheckParams::kAppId, 47 UpdateCheckParams::kAppId,
46 version, // app version (from lsb-release) 48 version, // app version (from lsb-release)
47 "en-US", // lang 49 "en-US", // lang
48 track, // track 50 track, // track
49 update_url); 51 update_url);
50 52
51 CHECK(HasOutputPipe()); 53 CHECK(HasOutputPipe());
52 SetOutputObject(out); 54 SetOutputObject(out);
53 completer.set_success(true); 55 completer.set_success(true);
54 } 56 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 118
117 string OmahaRequestPrepAction::GetMachineType() const { 119 string OmahaRequestPrepAction::GetMachineType() const {
118 struct utsname buf; 120 struct utsname buf;
119 string ret; 121 string ret;
120 if (uname(&buf) == 0) 122 if (uname(&buf) == 0)
121 ret = buf.machine; 123 ret = buf.machine;
122 return ret; 124 return ret;
123 } 125 }
124 126
125 } // namespace chromeos_update_engine 127 } // namespace chromeos_update_engine
OLDNEW
« no previous file with comments | « no previous file | omaha_request_prep_action_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698