From 1175d45bc862593b43353ac7febe4037234cd780 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Thu, 4 Oct 2012 11:57:27 +0100 Subject: [PATCH] Backport some more patches from upstream: - Never show the DBUS remote error to the user - Fix the pango_language_matches() parameter list regression - Don't crash when writing the offline-updates results file - Only save interesting packages to offline-update-competed - Resolves: #862161, #857908 --- ...te-error-is-stripped-before-showing-.patch | 30 ++++++++++++++++ ...gument-pango_language_matches-must-b.patch | 36 +++++++++++++++++++ ...Don-t-crash-when-writing-the-offline.patch | 26 ++++++++++++++ ...Only-save-packages-that-have-been-up.patch | 36 +++++++++++++++++++ PackageKit.spec | 24 ++++++++++--- 5 files changed, 148 insertions(+), 4 deletions(-) create mode 100644 0001-glib-Ensure-remote-error-is-stripped-before-showing-.patch create mode 100644 0005-pk-gtk-module-Argument-pango_language_matches-must-b.patch create mode 100644 0006-offline-updates-Don-t-crash-when-writing-the-offline.patch create mode 100644 0008-offline-updates-Only-save-packages-that-have-been-up.patch diff --git a/0001-glib-Ensure-remote-error-is-stripped-before-showing-.patch b/0001-glib-Ensure-remote-error-is-stripped-before-showing-.patch new file mode 100644 index 0000000..c10a202 --- /dev/null +++ b/0001-glib-Ensure-remote-error-is-stripped-before-showing-.patch @@ -0,0 +1,30 @@ +From 9dbdf3d6aad84a382cffb689262d9ac841df1758 Mon Sep 17 00:00:00 2001 +From: Richard Hughes +Date: Wed, 3 Oct 2012 14:36:32 +0100 +Subject: [PATCH 1/8] glib: Ensure remote error is stripped before showing it + to the user + +This prevents showing the user errors like: + +GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._pk_5ftransaction_5ferror.Code14 + +Resolves half of https://bugzilla.redhat.com/show_bug.cgi?id=862333 +--- + lib/packagekit-glib2/pk-client.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lib/packagekit-glib2/pk-client.c b/lib/packagekit-glib2/pk-client.c +index 8a5f311..1a55757 100644 +--- a/lib/packagekit-glib2/pk-client.c ++++ b/lib/packagekit-glib2/pk-client.c +@@ -264,6 +264,7 @@ pk_client_fixup_dbus_error (GError *error) + error->code = PK_CLIENT_ERROR_NOT_SUPPORTED; + goto out; + } ++ g_dbus_error_strip_remote_error (error); + g_warning ("couldn't parse execption '%s', please report", name); + out: + /* hardcode domain */ +-- +1.7.12 + diff --git a/0005-pk-gtk-module-Argument-pango_language_matches-must-b.patch b/0005-pk-gtk-module-Argument-pango_language_matches-must-b.patch new file mode 100644 index 0000000..f7707d0 --- /dev/null +++ b/0005-pk-gtk-module-Argument-pango_language_matches-must-b.patch @@ -0,0 +1,36 @@ +From 89ea03c4d72d1a3c4978239241300076e78b1b29 Mon Sep 17 00:00:00 2001 +From: "Owen W. Taylor" +Date: Wed, 3 Oct 2012 15:37:28 -0400 +Subject: [PATCH 5/8] pk-gtk-module: Argument pango_language_matches() must be + canonical + +The pattern passed to pango_language_matches() has to be in canonical +form - that is, lowercase with - for separators. + +(Note that there was no leak before the usage of pango_languages_matches() +was introduced by 677e8ab408 - pango_language_from_string() doesn't +return an allocated result.) + +https://bugs.freedesktop.org/show_bug.cgi?id=55590 + +Signed-off-by: Richard Hughes +--- + contrib/gtk-module/pk-gtk-module.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/contrib/gtk-module/pk-gtk-module.c b/contrib/gtk-module/pk-gtk-module.c +index 2c93f02..54cf08f 100644 +--- a/contrib/gtk-module/pk-gtk-module.c ++++ b/contrib/gtk-module/pk-gtk-module.c +@@ -252,7 +252,7 @@ pk_pango_fc_font_map_load_fontset (PangoFontMap *font_map, + * code instead of "xx"... */ + if (G_LIKELY (language == last_language) || + language == NULL || +- pango_language_matches (language, "C;xx")) ++ pango_language_matches (language, "c;xx")) + return fontset; + + if (G_UNLIKELY (!seen_languages)) +-- +1.7.12 + diff --git a/0006-offline-updates-Don-t-crash-when-writing-the-offline.patch b/0006-offline-updates-Don-t-crash-when-writing-the-offline.patch new file mode 100644 index 0000000..5fd5861 --- /dev/null +++ b/0006-offline-updates-Don-t-crash-when-writing-the-offline.patch @@ -0,0 +1,26 @@ +From 27a59b0566de69a22c248ae7ba6f74bcf32ef73e Mon Sep 17 00:00:00 2001 +From: Richard Hughes +Date: Thu, 4 Oct 2012 11:43:14 +0100 +Subject: [PATCH 6/8] offline-updates: Don't crash when writing the + offline-update-competed file + +--- + contrib/systemd-updates/pk-offline-update.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/contrib/systemd-updates/pk-offline-update.c b/contrib/systemd-updates/pk-offline-update.c +index 36972be..6d02f4a 100644 +--- a/contrib/systemd-updates/pk-offline-update.c ++++ b/contrib/systemd-updates/pk-offline-update.c +@@ -280,7 +280,7 @@ pk_offline_update_write_results (PkResults *results) + packages = pk_results_get_package_array (results); + if (packages != NULL) { + string = g_string_new (""); +- for (i = 0; packages->len; i++) { ++ for (i = 0; i < packages->len; i++) { + package = g_ptr_array_index (packages, i); + g_string_append_printf (string, "%s,", + pk_package_get_id (package)); +-- +1.7.12 + diff --git a/0008-offline-updates-Only-save-packages-that-have-been-up.patch b/0008-offline-updates-Only-save-packages-that-have-been-up.patch new file mode 100644 index 0000000..cd10997 --- /dev/null +++ b/0008-offline-updates-Only-save-packages-that-have-been-up.patch @@ -0,0 +1,36 @@ +From f86490ef61704f9ca86841c533643650b522703d Mon Sep 17 00:00:00 2001 +From: Richard Hughes +Date: Thu, 4 Oct 2012 11:45:34 +0100 +Subject: [PATCH 8/8] offline-updates: Only save packages that have been + updated or installed in the offline-update-competed + file + +--- + contrib/systemd-updates/pk-offline-update.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/contrib/systemd-updates/pk-offline-update.c b/contrib/systemd-updates/pk-offline-update.c +index a012e12..4ddddb5 100644 +--- a/contrib/systemd-updates/pk-offline-update.c ++++ b/contrib/systemd-updates/pk-offline-update.c +@@ -282,8 +282,15 @@ pk_offline_update_write_results (PkResults *results) + string = g_string_new (""); + for (i = 0; i < packages->len; i++) { + package = g_ptr_array_index (packages, i); +- g_string_append_printf (string, "%s,", +- pk_package_get_id (package)); ++ switch (pk_package_get_info (package)) { ++ case PK_INFO_ENUM_UPDATING: ++ case PK_INFO_ENUM_INSTALLING: ++ g_string_append_printf (string, "%s,", ++ pk_package_get_id (package)); ++ break; ++ default: ++ break; ++ } + } + if (string->len > 0) + g_string_set_size (string, string->len - 1); +-- +1.7.12 + diff --git a/PackageKit.spec b/PackageKit.spec index a262101..d47b397 100644 --- a/PackageKit.spec +++ b/PackageKit.spec @@ -3,7 +3,7 @@ Summary: Package management service Name: PackageKit Version: 0.8.4 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ and LGPLv2+ URL: http://www.packagekit.org Source0: http://www.packagekit.org/releases/%{name}-%{version}.tar.xz @@ -20,6 +20,10 @@ Patch4: PackageKit-0.7.4-xulrunner2.patch # upstream patches Patch103: 0003-Change-the-priority-state-changed-timeout-to-2-secon.patch Patch104: 0004-packagekit-qt-Break-ABI-to-make-pk-qt-more-closer-to.patch +Patch105: 0001-glib-Ensure-remote-error-is-stripped-before-showing-.patch +Patch106: 0005-pk-gtk-module-Argument-pango_language_matches-must-b.patch +Patch107: 0006-offline-updates-Don-t-crash-when-writing-the-offline.patch +Patch108: 0008-offline-updates-Only-save-packages-that-have-been-up.patch Requires: %{name}-glib%{?_isa} = %{version}-%{release} Requires: PackageKit-backend @@ -260,6 +264,11 @@ user to restart the computer or remove and re-insert the device. %patch4 -p1 -b .xulrunner2 %patch103 -p1 -b .0003 %patch104 -p1 -b .0004 +%patch105 -p1 -b .remote-dbus-error +%patch106 -p1 -b .pango-c-error +%patch107 -p1 -b .offline-crash +%patch108 -p1 -b .offline-save-list + NOCONFIGURE=1 ./autogen.sh %build @@ -469,9 +478,16 @@ update-mime-database %{_datadir}/mime &> /dev/null || : %{_libdir}/pkgconfig/packagekit-plugin.pc %changelog -* Tue Oct 02 2012 Rex Dieter -- 0.8.4-2 -- -yum: Requires: yum >= 3.4.3-35 +* Thu Oct 04 2012 Richard Hughes - 0.8.4-3 +- Backport some more patches from upstream: +- Never show the DBUS remote error to the user +- Fix the pango_language_matches() parameter list regression +- Don't crash when writing the offline-updates results file +- Only save interesting packages to offline-update-competed +- Resolves: #862161, #857908 + +* Tue Oct 02 2012 Rex Dieter - 0.8.4-2 +- yum: Requires: yum >= 3.4.3-35 - PackageKit.conf: StateChangedTimeoutPriority=2 - backport -qt api/abi change