[gnome-software] Don't hardcode packagekit for Fedora upgrades
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Don't hardcode packagekit for Fedora upgrades
- Date: Thu, 5 Jul 2018 11:52:01 +0000 (UTC)
commit 3db3e5527926f55e682e4d246b8b5921b844bcff
Author: Kalev Lember <klember redhat com>
Date: Thu Jul 5 09:28:34 2018 +0200
Don't hardcode packagekit for Fedora upgrades
Instead adapt the upgrade GsApp in packagekit-upgrade and rpm-ostree
plugins, so that depending on which one is active either one can handle
the upgrade.
.../fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c | 1 -
plugins/packagekit/gs-plugin-packagekit-upgrade.c | 7 +++++++
plugins/rpm-ostree/gs-plugin-rpm-ostree.c | 4 ++++
3 files changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c
b/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c
index fc644ad4..9b8e59dc 100644
--- a/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c
+++ b/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c
@@ -317,7 +317,6 @@ _create_upgrade_from_info (GsPlugin *plugin, PkgdbItem *item)
gs_app_add_quirk (app, AS_APP_QUIRK_PROVENANCE);
gs_app_add_quirk (app, AS_APP_QUIRK_NOT_REVIEWABLE);
gs_app_add_icon (app, ic);
- gs_app_set_management_plugin (app, "packagekit");
/* show a Fedora magazine article for the release */
url = g_strdup_printf ("https://fedoramagazine.org/whats-new-fedora-%u-workstation",
diff --git a/plugins/packagekit/gs-plugin-packagekit-upgrade.c
b/plugins/packagekit/gs-plugin-packagekit-upgrade.c
index f1379a44..fc6f5bde 100644
--- a/plugins/packagekit/gs-plugin-packagekit-upgrade.c
+++ b/plugins/packagekit/gs-plugin-packagekit-upgrade.c
@@ -49,6 +49,13 @@ gs_plugin_destroy (GsPlugin *plugin)
g_object_unref (priv->task);
}
+void
+gs_plugin_adopt_app (GsPlugin *plugin, GsApp *app)
+{
+ if (gs_app_get_kind (app) == AS_APP_KIND_OS_UPGRADE)
+ gs_app_set_management_plugin (app, "packagekit");
+}
+
static void
gs_plugin_packagekit_upgrade_progress_cb (PkProgress *progress,
PkProgressType type,
diff --git a/plugins/rpm-ostree/gs-plugin-rpm-ostree.c b/plugins/rpm-ostree/gs-plugin-rpm-ostree.c
index 206d967b..24acbb0f 100644
--- a/plugins/rpm-ostree/gs-plugin-rpm-ostree.c
+++ b/plugins/rpm-ostree/gs-plugin-rpm-ostree.c
@@ -175,6 +175,10 @@ gs_plugin_adopt_app (GsPlugin *plugin, GsApp *app)
gs_app_get_scope (app) == AS_APP_SCOPE_SYSTEM) {
gs_app_set_management_plugin (app, gs_plugin_get_name (plugin));
}
+
+ if (gs_app_get_kind (app) == AS_APP_KIND_OS_UPGRADE) {
+ gs_app_set_management_plugin (app, gs_plugin_get_name (plugin));
+ }
}
typedef struct {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]