[gnome-software/wip/iainl/ubuntu-xenial] Do a full upgrade only if we have system updates
- From: William Hua <williamhua src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/iainl/ubuntu-xenial] Do a full upgrade only if we have system updates
- Date: Thu, 14 Apr 2016 19:42:11 +0000 (UTC)
commit 00bf5e1ec62449af35ab962a7067eb753f673a22
Author: William Hua <william hua canonical com>
Date: Thu Apr 14 15:41:38 2016 -0400
Do a full upgrade only if we have system updates
src/plugins/gs-plugin-apt.cc | 27 +++++++++++++++++++--------
1 files changed, 19 insertions(+), 8 deletions(-)
---
diff --git a/src/plugins/gs-plugin-apt.cc b/src/plugins/gs-plugin-apt.cc
index 528f624..416b4cb 100644
--- a/src/plugins/gs-plugin-apt.cc
+++ b/src/plugins/gs-plugin-apt.cc
@@ -1038,19 +1038,30 @@ gs_plugin_update (GsPlugin *plugin,
GCancellable *cancellable,
GError **error)
{
- set_list_state (apps, AS_APP_STATE_INSTALLING);
+ GList *i;
+ GsApp *app_i;
- if (aptd_transaction (plugin, "UpgradeSystem", NULL, apps, g_variant_new_parsed ("(true,)"), error)) {
- set_list_state (apps, AS_APP_STATE_INSTALLED);
+ for (i = apps; i != NULL; i = i->next) {
+ app_i = GS_APP (i->data);
- unload_apt_db (plugin);
+ if (g_strcmp0 (gs_app_get_id (app_i), "os-update.virtual") == 0) {
+ set_list_state (apps, AS_APP_STATE_INSTALLING);
- return TRUE;
- } else {
- set_list_state (apps, AS_APP_STATE_UPDATABLE_LIVE);
+ if (aptd_transaction (plugin, "UpgradeSystem", NULL, apps, g_variant_new_parsed
("(true,)"), error)) {
+ set_list_state (apps, AS_APP_STATE_INSTALLED);
- return FALSE;
+ unload_apt_db (plugin);
+
+ return TRUE;
+ } else {
+ set_list_state (apps, AS_APP_STATE_UPDATABLE_LIVE);
+
+ return FALSE;
+ }
+ }
}
+
+ return TRUE;
}
gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]