!1 package init

Merge pull request !1 from wang_yue111/master
This commit is contained in:
openeuler-ci-bot 2020-07-15 17:05:32 +08:00 committed by Gitee
commit 0a8b9115d1
5 changed files with 704 additions and 0 deletions

View File

@ -0,0 +1,123 @@
From ece9a68becd6441d238f23acd2a1b156243fa7b6 Mon Sep 17 00:00:00 2001
From: Kalev Lember <klember@redhat.com>
Date: Tue, 7 May 2019 08:22:53 +0200
Subject: [PATCH] packagekit: Fix progress marshalling for upgrade_download and
refresh
The new GsPackageKitHelper class introduced in mega-commit 37103e6 only
handled progress marshalling when downloading a list of packages, but
not when the PK transaction is one big monolithic operation that only
has a single GsApp associated, such as when downloading all of the
distro upgrades, or when refreshing the cache.
This commit adds a way to explicitly add a GsApp to GsPackageKitHelper
to use for marshalling progress in these cases.
---
plugins/packagekit/gs-packagekit-helper.c | 13 ++++++++++++-
plugins/packagekit/gs-packagekit-helper.h | 3 +++
plugins/packagekit/gs-plugin-packagekit-refresh.c | 2 +-
plugins/packagekit/gs-plugin-packagekit-upgrade.c | 2 +-
4 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/plugins/packagekit/gs-packagekit-helper.c b/plugins/packagekit/gs-packagekit-helper.c
index a292e0068..39c026c3e 100644
--- a/plugins/packagekit/gs-packagekit-helper.c
+++ b/plugins/packagekit/gs-packagekit-helper.c
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
* Copyright (C) 2016-2018 Richard Hughes <richard@hughsie.com>
+ * Copyright (C) 2019 Kalev Lember <klember@redhat.com>
*
* Licensed under the GNU General Public License Version 2
*
@@ -29,6 +30,7 @@
struct _GsPackagekitHelper {
GObject parent_instance;
GHashTable *apps;
+ GsApp *progress_app;
GsPlugin *plugin;
};
@@ -43,7 +45,9 @@ gs_packagekit_helper_cb (PkProgress *progress, PkProgressType type, gpointer use
GsApp *app = NULL;
/* optional */
- if (package_id != NULL)
+ if (self->progress_app != NULL)
+ app = self->progress_app;
+ else if (package_id != NULL)
app = gs_packagekit_helper_get_app_by_id (self, package_id);
if (type == PK_PROGRESS_TYPE_STATUS) {
@@ -79,6 +83,12 @@ gs_packagekit_helper_add_app (GsPackagekitHelper *self, GsApp *app)
}
}
+void
+gs_packagekit_helper_set_progress_app (GsPackagekitHelper *self, GsApp *progress_app)
+{
+ g_set_object (&self->progress_app, progress_app);
+}
+
GsPlugin *
gs_packagekit_helper_get_plugin (GsPackagekitHelper *self)
{
@@ -104,6 +114,7 @@ gs_packagekit_helper_finalize (GObject *object)
self = GS_PACKAGEKIT_HELPER (object);
g_object_unref (self->plugin);
+ g_clear_object (&self->progress_app);
g_hash_table_unref (self->apps);
G_OBJECT_CLASS (gs_packagekit_helper_parent_class)->finalize (object);
diff --git a/plugins/packagekit/gs-packagekit-helper.h b/plugins/packagekit/gs-packagekit-helper.h
index 3b5263c0a..b18b8229b 100644
--- a/plugins/packagekit/gs-packagekit-helper.h
+++ b/plugins/packagekit/gs-packagekit-helper.h
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
* Copyright (C) 2016-2018 Richard Hughes <richard@hughsie.com>
+ * Copyright (C) 2019 Kalev Lember <klember@redhat.com>
*
* Licensed under the GNU General Public License Version 2
*
@@ -36,6 +37,8 @@ GsPackagekitHelper *gs_packagekit_helper_new (GsPlugin *plugin);
GsPlugin *gs_packagekit_helper_get_plugin (GsPackagekitHelper *self);
void gs_packagekit_helper_add_app (GsPackagekitHelper *self,
GsApp *app);
+void gs_packagekit_helper_set_progress_app (GsPackagekitHelper *self,
+ GsApp *progress_app);
GsApp *gs_packagekit_helper_get_app_by_id (GsPackagekitHelper *progress,
const gchar *package_id);
void gs_packagekit_helper_cb (PkProgress *progress,
diff --git a/plugins/packagekit/gs-plugin-packagekit-refresh.c b/plugins/packagekit/gs-plugin-packagekit-refresh.c
index ff893daaf..a8093de2c 100644
--- a/plugins/packagekit/gs-plugin-packagekit-refresh.c
+++ b/plugins/packagekit/gs-plugin-packagekit-refresh.c
@@ -156,7 +156,7 @@ gs_plugin_refresh (GsPlugin *plugin,
/* refresh the metadata */
gs_plugin_status_update (plugin, NULL, GS_PLUGIN_STATUS_WAITING);
- gs_packagekit_helper_add_app (helper, app_dl);
+ gs_packagekit_helper_set_progress_app (helper, app_dl);
results = pk_client_refresh_cache (PK_CLIENT (priv->task),
FALSE /* force */,
cancellable,
diff --git a/plugins/packagekit/gs-plugin-packagekit-upgrade.c b/plugins/packagekit/gs-plugin-packagekit-upgrade.c
index 63175bec3..38de93d55 100644
--- a/plugins/packagekit/gs-plugin-packagekit-upgrade.c
+++ b/plugins/packagekit/gs-plugin-packagekit-upgrade.c
@@ -77,7 +77,7 @@ gs_plugin_app_upgrade_download (GsPlugin *plugin,
/* ask PK to download enough packages to upgrade the system */
gs_app_set_state (app, AS_APP_STATE_INSTALLING);
- gs_packagekit_helper_add_app (helper, app);
+ gs_packagekit_helper_set_progress_app (helper, app);
results = pk_task_upgrade_system_sync (priv->task,
gs_app_get_version (app),
PK_UPGRADE_KIND_ENUM_COMPLETE,
--
2.21.0

View File

@ -0,0 +1,473 @@
From 0a1e76d866379ce6115aacd2cdee75db15bebab0 Mon Sep 17 00:00:00 2001
From: Kalev Lember <klember@redhat.com>
Date: Tue, 15 Jan 2019 23:48:33 +0100
Subject: [PATCH 1/3] shell: Improve the error message when whole update
operation fails
In case the whole updates operation fails and we don't have the data
which app failed, show 'Unable to install updates' error instead of
'Unable to update "(null)"'.
Fixes: https://gitlab.gnome.org/GNOME/gnome-software/issues/480
---
src/gs-shell.c | 120 +++++++++++++++++++++++++++++++++++--------------
1 file changed, 87 insertions(+), 33 deletions(-)
diff --git a/src/gs-shell.c b/src/gs-shell.c
index 6f1cda816..7c2f86d81 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -1355,23 +1355,34 @@ gs_shell_show_event_update (GsShell *shell, GsPluginEvent *event)
g_autofree gchar *str_origin = NULL;
g_autoptr(GString) str = g_string_new (NULL);
- str_app = gs_shell_get_title_from_app (app);
switch (error->code) {
case GS_PLUGIN_ERROR_DOWNLOAD_FAILED:
- if (origin != NULL) {
+ if (app != NULL && origin != NULL) {
+ str_app = gs_shell_get_title_from_app (app);
str_origin = gs_shell_get_title_from_origin (origin);
/* TRANSLATORS: failure text for the in-app notification,
* where the first %s is the app name (e.g. "GIMP") and
* the second %s is the origin, e.g. "Fedora" or
* "Fedora Project [fedoraproject.org]" */
- g_string_append_printf (str, _("Unable to update %s from %s"),
+ g_string_append_printf (str, _("Unable to update %s from %s as download failed"),
str_app, str_origin);
buttons = TRUE;
- } else {
+ } else if (app != NULL) {
+ str_app = gs_shell_get_title_from_app (app);
/* TRANSLATORS: failure text for the in-app notification,
* where the %s is the application name (e.g. "GIMP") */
g_string_append_printf (str, _("Unable to update %s as download failed"),
str_app);
+ } else if (origin != NULL) {
+ str_origin = gs_shell_get_title_from_origin (origin);
+ /* TRANSLATORS: failure text for the in-app notification,
+ * where the %s is the origin, e.g. "Fedora" or
+ * "Fedora Project [fedoraproject.org]" */
+ g_string_append_printf (str, _("Unable to install updates from %s as download failed"),
+ str_origin);
+ } else {
+ /* TRANSLATORS: failure text for the in-app notification */
+ g_string_append_printf (str, _("Unable to install updates as download failed"));
}
break;
case GS_PLUGIN_ERROR_NO_NETWORK:
@@ -1382,49 +1393,92 @@ gs_shell_show_event_update (GsShell *shell, GsPluginEvent *event)
buttons |= GS_SHELL_EVENT_BUTTON_NETWORK_SETTINGS;
break;
case GS_PLUGIN_ERROR_NO_SPACE:
- /* TRANSLATORS: failure text for the in-app notification,
- * where the %s is the application name (e.g. "GIMP") */
- g_string_append_printf (str, _("Unable to update %s: "
- "not enough disk space"),
- str_app);
+ if (app != NULL) {
+ str_app = gs_shell_get_title_from_app (app);
+ /* TRANSLATORS: failure text for the in-app notification,
+ * where the %s is the application name (e.g. "GIMP") */
+ g_string_append_printf (str, _("Unable to update %s: "
+ "not enough disk space"),
+ str_app);
+ } else {
+ /* TRANSLATORS: failure text for the in-app notification */
+ g_string_append_printf (str, _("Unable to install updates: "
+ "not enough disk space"));
+ }
buttons |= GS_SHELL_EVENT_BUTTON_NO_SPACE;
break;
case GS_PLUGIN_ERROR_AUTH_REQUIRED:
case GS_PLUGIN_ERROR_PIN_REQUIRED:
- /* TRANSLATORS: failure text for the in-app notification,
- * where the %s is the application name (e.g. "GIMP") */
- g_string_append_printf (str, _("Unable to update %s: "
- "authentication was required"),
- str_app);
+ if (app != NULL) {
+ str_app = gs_shell_get_title_from_app (app);
+ /* TRANSLATORS: failure text for the in-app notification,
+ * where the %s is the application name (e.g. "GIMP") */
+ g_string_append_printf (str, _("Unable to update %s: "
+ "authentication was required"),
+ str_app);
+ } else {
+ /* TRANSLATORS: failure text for the in-app notification */
+ g_string_append_printf (str, _("Unable to install updates: "
+ "authentication was required"));
+ }
break;
case GS_PLUGIN_ERROR_AUTH_INVALID:
- /* TRANSLATORS: failure text for the in-app notification,
- * where the %s is the application name (e.g. "GIMP") */
- g_string_append_printf (str, _("Unable to update %s: "
- "authentication was invalid"),
- str_app);
+ if (app != NULL) {
+ str_app = gs_shell_get_title_from_app (app);
+ /* TRANSLATORS: failure text for the in-app notification,
+ * where the %s is the application name (e.g. "GIMP") */
+ g_string_append_printf (str, _("Unable to update %s: "
+ "authentication was invalid"),
+ str_app);
+ } else {
+ /* TRANSLATORS: failure text for the in-app notification */
+ g_string_append_printf (str, _("Unable to install updates: "
+ "authentication was invalid"));
+ }
break;
case GS_PLUGIN_ERROR_NO_SECURITY:
- /* TRANSLATORS: failure text for the in-app notification,
- * where the %s is the application name (e.g. "GIMP") */
- g_string_append_printf (str, _("Unable to update %s: "
- "you do not have permission to "
- "update software"),
- str_app);
+ if (app != NULL) {
+ str_app = gs_shell_get_title_from_app (app);
+ /* TRANSLATORS: failure text for the in-app notification,
+ * where the %s is the application name (e.g. "GIMP") */
+ g_string_append_printf (str, _("Unable to update %s: "
+ "you do not have permission to "
+ "update software"),
+ str_app);
+ } else {
+ /* TRANSLATORS: failure text for the in-app notification */
+ g_string_append_printf (str, _("Unable to install updates: "
+ "you do not have permission to "
+ "update software"));
+ }
break;
case GS_PLUGIN_ERROR_AC_POWER_REQUIRED:
- /* TRANSLATORS: failure text for the in-app notification,
- * where the %s is the application name (e.g. "Dell XPS 13") */
- g_string_append_printf (str, _("Unable to update %s: "
- "AC power is required"),
- str_app);
+ if (app != NULL) {
+ str_app = gs_shell_get_title_from_app (app);
+ /* TRANSLATORS: failure text for the in-app notification,
+ * where the %s is the application name (e.g. "Dell XPS 13") */
+ g_string_append_printf (str, _("Unable to update %s: "
+ "AC power is required"),
+ str_app);
+ } else {
+ /* TRANSLATORS: failure text for the in-app notification,
+ * where the %s is the application name (e.g. "Dell XPS 13") */
+ g_string_append_printf (str, _("Unable to install updates: "
+ "AC power is required"));
+ }
break;
case GS_PLUGIN_ERROR_CANCELLED:
break;
default:
- /* TRANSLATORS: failure text for the in-app notification,
- * where the %s is the application name (e.g. "GIMP") */
- g_string_append_printf (str, _("Unable to update %s"), str_app);
+ if (app != NULL) {
+ str_app = gs_shell_get_title_from_app (app);
+ /* TRANSLATORS: failure text for the in-app notification,
+ * where the %s is the application name (e.g. "GIMP") */
+ g_string_append_printf (str, _("Unable to update %s"), str_app);
+ } else {
+ /* TRANSLATORS: failure text for the in-app notification */
+ g_string_append_printf (str, _("Unable to install updates"));
+ }
break;
}
if (str->len == 0)
--
2.21.0
From af764483533ac1afc42a5c0f1c6b76c43be1d24d Mon Sep 17 00:00:00 2001
From: Kalev Lember <klember@redhat.com>
Date: Tue, 15 Jan 2019 23:49:50 +0100
Subject: [PATCH 2/3] shell: Add details for a system upgrade error
Make the "internet access was required" error look the same as the rest
of the system upgrade errors, showing which distro version we were
trying to upgrade to.
---
src/gs-shell.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/gs-shell.c b/src/gs-shell.c
index 7c2f86d81..7c97740fa 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -1534,10 +1534,12 @@ gs_shell_show_event_upgrade (GsShell *shell, GsPluginEvent *event)
}
break;
case GS_PLUGIN_ERROR_NO_NETWORK:
- /* TRANSLATORS: failure text for the in-app notification */
- g_string_append (str, _("Unable to upgrade: "
- "internet access was required but "
- "wasnt available"));
+ /* TRANSLATORS: failure text for the in-app notification,
+ * where the %s is the distro name (e.g. "Fedora 25") */
+ g_string_append_printf (str, _("Unable to upgrade to %s: "
+ "internet access was required but "
+ "wasnt available"),
+ str_app);
buttons |= GS_SHELL_EVENT_BUTTON_NETWORK_SETTINGS;
break;
case GS_PLUGIN_ERROR_NO_SPACE:
--
2.21.0
From 0d3c47f69e7f6452412a0a3e6704106eefc0c658 Mon Sep 17 00:00:00 2001
From: Kalev Lember <klember@redhat.com>
Date: Tue, 15 Jan 2019 23:55:22 +0100
Subject: [PATCH 3/3] shell: Improve the logic when to show detailed error
messages
Make sure we never have "Sorry, something went wrong" without actual
details what went wrong.
---
src/gs-shell.c | 64 +++++++++++---------------------------------------
1 file changed, 14 insertions(+), 50 deletions(-)
diff --git a/src/gs-shell.c b/src/gs-shell.c
index 7c97740fa..3eea95028 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -990,16 +990,6 @@ gs_shell_get_title_from_app (GsApp *app)
return g_strdup_printf (_("“%s”"), gs_app_get_id (app));
}
-static gboolean
-gs_shell_show_detailed_error (GsShell *shell, const GError *error)
-{
- if (error->code == GS_PLUGIN_ERROR_FAILED)
- return TRUE;
- if (error->code == GS_PLUGIN_ERROR_DOWNLOAD_FAILED)
- return TRUE;
- return FALSE;
-}
-
static gchar *
get_first_line (const gchar *str)
{
@@ -1055,6 +1045,7 @@ gs_shell_show_event_refresh (GsShell *shell, GsPluginEvent *event)
/* TRANSLATORS: failure text for the in-app notification */
g_string_append (str, _("Unable to download updates"));
}
+ gs_shell_append_detailed_error (shell, str, error);
break;
case GS_PLUGIN_ERROR_NO_NETWORK:
/* TRANSLATORS: failure text for the in-app notification */
@@ -1106,6 +1097,7 @@ gs_shell_show_event_refresh (GsShell *shell, GsPluginEvent *event)
/* TRANSLATORS: failure text for the in-app notification */
g_string_append (str, _("Unable to get list of updates"));
}
+ gs_shell_append_detailed_error (shell, str, error);
break;
}
if (str->len == 0)
@@ -1121,10 +1113,6 @@ gs_shell_show_event_refresh (GsShell *shell, GsPluginEvent *event)
}
}
- /* add extra debugging for debug builds */
- if (gs_shell_show_detailed_error (shell, error))
- gs_shell_append_detailed_error (shell, str, error);
-
/* show in-app notification */
gs_shell_show_event_app_notify (shell, str->str, buttons);
return TRUE;
@@ -1173,15 +1161,12 @@ gs_shell_show_event_purchase (GsShell *shell, GsPluginEvent *event)
/* TRANSLATORS: failure text for the in-app notification,
* where the %s is the application name (e.g. "GIMP") */
g_string_append_printf (str, _("Unable to purchase %s"), str_app);
+ gs_shell_append_detailed_error (shell, str, error);
break;
}
if (str->len == 0)
return FALSE;
- /* add extra debugging for debug builds */
- if (gs_shell_show_detailed_error (shell, error))
- gs_shell_append_detailed_error (shell, str, error);
-
/* show in-app notification */
gs_shell_show_event_app_notify (shell, str->str, GS_SHELL_EVENT_BUTTON_NONE);
return TRUE;
@@ -1218,6 +1203,7 @@ gs_shell_show_event_install (GsShell *shell, GsPluginEvent *event)
"as download failed"),
str_app);
}
+ gs_shell_append_detailed_error (shell, str, error);
break;
case GS_PLUGIN_ERROR_NOT_SUPPORTED:
if (origin != NULL) {
@@ -1319,6 +1305,7 @@ gs_shell_show_event_install (GsShell *shell, GsPluginEvent *event)
/* TRANSLATORS: failure text for the in-app notification,
* where the %s is the application name (e.g. "GIMP") */
g_string_append_printf (str, _("Unable to install %s"), str_app);
+ gs_shell_append_detailed_error (shell, str, error);
break;
}
if (str->len == 0)
@@ -1334,10 +1321,6 @@ gs_shell_show_event_install (GsShell *shell, GsPluginEvent *event)
}
}
- /* add extra debugging for debug builds */
- if (gs_shell_show_detailed_error (shell, error))
- gs_shell_append_detailed_error (shell, str, error);
-
/* show in-app notification */
gs_shell_show_event_app_notify (shell, str->str, buttons);
return TRUE;
@@ -1384,6 +1367,7 @@ gs_shell_show_event_update (GsShell *shell, GsPluginEvent *event)
/* TRANSLATORS: failure text for the in-app notification */
g_string_append_printf (str, _("Unable to install updates as download failed"));
}
+ gs_shell_append_detailed_error (shell, str, error);
break;
case GS_PLUGIN_ERROR_NO_NETWORK:
/* TRANSLATORS: failure text for the in-app notification */
@@ -1479,6 +1463,7 @@ gs_shell_show_event_update (GsShell *shell, GsPluginEvent *event)
/* TRANSLATORS: failure text for the in-app notification */
g_string_append_printf (str, _("Unable to install updates"));
}
+ gs_shell_append_detailed_error (shell, str, error);
break;
}
if (str->len == 0)
@@ -1494,10 +1479,6 @@ gs_shell_show_event_update (GsShell *shell, GsPluginEvent *event)
}
}
- /* add extra debugging for debug builds */
- if (gs_shell_show_detailed_error (shell, error))
- gs_shell_append_detailed_error (shell, str, error);
-
/* show in-app notification */
gs_shell_show_event_app_notify (shell, str->str, buttons);
return TRUE;
@@ -1532,6 +1513,7 @@ gs_shell_show_event_upgrade (GsShell *shell, GsPluginEvent *event)
"as download failed"),
str_app);
}
+ gs_shell_append_detailed_error (shell, str, error);
break;
case GS_PLUGIN_ERROR_NO_NETWORK:
/* TRANSLATORS: failure text for the in-app notification,
@@ -1585,6 +1567,7 @@ gs_shell_show_event_upgrade (GsShell *shell, GsPluginEvent *event)
/* TRANSLATORS: failure text for the in-app notification,
* where the %s is the distro name (e.g. "Fedora 25") */
g_string_append_printf (str, _("Unable to upgrade to %s"), str_app);
+ gs_shell_append_detailed_error (shell, str, error);
break;
}
if (str->len == 0)
@@ -1600,10 +1583,6 @@ gs_shell_show_event_upgrade (GsShell *shell, GsPluginEvent *event)
}
}
- /* add extra debugging for debug builds */
- if (gs_shell_show_detailed_error (shell, error))
- gs_shell_append_detailed_error (shell, str, error);
-
/* show in-app notification */
gs_shell_show_event_app_notify (shell, str->str, buttons);
return TRUE;
@@ -1658,6 +1637,7 @@ gs_shell_show_event_remove (GsShell *shell, GsPluginEvent *event)
/* TRANSLATORS: failure text for the in-app notification,
* where the %s is the application name (e.g. "GIMP") */
g_string_append_printf (str, _("Unable to remove %s"), str_app);
+ gs_shell_append_detailed_error (shell, str, error);
break;
}
if (str->len == 0)
@@ -1673,10 +1653,6 @@ gs_shell_show_event_remove (GsShell *shell, GsPluginEvent *event)
}
}
- /* add extra debugging for debug builds */
- if (gs_shell_show_detailed_error (shell, error))
- gs_shell_append_detailed_error (shell, str, error);
-
/* show in-app notification */
gs_shell_show_event_app_notify (shell, str->str, buttons);
return TRUE;
@@ -1722,6 +1698,7 @@ gs_shell_show_event_launch (GsShell *shell, GsPluginEvent *event)
return FALSE;
/* TRANSLATORS: we failed to get a proper error code */
g_string_append (str, _("Sorry, something went wrong"));
+ gs_shell_append_detailed_error (shell, str, error);
break;
}
if (str->len == 0)
@@ -1737,10 +1714,6 @@ gs_shell_show_event_launch (GsShell *shell, GsPluginEvent *event)
}
}
- /* add extra debugging for debug builds */
- if (gs_shell_show_detailed_error (shell, error))
- gs_shell_append_detailed_error (shell, str, error);
-
/* show in-app notification */
gs_shell_show_event_app_notify (shell, str->str, buttons);
return TRUE;
@@ -1776,15 +1749,12 @@ gs_shell_show_event_file_to_app (GsShell *shell, GsPluginEvent *event)
return FALSE;
/* TRANSLATORS: we failed to get a proper error code */
g_string_append (str, _("Sorry, something went wrong"));
+ gs_shell_append_detailed_error (shell, str, error);
break;
}
if (str->len == 0)
return FALSE;
- /* add extra debugging for debug builds */
- if (gs_shell_show_detailed_error (shell, error))
- gs_shell_append_detailed_error (shell, str, error);
-
/* show in-app notification */
gs_shell_show_event_app_notify (shell, str->str, buttons);
return TRUE;
@@ -1820,15 +1790,12 @@ gs_shell_show_event_url_to_app (GsShell *shell, GsPluginEvent *event)
return FALSE;
/* TRANSLATORS: we failed to get a proper error code */
g_string_append (str, _("Sorry, something went wrong"));
+ gs_shell_append_detailed_error (shell, str, error);
break;
}
if (str->len == 0)
return FALSE;
- /* add extra debugging for debug builds */
- if (gs_shell_show_detailed_error (shell, error))
- g_string_append_printf (str, "\n%s", error->message);
-
/* show in-app notification */
gs_shell_show_event_app_notify (shell, str->str, buttons);
return TRUE;
@@ -1890,6 +1857,7 @@ gs_shell_show_event_fallback (GsShell *shell, GsPluginEvent *event)
return FALSE;
/* TRANSLATORS: we failed to get a proper error code */
g_string_append (str, _("Sorry, something went wrong"));
+ gs_shell_append_detailed_error (shell, str, error);
break;
}
if (str->len == 0)
@@ -1905,10 +1873,6 @@ gs_shell_show_event_fallback (GsShell *shell, GsPluginEvent *event)
}
}
- /* add extra debugging for debug builds */
- if (gs_shell_show_detailed_error (shell, error))
- gs_shell_append_detailed_error (shell, str, error);
-
/* show in-app notification */
gs_shell_show_event_app_notify (shell, str->str, buttons);
return TRUE;
--
2.21.0

Binary file not shown.

104
gnome-software.spec Normal file
View File

@ -0,0 +1,104 @@
Name: gnome-software
Version: 3.30.6
Release: 6
Summary: GNOME software Store
License: GPLv2+
URL: https://wiki.gnome.org/Apps/Software
Source0: https://download.gnome.org/sources/gnome-software/3.30/gnome-software-%{version}.tar.xz
Patch0001: gnome-software-3-30-error-message-fixes.patch
Patch0002: 0001-packagekit-Fix-progress-marshalling-for-upgrade_down.patch
BuildRequires: gettext libxslt docbook-style-xsl desktop-file-utils
BuildRequires: fwupd-devel >= 1.0.7 glib2-devel >= 2.56.0 gnome-desktop3-devel
BuildRequires: gsettings-desktop-schemas-devel >= 3.12.0
BuildRequires: gspell-devel gtk3-devel >= 3.22.4 gtk-doc json-glib-devel >= 1.2.0
BuildRequires: libappstream-glib-devel >= 0.7.14-3 libsoup-devel meson
BuildRequires: PackageKit-glib-devel >= 1.1.1 polkit-devel libsecret-devel
BuildRequires: flatpak-devel >= 0.9.4 ostree-devel rpm-ostree-devel
BuildRequires: libgudev1-devel valgrind-devel liboauth-devel snapd-glib-devel >= 1.42
Requires: appstream-data epiphany-runtime
Requires: flatpak >= 0.9.4 flatpak-libs >= 0.9.4 fwupd >= 1.0.7 glib2 >= 2.56.0
Requires: gnome-desktop3 >= 3.18.0 gnome-menus gsettings-desktop-schemas >= 3.12.0
Requires: gtk3 >= 3.22.4 json-glib >= 1.2.0 iso-codes libappstream-glib >= 0.7.14-3
Requires: librsvg2 libsoup >= 2.52.0 PackageKit >= 1.1.1 snapd-login-service
Provides: gnome-software-snap = %{version}-%{release}
Obsoletes: gnome-software-snap < %{version}-%{release}
%description
AppStore like management of Application fir your GNOME Desktop.
%package devel
Summary: Development files for the GNOME software store
Requires: gnome-software = %{version}-%{release}
%description devel
This subpackage contains the header files for developing GNOME software store plugins.
%package help
Summary: Help documentation for the GNOME software store.
%description help
Help documentation for the GNOME software store.
%package editor
Summary: Editor for designing banners for GNOME Software
Requires: gnome-software = %{version}-%{release}
%description editor
Editor is used to design banners for GNOME Software.
%prep
%autosetup -n gnome-software-%{version} -p1
%build
%meson -Dsnap=true -Dgudev=true -Dpackagekit=true -Dexternal_appstream=false -Drpm_ostree=true \
-Dtests=false -Dubuntuone=false -Dubuntu_reviews=false
%meson_build
%install
%meson_install
desktop-file-edit %{buildroot}%{_datadir}/applications/org.gnome.Software.desktop \
--set-key=X-AppInstall-Package --set-value=gnome-software
install -d %{buildroot}%{_datadir}/gnome-software/backgrounds
%find_lang %name --with-gnome
%check
desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop
%files -f gnome-software.lang
%doc AUTHORS README.md COPYING
%{_bindir}/gnome-software
%{_datadir}/applications/gnome-software-local-file.desktop
%{_datadir}/applications/org.gnome.Software.desktop
%dir %{_datadir}/gnome-software
%{_datadir}/icons/hicolor/*/apps/*
%{_datadir}/gnome-software/backgrounds/
%{_datadir}/gnome-software/{*.png,featured-*.svg,featured-*.jpg}
%{_datadir}/metainfo/*.xml
%dir %{_libdir}/gs-plugins-12
%{_libdir}/gs-plugins-12/*.so
%{_sysconfdir}/xdg/autostart/gnome-software-service.desktop
%{_datadir}/app-info/xmls/org.gnome.Software.Featured.xml
%{_datadir}/dbus-1/services/org.freedesktop.PackageKit.service
%{_datadir}/dbus-1/services/org.gnome.Software.service
%{_datadir}/gnome-shell/search-providers/org.gnome.Software-search-provider.ini
%{_datadir}/glib-2.0/schemas/org.gnome.software.gschema.xml
%{_libexecdir}/{gnome-software-cmd,gnome-software-restarter}
%{_libdir}/gs-plugins-12/libgs_plugin_snap.so
%{_datadir}/metainfo/org.gnome.Software.Plugin.Snap.metainfo.xml
%files devel
%{_libdir}/pkgconfig/gnome-software.pc
%dir %{_includedir}/gnome-software
%{_includedir}/gnome-software/*.h
%{_datadir}/gtk-doc/html/gnome-software
%files help
%{_mandir}/man1/gnome-software-editor.1*
%{_mandir}/man1/gnome-software.1.gz
%files editor
%{_bindir}/gnome-software-editor
%{_datadir}/applications/org.gnome.Software.Editor.desktop
%changelog
* Fri Apr 24 2020 wangyue<wangyue92@huawei.com> - 3.30.6-6
- package init

4
gnome-software.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: gitlab.gnome
src_repo: gnome-software
tag_prefix: "^"
seperator: "."