Hello community, here is the log from the commit of package PackageKit for openSUSE:Factory checked in at 2019-08-22 15:03:01 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/PackageKit (Old) and /work/SRC/openSUSE:Factory/.PackageKit.new.7948 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "PackageKit" Thu Aug 22 15:03:01 2019 rev:189 rq:724486 version:1.1.12 Changes: -------- --- /work/SRC/openSUSE:Factory/PackageKit/PackageKit.changes 2019-06-27 15:53:07.371911583 +0200 +++ /work/SRC/openSUSE:Factory/.PackageKit.new.7948/PackageKit.changes 2019-08-22 15:04:37.662577916 +0200 @@ -1,0 +2,14 @@ +Mon Aug 19 01:10:01 UTC 2019 - Jonathan Kang <[email protected]> + +- Add PackageKit-zypp-fix-what-provides-newest-filter.patch: + zypp: Add support for newest filter in what-provides(bsc#984865, + gh#hughsie/PackageKit#335). + +------------------------------------------------------------------- +Wed Aug 14 01:32:01 UTC 2019 - Jonathan Kang <[email protected]> + +- Rename PackageKit-remove-default-thread-check.patch to + PackageKit-add-mutex-lock-to-protect-backend-priv-eulas.patch, + and update it with the one accepted upstream. + +------------------------------------------------------------------- Old: ---- PackageKit-remove-default-thread-check.patch New: ---- PackageKit-add-mutex-lock-to-protect-backend-priv-eulas.patch PackageKit-zypp-fix-what-provides-newest-filter.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ PackageKit.spec ++++++ --- /var/tmp/diff_new_pack.f8azT8/_old 2019-08-22 15:04:38.246577702 +0200 +++ /var/tmp/diff_new_pack.f8azT8/_new 2019-08-22 15:04:38.250577701 +0200 @@ -43,8 +43,8 @@ Patch0: PackageKit-cron-without-sleep.patch # PATCH-FIX-UPSTREAM PackageKit-return-on-transactions-going-backwards.patch gh#hughsie/PackageKit#301, bsc#1038425 [email protected] -- transaction: Return directly when its state is going backwards Patch1: PackageKit-return-on-transactions-going-backwards.patch -# PATCH-FIX-UPSTREAM PackageKit-remove-default-thread-check.patch gh#hughsie/PackageKit#303, bsc#1038425 [email protected] -- Remove pk_is_thread_default() check in pk_backend_is_eula_valid -Patch2: PackageKit-remove-default-thread-check.patch +# PATCH-FIX-UPSTREAM PackageKit-add-mutex-lock-to-protect-backend-priv-eulas.patch gh#hughsie/PackageKit#303, bsc#1038425 [email protected] -- Remove pk_is_thread_default() check in pk_backend_is_eula_valid +Patch2: PackageKit-add-mutex-lock-to-protect-backend-priv-eulas.patch # PATCH-FEATURE-OPENSUSE PackageKit-systemd-timers.patch bsc#1115410 [email protected] -- Migrate from cron to systemd timers Patch3: PackageKit-systemd-timers.patch Patch4: zypp-Switch-to-doUpgrade-solver-when-required-by-distribution.patch @@ -53,6 +53,8 @@ Patch6: zypp-perform-actions-disallowed-by-update-in-upgrade-mode.patch # PATCH-FIX-UPSTREAM PackageKit-zypp-fix-newest-filter.patch bsc#1137019 gh#hughsie/PackageKit#329 [email protected] -- zypp: Emit installed package for newest filter Patch7: PackageKit-zypp-fix-newest-filter.patch +# PATCH-FIX-UPSTREAM PackageKit-zypp-fix-what-provides-newest-filter.patch bsc#984865, gh#hughsie/PackageKit#335 [email protected] -- zypp: Add support for newest filter in what-provides +Patch8: PackageKit-zypp-fix-what-provides-newest-filter.patch BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: gobject-introspection-devel @@ -244,6 +246,7 @@ %patch5 -p1 %patch6 -p1 %patch7 -p1 +%patch8 -p1 translation-update-upstream %build ++++++ PackageKit-add-mutex-lock-to-protect-backend-priv-eulas.patch ++++++ >From 1b028d0598224fbb1510355c4a7dee7d25873872 Mon Sep 17 00:00:00 2001 From: Jonathan Kang <[email protected]> Date: Fri, 8 Mar 2019 21:44:08 +0800 Subject: [PATCH] Add mutex lock to protect backend->priv->eulas (#303) pk_is_thread_default() check was introduced in commit 44bd3ab6 to detect possible threading problems. Some backends need call pk_backend_is_eula_valid() in a thread which is not the default one to perform EULA related actions. This way pk_is_thread_default() check fails. Fix that by removing the pk_is_thread_default() checks in related functions and add mutex lock to avoid eulas to be accessed in multiple threads at the same time. Fixes #300 --- src/pk-backend.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/pk-backend.c b/src/pk-backend.c index 38f32a04c..c05f6c0cd 100644 --- a/src/pk-backend.c +++ b/src/pk-backend.c @@ -189,6 +189,7 @@ struct PkBackendPrivate gchar *name; gpointer file_changed_data; GHashTable *eulas; + GMutex eulas_mutex; GModule *handle; PkBackendDesc *desc; PkBackendFileChanged file_changed_func; @@ -935,10 +936,12 @@ void pk_backend_accept_eula (PkBackend *backend, const gchar *eula_id) { gpointer present; + g_autoptr(GMutexLocker) locker = NULL; + + locker = g_mutex_locker_new (&backend->priv->eulas_mutex); g_return_if_fail (PK_IS_BACKEND (backend)); g_return_if_fail (eula_id != NULL); - g_return_if_fail (pk_is_thread_default ()); present = g_hash_table_lookup (backend->priv->eulas, eula_id); if (present != NULL) { @@ -952,10 +955,12 @@ gboolean pk_backend_is_eula_valid (PkBackend *backend, const gchar *eula_id) { gpointer present; + g_autoptr(GMutexLocker) locker = NULL; + + locker = g_mutex_locker_new (&backend->priv->eulas_mutex); g_return_val_if_fail (PK_IS_BACKEND (backend), FALSE); g_return_val_if_fail (eula_id != NULL, FALSE); - g_return_val_if_fail (pk_is_thread_default (), FALSE); present = g_hash_table_lookup (backend->priv->eulas, eula_id); if (present != NULL) @@ -969,9 +974,11 @@ pk_backend_get_accepted_eula_string (PkBackend *backend) GString *string; GList *l; g_autoptr(GList) keys = NULL; + g_autoptr(GMutexLocker) locker = NULL; + + locker = g_mutex_locker_new (&backend->priv->eulas_mutex); g_return_val_if_fail (PK_IS_BACKEND (backend), FALSE); - g_return_val_if_fail (pk_is_thread_default (), FALSE); /* optimise for the common case */ if (g_hash_table_size (backend->priv->eulas) == 0) @@ -1065,6 +1072,7 @@ pk_backend_finalize (GObject *object) g_key_file_unref (backend->priv->conf); g_hash_table_destroy (backend->priv->eulas); + g_mutex_clear (&backend->priv->eulas_mutex); g_mutex_clear (&backend->priv->thread_hash_mutex); g_hash_table_unref (backend->priv->thread_hash); g_free (backend->priv->desc); @@ -1708,6 +1716,7 @@ pk_backend_init (PkBackend *backend) g_direct_equal, NULL, g_free); + g_mutex_init (&backend->priv->eulas_mutex); g_mutex_init (&backend->priv->thread_hash_mutex); } -- 2.21.0 ++++++ PackageKit-zypp-fix-what-provides-newest-filter.patch ++++++ Index: PackageKit-1.1.12/backends/zypp/pk-backend-zypp.cpp =================================================================== --- PackageKit-1.1.12.orig/backends/zypp/pk-backend-zypp.cpp +++ PackageKit-1.1.12/backends/zypp/pk-backend-zypp.cpp @@ -1113,6 +1113,19 @@ zypp_filter_solvable (PkBitfield filters return TRUE; if (i == PK_FILTER_ENUM_NOT_DOWNLOADED && zypp_package_is_cached (item)) return TRUE; + if (i == PK_FILTER_ENUM_NEWEST) { + if (item.isSystem ()) { + return FALSE; + } + else { + ui::Selectable::Ptr sel = ui::Selectable::get (item); + const PoolItem & newest (sel->highestAvailableVersionObj ()); + + if (newest && zypp::Edition::compare (newest.edition (), item.edition ())) + return TRUE; + return FALSE; + } + } // FIXME: add more enums - cf. libzif logic and pk-enum.h // PK_FILTER_ENUM_SUPPORTED,
