-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update_engine: Remove dependency on libupdate_engine from the client.
The update_engine_client is a very small DBus client that only depends on a single utils:: function from the update_engine daemon codebase. Because of this, it was forced to be linked against many libraries that it didn't use. This patch factors out this glib helper function to a new glib_utils.{cc,h} file and includes only that in the update_engine_client binary. BUG=chromium:396440 TEST=FEATURES=test emerge-link update_engine Change-Id: Icf8d8b3c6ebd22cdb39e6674fb3d9071071ec941 Reviewed-on: https://chromium-review.googlesource.com/209472 Reviewed-by: David Zeuthen <[email protected]> Tested-by: Alex Deymo <[email protected]> Commit-Queue: Alex Vakulenko <[email protected]>
- Loading branch information
Showing
13 changed files
with
94 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright 2014 The Chromium OS Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "update_engine/glib_utils.h" | ||
|
||
#include <base/strings/stringprintf.h> | ||
|
||
using std::string; | ||
|
||
namespace chromeos_update_engine { | ||
namespace utils { | ||
|
||
string GetAndFreeGError(GError** error) { | ||
if (!*error) { | ||
return "Unknown GLib error."; | ||
} | ||
string message = | ||
base::StringPrintf("GError(%d): %s", | ||
(*error)->code, | ||
(*error)->message ? (*error)->message : "(unknown)"); | ||
g_error_free(*error); | ||
*error = NULL; | ||
return message; | ||
} | ||
|
||
} // namespace utils | ||
} // namespace chromeos_update_engine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright 2014 The Chromium OS Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef UPDATE_ENGINE_GLIB_UTILS_H_ | ||
#define UPDATE_ENGINE_GLIB_UTILS_H_ | ||
|
||
#include <string> | ||
|
||
#include <glib.h> | ||
|
||
namespace chromeos_update_engine { | ||
namespace utils { | ||
|
||
// Returns the error message, if any, from a GError pointer. Frees the GError | ||
// object and resets error to NULL. | ||
std::string GetAndFreeGError(GError** error); | ||
|
||
} // namespace utils | ||
} // namespace chromeos_update_engine | ||
|
||
#endif // UPDATE_ENGINE_GLIB_UTILS_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters