[gnome-software/wip/temp/ubuntu-xenial-rebased: 237/326] Do a full upgrade only if we have system updates
- From: Iain Lane <iainl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/temp/ubuntu-xenial-rebased: 237/326] Do a full upgrade only if we have system updates
- Date: Fri, 29 Apr 2016 10:07:16 +0000 (UTC)
commit 3853977d683ce1fafbfec3a72c632fa43685360f
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 bce74d0..bcefcfa 100644
--- a/src/plugins/gs-plugin-apt.cc
+++ b/src/plugins/gs-plugin-apt.cc
@@ -1028,19 +1028,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]