Resolves: #2129021 (Hide some errors in non-debug builds)
This commit is contained in:
parent
32bcf63fda
commit
e73a01aeaf
70
0009-hide-some-errors.patch
Normal file
70
0009-hide-some-errors.patch
Normal file
@ -0,0 +1,70 @@
|
||||
From 19c19d37ec9ba8b15b806158572a8e4a34c55677 Mon Sep 17 00:00:00 2001
|
||||
From: Milan Crha <mcrha@redhat.com>
|
||||
Date: Wed, 7 Sep 2022 09:01:16 +0200
|
||||
Subject: [PATCH] misc: Hide some errors in non-debug builds
|
||||
|
||||
These two errors are useless for the users, they cannot do anything with them.
|
||||
While it can be useful to know them, they can be also disturbing and they just
|
||||
fill the journal log for the users.
|
||||
|
||||
Related to https://gitlab.gnome.org/GNOME/gnome-software/-/issues/753
|
||||
---
|
||||
lib/gs-plugin-loader.c | 15 +++++++++++----
|
||||
src/gs-shell.c | 15 +++++++++++----
|
||||
2 files changed, 22 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/lib/gs-plugin-loader.c b/lib/gs-plugin-loader.c
|
||||
index 63f741c37..e040358b7 100644
|
||||
--- a/lib/gs-plugin-loader.c
|
||||
+++ b/lib/gs-plugin-loader.c
|
||||
@@ -358,10 +358,17 @@ gs_plugin_loader_claim_error (GsPluginLoader *plugin_loader,
|
||||
|
||||
/* invalid */
|
||||
if (error_copy->domain != GS_PLUGIN_ERROR) {
|
||||
- g_warning ("not GsPlugin error %s:%i: %s",
|
||||
- g_quark_to_string (error_copy->domain),
|
||||
- error_copy->code,
|
||||
- error_copy->message);
|
||||
+ if (g_strcmp0 (BUILD_TYPE, "debug") == 0) {
|
||||
+ g_warning ("not GsPlugin error %s:%i: %s",
|
||||
+ g_quark_to_string (error_copy->domain),
|
||||
+ error_copy->code,
|
||||
+ error_copy->message);
|
||||
+ } else {
|
||||
+ g_debug ("not GsPlugin error %s:%i: %s",
|
||||
+ g_quark_to_string (error_copy->domain),
|
||||
+ error_copy->code,
|
||||
+ error_copy->message);
|
||||
+ }
|
||||
error_copy->domain = GS_PLUGIN_ERROR;
|
||||
error_copy->code = GS_PLUGIN_ERROR_FAILED;
|
||||
}
|
||||
diff --git a/src/gs-shell.c b/src/gs-shell.c
|
||||
index beb76f0e9..af297d240 100644
|
||||
--- a/src/gs-shell.c
|
||||
+++ b/src/gs-shell.c
|
||||
@@ -2080,10 +2080,17 @@ gs_shell_rescan_events (GsShell *shell)
|
||||
!g_error_matches (error,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_CANCELLED)) {
|
||||
- g_warning ("not handling error %s for action %s: %s",
|
||||
- gs_plugin_error_to_string (error->code),
|
||||
- gs_plugin_action_to_string (action),
|
||||
- error->message);
|
||||
+ if (g_strcmp0 (BUILD_TYPE, "debug") == 0) {
|
||||
+ g_warning ("not handling error %s for action %s: %s",
|
||||
+ gs_plugin_error_to_string (error->code),
|
||||
+ gs_plugin_action_to_string (action),
|
||||
+ error->message);
|
||||
+ } else {
|
||||
+ g_debug ("not handling error %s for action %s: %s",
|
||||
+ gs_plugin_error_to_string (error->code),
|
||||
+ gs_plugin_action_to_string (action),
|
||||
+ error->message);
|
||||
+ }
|
||||
}
|
||||
gs_plugin_event_add_flag (event, GS_PLUGIN_EVENT_FLAG_INVALID);
|
||||
return;
|
||||
--
|
||||
GitLab
|
||||
|
@ -23,6 +23,7 @@ Patch01: 0001-crash-with-broken-theme.patch
|
||||
Patch02: 0006-optional-repos-cannot-be-disabled.patch
|
||||
Patch03: 0007-compulsory-only-for-repos.patch
|
||||
Patch04: 0008-gs-removal-dialog-crrect-property-name.patch
|
||||
Patch05: 0009-hide-some-errors.patch
|
||||
|
||||
BuildRequires: appstream-devel >= %{appstream_version}
|
||||
BuildRequires: gcc
|
||||
@ -103,7 +104,7 @@ and update software in the GNOME desktop.
|
||||
This package includes the rpm-ostree backend.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n %{name}-%{tarball_version}
|
||||
%autosetup -p1 -n %{name}-%{tarball_version} -S gendiff
|
||||
|
||||
%build
|
||||
%meson \
|
||||
@ -205,6 +206,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop
|
||||
%changelog
|
||||
* Thu Sep 22 2022 Milan Crha <mcrha@redhat.com> - 41.5-2
|
||||
- Resolves: #2128812 (Correct property name in GsRemovalDialog .ui file)
|
||||
- Resolves: #2129021 (Hide some errors in non-debug builds)
|
||||
|
||||
* Mon Mar 21 2022 Milan Crha <mcrha@redhat.com> - 41.5-1
|
||||
- Resolves: #2066164 (Update to 41.5)
|
||||
|
Loading…
Reference in New Issue
Block a user