Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package PackageKit for openSUSE:Factory checked in at 2021-11-06 18:15:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/PackageKit (Old) and /work/SRC/openSUSE:Factory/.PackageKit.new.1890 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "PackageKit" Sat Nov 6 18:15:53 2021 rev:222 rq:929706 version:1.2.4 Changes: -------- --- /work/SRC/openSUSE:Factory/PackageKit/PackageKit.changes 2021-08-25 20:56:59.825256592 +0200 +++ /work/SRC/openSUSE:Factory/.PackageKit.new.1890/PackageKit.changes 2021-11-06 18:18:33.992901185 +0100 @@ -1,0 +2,63 @@ +Fri Nov 5 11:16:00 UTC 2021 - Bj??rn Lie <bjorn....@gmail.com> + +- Update to version 1.2.4: + + Libraries: + - Add specific error code when user declined interaction + - Avoid spurious GObject::notify signal emissions + - Correct 'cancellable' use in pk_client_repair_system_async() + - Fix a leak on calling set_locale() a second time + - Fix a possible use-after-free under pk_client_cancel_cb() + - Improve thread safety on an operation cancellation + + Backends: + - dnf: + . Read update information also when getting list of updates + . Honor install_weak_deps=False if it is there + . Use 'hy_query_get_advisory_pkgs', if available + + New Features: + - PkDetails: Add 'download-size' property + - PkPackage: Add update severity property + + Bugfixes: + - Let the finish understand the 'cancelled' exit code + - Make backends that use pk-backend-spawn work (#477) + - Only set polkit interactive flag if method call has too +- Changes from version 1.2.3: + + Backends: + - alpm: + . Add post transaction hook + . Rename errno to alpm_err to avoid name clashes + - aptcc: Auto-remove old kernels, unless configured otherwise + - dnf: Add support for coercing upgrade to distupgrade + - zypp: + . Make sure pool is initialized at the beginning of some + methods + . Reset update mode after getting updates + + Bugfixes: + - Append to cron log instead of overwriting it + - Cancel a transaction if calling Cancel fails or the daemon + disappears + - Do not crash when calling pk_dbus_get_uid() before D-Bus is + setup + - Fix all compiler warnings + - Fix multilib conflicts in generated pk-enum-types.h + - Free scheduler array correctly again + - Remove large transaction size sanity check +- Drop patches fixed upstream: + + PackageKit-zypp-cleanup-tmp-files.patch + + PackageKit-zypp-reset-update-mode-after-get-updates.patch + + PackageKit-dnf-Add-support-for-coercing-upgrade-to-distupgrade.patch + + PackageKit-zypp-initialize-pool.patch + + PackageKit-remove-transaction-size-limit.patch + + PackageKit-cancel-transaction-if-daemon-disappears.patch + + PackageKit-dnf-ignore-weak-deps.patch +- Add 505.patch: pk-offline: Add flags to D-Bus invoking methods. + That's currently to be able to set whether the method should be + interactive or not. The old functions call the methods as + non-interactive. + +------------------------------------------------------------------- +Thu Sep 16 01:19:18 UTC 2021 - Stanislav Brabec <sbra...@suse.com> + +- Remove obsolete translation-update-upstream support + (jsc#SLE-21105). + +------------------------------------------------------------------- Old: ---- PackageKit-1.2.2.tar.xz PackageKit-1.2.2.tar.xz.asc PackageKit-cancel-transaction-if-daemon-disappears.patch PackageKit-dnf-Add-support-for-coercing-upgrade-to-distupgrade.patch PackageKit-dnf-ignore-weak-deps.patch PackageKit-remove-transaction-size-limit.patch PackageKit-zypp-cleanup-tmp-files.patch PackageKit-zypp-initialize-pool.patch PackageKit-zypp-reset-update-mode-after-get-updates.patch New: ---- 505.patch PackageKit-1.2.4.tar.xz PackageKit-1.2.4.tar.xz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ PackageKit.spec ++++++ --- /var/tmp/diff_new_pack.FVrtG5/_old 2021-11-06 18:18:34.724901564 +0100 +++ /var/tmp/diff_new_pack.FVrtG5/_new 2021-11-06 18:18:34.724901564 +0100 @@ -32,7 +32,7 @@ %endif Name: PackageKit -Version: 1.2.2 +Version: 1.2.4 Release: 0 Summary: Simple software installation management software License: GPL-2.0-or-later @@ -50,22 +50,10 @@ Patch2: PackageKit-remove-polkit-rules.patch # PATCH-FIX-OPENSUSE PackageKit-dnf-Add-support-for-AppStream-repodata-basenames-use.patch ngomp...@gmail.com -- Band-aid to deal with OBS producing differently named appstream repodata files Patch3: PackageKit-dnf-Add-support-for-AppStream-repodata-basenames-use.patch -# PATCH-FIX-UPSTREAM PackageKit-zypp-cleanup-tmp-files.patch bsc#1169739 gh#hughsie/PackageKit/commit#cf73b01a sck...@suse.com -- Revert "Revert "zypp: Clean up temporary files when PK quits"" -Patch4: PackageKit-zypp-cleanup-tmp-files.patch +# PATCH-FIX-UPSTREAM 505.patch -- pk-offline: Add flags to D-Bus invoking methods +Patch4: https://patch-diff.githubusercontent.com/raw/PackageKit/PackageKit/pull/505.patch # PATCH-FIX-UPSTREAM PackageKit-fix-crash-pre-dbus.patch gh#hughsie/PackageKit!436 -- Do not crash when calling pk_dbus_get_uid() before D-Bus is setup Patch5: PackageKit-fix-crash-pre-dbus.patch -# PATCH-FIX-UPSTREAM PackageKit-zypp-reset-update-mode-after-get-updates.patch gh#hughsie/PackageKit/commit#b208f551 bsc#1180150 sck...@suse.com -- zypp: Reset update mode after getting updates -Patch6: PackageKit-zypp-reset-update-mode-after-get-updates.patch -# PATCH-FIX-UPSTREAM PackageKit-dnf-Add-support-for-coercing-upgrade-to-distupgrade.patch gh#hughsie/PackageKit#449 -- Use dup for upgrades on Tumbleweed with DNF -Patch7: PackageKit-dnf-Add-support-for-coercing-upgrade-to-distupgrade.patch -# PATCH-FIX-UPSTREAM PackageKit-zypp-initialize-pool.patch gh#hughsie/PackageKit/commit#3efa0c524, bsc#1180597 -- zypp: Make sure pool is initialized at the beginning of some methods -Patch8: PackageKit-zypp-initialize-pool.patch -# PATCH-FIX-UPSTREAM PackageKit-remove-transaction-size-limit.patch gh#hughsie/PackageKit/commit#ff01813 gh#hughsie/PackageKit/commit#ff01813 -- Fix a "too many packages to process" error against full rebuilds -Patch9: PackageKit-remove-transaction-size-limit.patch -# PATCH-FIX-UPSTREAM PackageKit-cancel-transaction-if-daemon-disappears.patch gh#hughsie/PackageKit#464 sck...@suse.com -- Fix hangs in packagekit-glib2 client if daemon crashes -Patch10: PackageKit-cancel-transaction-if-daemon-disappears.patch -# PATCH-FIX-UPSTREAM PackageKit-dnf-ignore-weak-deps.patch gh#dfaggioli/PackageKit#486 gh#Conan-Kudo/PackageKit#488 gh#Conan-Kudo/PackageKit/commit/#ecd4a96 -- dnf-backend: honor install_weak_deps=False if it is there -Patch11: PackageKit-dnf-ignore-weak-deps.patch # PATCH-FIX-UPSTREAM PackageKit-zypp-fix-crash-with-empty-search-string.patch gh#hughsie/PackageKit/commit#21ccf49, bsc#1179287 sck...@suse.com -- zypp: Fix crash when search string is NULL Patch12: PackageKit-zypp-fix-crash-with-empty-search-string.patch @@ -94,7 +82,6 @@ # We need the %%mime_database_* macros BuildRequires: shared-mime-info BuildRequires: sqlite-devel -BuildRequires: translation-update-upstream BuildRequires: vala BuildRequires: pkgconfig(bash-completion) >= 2.0 BuildRequires: pkgconfig(libsystemd) ++++++ PackageKit-cancel-transaction-if-daemon-disappears.patch -> 505.patch ++++++ --- /work/SRC/openSUSE:Factory/PackageKit/PackageKit-cancel-transaction-if-daemon-disappears.patch 2021-04-14 10:09:31.765346822 +0200 +++ /work/SRC/openSUSE:Factory/.PackageKit.new.1890/505.patch 2021-11-06 18:18:33.932901154 +0100 @@ -1,184 +1,335 @@ -From b2452c2d0023aad6be0751f9785e20f34bed6887 Mon Sep 17 00:00:00 2001 -From: Philip Withnall <pwithn...@endlessos.org> -Date: Fri, 19 Mar 2021 22:43:16 +0000 -Subject: [PATCH 1/2] packagekit-glib2: Cancel a transaction if the daemon - disappears -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit +From 02354c3a339b7f8d6661731f224e7ccf1fc34ddc Mon Sep 17 00:00:00 2001 +From: Milan Crha <mc...@redhat.com> +Date: Mon, 13 Sep 2021 19:57:12 +0200 +Subject: [PATCH] pk-offline: Add flags to D-Bus invoking methods -Most of the time, when using a `GDBusProxy`, and the service you???re -talking to disappears, you???ll get notified ??? the async D-Bus call you???re -making will return an error. However, due to PackageKit???s design for -handling long-running operations, there are long periods between a -transaction being created, and emitting its `Finished` signal, when no -D-Bus calls are pending. +That's currently to be able to set whether the method should be +interactive or not. The old functions call the methods as non-interactive. -If the daemon crashes during one of these periods, there is currently no -way for the packagekit-glib2 client code to notice until it tries to -make another D-Bus call on the same `GDBusProxy` instance, and that -might never happen ??? it might wait for the `Finished` signal forever. - -Avoid that by connecting to `notify::g-name-owner`, which is emitted on -`GDBusProxy` if the daemon crashes. It changes value from the unique -name of the service, to `NULL`. When that happens, abort the transaction -state in the client with an error. - -This should stop gnome-software hanging indefinitely if PackageKit -crashes during a transaction. In particular, if this happens a few times -during consecutive refresh operations, gnome-software can eventually run -out of worker threads, and become unresponsive entirely. (See -https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1118.) The same -will likely be true of other clients which use packagekit-glib2. - -Equivalent changes don???t seem to be needed in `pk-control.c` (which also -uses `GDBusProxy`), because all of its D-Bus operations appear to -maintain no state outside of individual method calls. - -Signed-off-by: Philip Withnall <pwithn...@endlessos.org> +Closes https://github.com/PackageKit/PackageKit/issues/504 --- - lib/packagekit-glib2/pk-client.c | 31 ++++++++++++++++++++++++++++++- - 1 file changed, 30 insertions(+), 1 deletion(-) - -diff --git a/lib/packagekit-glib2/pk-client.c b/lib/packagekit-glib2/pk-client.c -index 3f7d5230d..67df1c5ea 100644 ---- a/lib/packagekit-glib2/pk-client.c -+++ b/lib/packagekit-glib2/pk-client.c -@@ -122,6 +122,9 @@ typedef struct { - PkClientHelper *client_helper; - } PkClientState; - -+static void -+pk_client_state_finish (PkClientState *state, -+ const GError *error); - static void - pk_client_properties_changed_cb (GDBusProxy *proxy, - GVariant *changed_properties, -@@ -133,6 +136,10 @@ pk_client_signal_cb (GDBusProxy *proxy, - const gchar *signal_name, - GVariant *parameters, - gpointer user_data); -+static void -+pk_client_notify_name_owner_cb (GObject *obj, -+ GParamSpec *pspec, -+ gpointer user_data); + client/pk-console.c | 4 +- + docs/api/PackageKit-sections.txt | 4 + + lib/packagekit-glib2/pk-offline.c | 104 ++++++++++++++++++++++++-- + lib/packagekit-glib2/pk-offline.h | 31 ++++++++ + lib/packagekit-glib2/pk-test-daemon.c | 4 +- + 5 files changed, 138 insertions(+), 9 deletions(-) + +diff --git a/client/pk-console.c b/client/pk-console.c +index 3d027e601..4fd620fec 100644 +--- a/client/pk-console.c ++++ b/client/pk-console.c +@@ -2283,14 +2283,14 @@ main (int argc, char *argv[]) + } else if (strcmp (mode, "offline-trigger") == 0) { - /** - * pk_client_error_quark: -@@ -662,6 +669,9 @@ pk_client_state_finish (PkClientState *state, const GError *error) - g_signal_handlers_disconnect_by_func (state->proxy, - G_CALLBACK (pk_client_signal_cb), - state); -+ g_signal_handlers_disconnect_by_func (state->proxy, -+ G_CALLBACK (pk_client_notify_name_owner_cb), -+ state); - g_object_unref (G_OBJECT (state->proxy)); - } + run_mainloop = FALSE; +- ret = pk_offline_trigger (PK_OFFLINE_ACTION_REBOOT, NULL, &error); ++ ret = pk_offline_trigger_with_flags (PK_OFFLINE_ACTION_REBOOT, PK_OFFLINE_FLAGS_INTERACTIVE, NULL, &error); + if (!ret) + ctx->retval = error->code; -@@ -1389,6 +1399,19 @@ pk_client_signal_cb (GDBusProxy *proxy, - return; + } else if (strcmp (mode, "offline-cancel") == 0) { + + run_mainloop = FALSE; +- ret = pk_offline_cancel (NULL, &error); ++ ret = pk_offline_cancel_with_flags (PK_OFFLINE_FLAGS_INTERACTIVE, NULL, &error); + if (!ret) + ctx->retval = error->code; + +diff --git a/docs/api/PackageKit-sections.txt b/docs/api/PackageKit-sections.txt +index ead052f92..2020bd65d 100644 +--- a/docs/api/PackageKit-sections.txt ++++ b/docs/api/PackageKit-sections.txt +@@ -525,9 +525,13 @@ pk_offline_get_action_monitor + pk_offline_get_results + pk_offline_get_results_mtime + pk_offline_cancel ++pk_offline_cancel_with_flags + pk_offline_clear_results ++pk_offline_clear_results_with_flags + pk_offline_trigger ++pk_offline_trigger_with_flags + pk_offline_trigger_upgrade ++pk_offline_trigger_upgrade_with_flags + </SECTION> + + <SECTION> +diff --git a/lib/packagekit-glib2/pk-offline.c b/lib/packagekit-glib2/pk-offline.c +index 2e3870580..9030be293 100644 +--- a/lib/packagekit-glib2/pk-offline.c ++++ b/lib/packagekit-glib2/pk-offline.c +@@ -95,6 +95,14 @@ pk_offline_action_from_string (const gchar *action) + return PK_OFFLINE_ACTION_UNKNOWN; } -+static void -+pk_client_notify_name_owner_cb (GObject *obj, -+ GParamSpec *pspec, -+ gpointer user_data) -+{ -+ PkClientState *state = (PkClientState *) user_data; -+ g_autoptr(GError) local_error = NULL; -+ -+ local_error = g_error_new_literal (PK_CLIENT_ERROR, PK_CLIENT_ERROR_FAILED, -+ "PackageKit daemon disappeared"); -+ pk_client_state_finish (state, local_error); ++static GDBusCallFlags ++pk_offline_flags_to_gdbus_call_flags (PkOfflineFlags flags) ++{ ++ if ((flags & PK_OFFLINE_FLAGS_INTERACTIVE) != 0) ++ return G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION; ++ return G_DBUS_CALL_FLAGS_NONE; +} + - /* - * pk_client_proxy_connect: + /** + * pk_offline_cancel: + * @cancellable: A #GCancellable or %NULL +@@ -102,6 +110,8 @@ pk_offline_action_from_string (const gchar *action) + * + * Cancels the offline operation that has been scheduled. If there is no + * scheduled offline operation then this method returns with success. ++ * The function always allows user interaction. To change the behavior, ++ * use pk_offline_cancel_with_flags(). + * + * Return value: %TRUE for success, else %FALSE and @error set + * +@@ -109,6 +119,25 @@ pk_offline_action_from_string (const gchar *action) **/ -@@ -1416,6 +1439,9 @@ pk_client_proxy_connect (PkClientState *state) - g_signal_connect (state->proxy, "g-signal", - G_CALLBACK (pk_client_signal_cb), - state); -+ g_signal_connect (state->proxy, "notify::g-name-owner", -+ G_CALLBACK (pk_client_notify_name_owner_cb), -+ state); - } + gboolean + pk_offline_cancel (GCancellable *cancellable, GError **error) ++{ ++ return pk_offline_cancel_with_flags (PK_OFFLINE_FLAGS_INTERACTIVE, cancellable, error); ++} ++ ++/** ++ * pk_offline_cancel_with_flags: ++ * @flags: bit-or of #PkOfflineFlags ++ * @cancellable: A #GCancellable or %NULL ++ * @error: A #GError or %NULL ++ * ++ * Cancels the offline operation that has been scheduled. If there is no ++ * scheduled offline operation then this method returns with success. ++ * ++ * Return value: %TRUE for success, else %FALSE and @error set ++ * ++ * Since: 1.2.5 ++ **/ ++gboolean ++pk_offline_cancel_with_flags (PkOfflineFlags flags, GCancellable *cancellable, GError **error) + { + g_autoptr(GDBusConnection) connection = NULL; + g_autoptr(GVariant) res = NULL; +@@ -125,7 +154,7 @@ pk_offline_cancel (GCancellable *cancellable, GError **error) + "Cancel", + NULL, + NULL, +- G_DBUS_CALL_FLAGS_NONE, ++ pk_offline_flags_to_gdbus_call_flags (flags), + -1, + cancellable, + error); +@@ -139,8 +168,10 @@ pk_offline_cancel (GCancellable *cancellable, GError **error) + * @cancellable: A #GCancellable or %NULL + * @error: A #GError or %NULL + * +- * Crears the last offline operation report, which may be success or failure. ++ * Clears the last offline operation report, which may be success or failure. + * If the report does not exist then this method returns success. ++ * The function always allows user interaction. To change the behavior, ++ * use pk_offline_clear_results_with_flags(). + * + * Return value: %TRUE for success, else %FALSE and @error set + * +@@ -148,6 +179,25 @@ pk_offline_cancel (GCancellable *cancellable, GError **error) + **/ + gboolean + pk_offline_clear_results (GCancellable *cancellable, GError **error) ++{ ++ return pk_offline_clear_results_with_flags (PK_OFFLINE_FLAGS_INTERACTIVE, cancellable, error); ++} ++ ++/** ++ * pk_offline_clear_results_with_flags: ++ * @flags: bit-or of #PkOfflineFlags ++ * @cancellable: A #GCancellable or %NULL ++ * @error: A #GError or %NULL ++ * ++ * Clears the last offline operation report, which may be success or failure. ++ * If the report does not exist then this method returns success. ++ * ++ * Return value: %TRUE for success, else %FALSE and @error set ++ * ++ * Since: 1.2.5 ++ **/ ++gboolean ++pk_offline_clear_results_with_flags (PkOfflineFlags flags, GCancellable *cancellable, GError **error) + { + g_autoptr(GDBusConnection) connection = NULL; + g_autoptr(GVariant) res = NULL; +@@ -164,7 +214,7 @@ pk_offline_clear_results (GCancellable *cancellable, GError **error) + "ClearResults", + NULL, + NULL, +- G_DBUS_CALL_FLAGS_NONE, ++ pk_offline_flags_to_gdbus_call_flags (flags), + -1, + cancellable, + error); +@@ -181,6 +231,8 @@ pk_offline_clear_results (GCancellable *cancellable, GError **error) + * + * Triggers the offline update so that the next reboot will perform the + * pending transaction. ++ * The function always allows user interaction. To change the behavior, ++ * use pk_offline_trigger_with_flags(). + * + * Return value: %TRUE for success, else %FALSE and @error set + * +@@ -188,6 +240,26 @@ pk_offline_clear_results (GCancellable *cancellable, GError **error) + **/ + gboolean + pk_offline_trigger (PkOfflineAction action, GCancellable *cancellable, GError **error) ++{ ++ return pk_offline_trigger_with_flags (action, PK_OFFLINE_FLAGS_INTERACTIVE, cancellable, error); ++} ++ ++/** ++ * pk_offline_trigger_with_flags: ++ * @action: a #PkOfflineAction, e.g. %PK_OFFLINE_ACTION_REBOOT ++ * @flags: bit-or of #PkOfflineFlags ++ * @cancellable: A #GCancellable or %NULL ++ * @error: A #GError or %NULL ++ * ++ * Triggers the offline update so that the next reboot will perform the ++ * pending transaction. ++ * ++ * Return value: %TRUE for success, else %FALSE and @error set ++ * ++ * Since: 1.2.5 ++ **/ ++gboolean ++pk_offline_trigger_with_flags (PkOfflineAction action, PkOfflineFlags flags, GCancellable *cancellable, GError **error) + { + const gchar *tmp; + g_autoptr(GDBusConnection) connection = NULL; +@@ -206,7 +278,7 @@ pk_offline_trigger (PkOfflineAction action, GCancellable *cancellable, GError ** + "Trigger", + g_variant_new ("(s)", tmp), + NULL, +- G_DBUS_CALL_FLAGS_NONE, ++ pk_offline_flags_to_gdbus_call_flags (flags), + -1, + cancellable, + error); +@@ -223,6 +295,8 @@ pk_offline_trigger (PkOfflineAction action, GCancellable *cancellable, GError ** + * + * Triggers the offline system upgrade so that the next reboot will perform the + * pending transaction. ++ * The function always allows user interaction. To change the behavior, ++ * use pk_offline_trigger_upgrade_with_flags(). + * + * Return value: %TRUE for success, else %FALSE and @error set + * +@@ -230,6 +304,26 @@ pk_offline_trigger (PkOfflineAction action, GCancellable *cancellable, GError ** + **/ + gboolean + pk_offline_trigger_upgrade (PkOfflineAction action, GCancellable *cancellable, GError **error) ++{ ++ return pk_offline_trigger_upgrade_with_flags (action, PK_OFFLINE_FLAGS_INTERACTIVE, cancellable, error); ++} ++ ++/** ++ * pk_offline_trigger_upgrade_with_flags: ++ * @action: a #PkOfflineAction, e.g. %PK_OFFLINE_ACTION_REBOOT ++ * @flags: bit-or of #PkOfflineFlags ++ * @cancellable: A #GCancellable or %NULL ++ * @error: A #GError or %NULL ++ * ++ * Triggers the offline system upgrade so that the next reboot will perform the ++ * pending transaction. ++ * ++ * Return value: %TRUE for success, else %FALSE and @error set ++ * ++ * Since: 1.2.5 ++ **/ ++gboolean ++pk_offline_trigger_upgrade_with_flags (PkOfflineAction action, PkOfflineFlags flags, GCancellable *cancellable, GError **error) + { + const gchar *tmp; + g_autoptr(GDBusConnection) connection = NULL; +@@ -248,7 +342,7 @@ pk_offline_trigger_upgrade (PkOfflineAction action, GCancellable *cancellable, G + "TriggerUpgrade", + g_variant_new ("(s)", tmp), + NULL, +- G_DBUS_CALL_FLAGS_NONE, ++ pk_offline_flags_to_gdbus_call_flags (flags), + -1, + cancellable, + error); +diff --git a/lib/packagekit-glib2/pk-offline.h b/lib/packagekit-glib2/pk-offline.h +index e85179823..943e9a13b 100644 +--- a/lib/packagekit-glib2/pk-offline.h ++++ b/lib/packagekit-glib2/pk-offline.h +@@ -71,6 +71,21 @@ typedef enum + PK_OFFLINE_ERROR_LAST + } PkOfflineError; - /* -@@ -1440,7 +1466,7 @@ pk_client_method_cb (GObject *source_object, - return; - } ++/** ++ * PkOfflineFlags: ++ * @PK_OFFLINE_FLAGS_NONE: No specific flag ++ * @PK_OFFLINE_FLAGS_INTERACTIVE: Run the action in an interactive mode, allowing polkit authentication dialogs ++ * ++ * Flags to be used for the method invocations. ++ * ++ * Since: 1.2.5 ++ */ ++typedef enum ++{ ++ PK_OFFLINE_FLAGS_NONE = 0, ++ PK_OFFLINE_FLAGS_INTERACTIVE = 1 << 0 ++} PkOfflineFlags; ++ + GQuark pk_offline_error_quark (void); + const gchar *pk_offline_action_to_string (PkOfflineAction action); + PkOfflineAction pk_offline_action_from_string (const gchar *action); +@@ -92,14 +107,30 @@ PkResults *pk_offline_get_results (GError **error); + guint64 pk_offline_get_results_mtime (GError **error); + gboolean pk_offline_cancel (GCancellable *cancellable, + GError **error); ++gboolean pk_offline_cancel_with_flags (PkOfflineFlags flags, ++ GCancellable *cancellable, ++ GError **error); + gboolean pk_offline_clear_results (GCancellable *cancellable, + GError **error); ++gboolean pk_offline_clear_results_with_flags ++ (PkOfflineFlags flags, ++ GCancellable *cancellable, ++ GError **error); + gboolean pk_offline_trigger (PkOfflineAction action, + GCancellable *cancellable, + GError **error); ++gboolean pk_offline_trigger_with_flags (PkOfflineAction action, ++ PkOfflineFlags flags, ++ GCancellable *cancellable, ++ GError **error); + gboolean pk_offline_trigger_upgrade (PkOfflineAction action, + GCancellable *cancellable, + GError **error); ++gboolean pk_offline_trigger_upgrade_with_flags ++ (PkOfflineAction action, ++ PkOfflineFlags flags, ++ GCancellable *cancellable, ++ GError **error); -- /* wait for ::Finished() */ -+ /* wait for ::Finished() or notify::g-name-owner (if the daemon disappears) */ - } + G_END_DECLS - /* -@@ -4551,6 +4577,9 @@ pk_client_get_progress_state_finish (PkClientState *state, const GError *error) - g_signal_handlers_disconnect_by_func (state->proxy, - G_CALLBACK (pk_client_signal_cb), - state); -+ g_signal_handlers_disconnect_by_func (state->proxy, -+ G_CALLBACK (pk_client_notify_name_owner_cb), -+ state); - g_object_unref (G_OBJECT (state->proxy)); - } +diff --git a/lib/packagekit-glib2/pk-test-daemon.c b/lib/packagekit-glib2/pk-test-daemon.c +index efa762077..b2917b07d 100644 +--- a/lib/packagekit-glib2/pk-test-daemon.c ++++ b/lib/packagekit-glib2/pk-test-daemon.c +@@ -154,7 +154,7 @@ pk_test_offline_func (void) + g_assert_cmpstr (data, ==, "powertop;1.8-1.fc8;i386;fedora"); --- -2.30.2 - - -From 7c5fbc921b83321f3e1e56fe24ab1d0840de35ab Mon Sep 17 00:00:00 2001 -From: Philip Withnall <pwithn...@endlessos.org> -Date: Fri, 19 Mar 2021 22:51:01 +0000 -Subject: [PATCH 2/2] packagekit-glib2: Cancel a transaction if calling Cancel - fails - -If calling the `Cancel()` D-Bus method on a transaction fails, cancel -the client-side state anyway, to prevent the client from waiting forever -on a response which is unlikely to come. - -Spotted in https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1118. - -Signed-off-by: Philip Withnall <pwithn...@endlessos.org> ---- - lib/packagekit-glib2/pk-client.c | 10 +++++++--- - 1 file changed, 7 insertions(+), 3 deletions(-) - -diff --git a/lib/packagekit-glib2/pk-client.c b/lib/packagekit-glib2/pk-client.c -index 67df1c5ea..eba4ee47d 100644 ---- a/lib/packagekit-glib2/pk-client.c -+++ b/lib/packagekit-glib2/pk-client.c -@@ -569,14 +569,18 @@ pk_client_cancel_cb (GObject *source_object, - gpointer user_data) - { - GDBusProxy *proxy = G_DBUS_PROXY (source_object); -+ PkClientState *state = user_data; - g_autoptr(GError) error = NULL; - g_autoptr(GVariant) value = NULL; - - /* get the result */ - value = g_dbus_proxy_call_finish (proxy, res, &error); - if (value == NULL) { -- /* there's not really a lot we can do here */ -- g_warning ("failed to cancel: %s", error->message); -+ /* Instructing the daemon to cancel failed, so just return an -+ * error to the client so they don???t wait forever. */ -+ g_debug ("failed to cancel: %s", error->message); -+ g_prefix_error (&error, "Failed to cancel: "); -+ pk_client_state_finish (state, error); - return; - } - } -@@ -600,7 +604,7 @@ pk_client_cancellable_cancel_cb (GCancellable *cancellable, PkClientState *state - G_DBUS_CALL_FLAGS_NONE, - PK_CLIENT_DBUS_METHOD_TIMEOUT, - NULL, -- pk_client_cancel_cb, NULL); -+ pk_client_cancel_cb, state); - } + /* trigger */ +- ret = pk_offline_trigger (PK_OFFLINE_ACTION_REBOOT, NULL, &error); ++ ret = pk_offline_trigger_with_flags (PK_OFFLINE_ACTION_REBOOT, PK_OFFLINE_FLAGS_INTERACTIVE, NULL, &error); + g_assert_no_error (error); + g_assert (ret); + g_assert (g_file_test (PK_OFFLINE_PREPARED_FILENAME, G_FILE_TEST_EXISTS)); +@@ -163,7 +163,7 @@ pk_test_offline_func (void) + g_assert (!g_file_test (PK_OFFLINE_RESULTS_FILENAME, G_FILE_TEST_EXISTS)); - /* --- -2.30.2 - + /* cancel the trigger */ +- ret = pk_offline_cancel (NULL, &error); ++ ret = pk_offline_cancel_with_flags (PK_OFFLINE_FLAGS_INTERACTIVE, NULL, &error); + g_assert_no_error (error); + g_assert (ret); + g_assert (g_file_test (PK_OFFLINE_PREPARED_FILENAME, G_FILE_TEST_EXISTS)); ++++++ PackageKit-1.2.2.tar.xz -> PackageKit-1.2.4.tar.xz ++++++ ++++ 5461 lines of diff (skipped)