Accepting request 929652 from GNOME:Next
OBS-URL: https://build.opensuse.org/request/show/929652 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/PackageKit?expand=0&rev=423
This commit is contained in:
@@ -1,3 +1,60 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Nov 5 11:16:00 UTC 2021 - Bjørn Lie <bjorn.lie@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 <sbrabec@suse.com>
|
||||
|
||||
|
||||
+3
-15
@@ -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 @@ Patch1: PackageKit-systemd-timers.patch
|
||||
Patch2: PackageKit-remove-polkit-rules.patch
|
||||
# PATCH-FIX-OPENSUSE PackageKit-dnf-Add-support-for-AppStream-repodata-basenames-use.patch ngompa13@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 sckang@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 sckang@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 sckang@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 sckang@suse.com -- zypp: Fix crash when search string is NULL
|
||||
Patch12: PackageKit-zypp-fix-crash-with-empty-search-string.patch
|
||||
|
||||
|
||||
@@ -0,0 +1,335 @@
|
||||
From 02354c3a339b7f8d6661731f224e7ccf1fc34ddc Mon Sep 17 00:00:00 2001
|
||||
From: Milan Crha <mcrha@redhat.com>
|
||||
Date: Mon, 13 Sep 2021 19:57:12 +0200
|
||||
Subject: [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.
|
||||
|
||||
Closes https://github.com/PackageKit/PackageKit/issues/504
|
||||
---
|
||||
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) {
|
||||
|
||||
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;
|
||||
|
||||
} 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 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_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)
|
||||
**/
|
||||
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;
|
||||
|
||||
+/**
|
||||
+ * 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);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
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");
|
||||
|
||||
/* 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));
|
||||
|
||||
/* 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));
|
||||
BIN
Binary file not shown.
@@ -1,11 +0,0 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQEzBAABCAAdFiEEFj61ARkiXbPfj0nqF6y6jfqXDhcFAl+f6YAACgkQF6y6jfqX
|
||||
Dhe+yAf+ModczNbHzaZZDxyqZYdeqF27MK9i21g6/B2Rtt9Fn9U7Fwr8qFMYUf2G
|
||||
qF+2zRv4QDj875lPJCKW5iCZ5U1vDxC3pLWsOhUiakxrTxfDtyZT6Q9Ufob/4cJd
|
||||
KtB99TPvUw5z784FDl1vztaZeIk2bacWFX7vdVE2e24+Q9JfJjOoNOuYM8fuyKGP
|
||||
nKYIL27dDC5mQuK0EQzij+PXvJZhZD5XsZgQ+VHjKq4IBHgspGr4/0ciVnkUH6Wt
|
||||
K6LMbZUkstqxhWiNnH+IRIknbNnw6Km8K4rluPKHEm/84Cq9abXJs7oBddbIxJ9+
|
||||
KIv2MRplBgDtOk9IHCyJzMcbAu7YyQ==
|
||||
=IoBE
|
||||
-----END PGP SIGNATURE-----
|
||||
BIN
Binary file not shown.
@@ -0,0 +1,11 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQEzBAABCAAdFiEEFj61ARkiXbPfj0nqF6y6jfqXDhcFAmEDt54ACgkQF6y6jfqX
|
||||
Dhcaywf9F2ti/Keqhoa2qZ0gvOkPmhRuayrV/7lMqb+qFrHkxfUb2XhcPYb7jABm
|
||||
Q+nA05YVM3gViIMVOgu8ltVQLaK8/YZLebZcV49jdmNRqvPVtBsyXzE9tR8I8jwE
|
||||
KQNLGulLXRsSF5zE2fj9a4FCDtjAJ2NjYyu9QdLXk2DEHG2G9+nHKPmF1oY7TF13
|
||||
JqLjUyWnyDG5xNsY55QIwV3LVrFYE4B7zKr2qcqJWSCJWsOEziy6xirSNOQRwgmH
|
||||
Hl7e7qfFdG+XSacnCcBx6qUG5X4WzFX+eQ8jx/vBX5J735mS0syUScljC1moq+k4
|
||||
h1+gdK60PHzGyTEYvAnJUS9Wg6+YaA==
|
||||
=WCIl
|
||||
-----END PGP SIGNATURE-----
|
||||
@@ -1,184 +0,0 @@
|
||||
From b2452c2d0023aad6be0751f9785e20f34bed6887 Mon Sep 17 00:00:00 2001
|
||||
From: Philip Withnall <pwithnall@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
|
||||
|
||||
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.
|
||||
|
||||
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 <pwithnall@endlessos.org>
|
||||
---
|
||||
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);
|
||||
|
||||
/**
|
||||
* 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));
|
||||
}
|
||||
|
||||
@@ -1389,6 +1399,19 @@ pk_client_signal_cb (GDBusProxy *proxy,
|
||||
return;
|
||||
}
|
||||
|
||||
+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);
|
||||
+}
|
||||
+
|
||||
/*
|
||||
* pk_client_proxy_connect:
|
||||
**/
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1440,7 +1466,7 @@ pk_client_method_cb (GObject *source_object,
|
||||
return;
|
||||
}
|
||||
|
||||
- /* wait for ::Finished() */
|
||||
+ /* wait for ::Finished() or notify::g-name-owner (if the daemon disappears) */
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
--
|
||||
2.30.2
|
||||
|
||||
|
||||
From 7c5fbc921b83321f3e1e56fe24ab1d0840de35ab Mon Sep 17 00:00:00 2001
|
||||
From: Philip Withnall <pwithnall@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 <pwithnall@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);
|
||||
}
|
||||
|
||||
/*
|
||||
--
|
||||
2.30.2
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
From 7d89261b61b8536531ef2ae85c0c631d8c97f723 Mon Sep 17 00:00:00 2001
|
||||
From: Neal Gompa <ngompa13@gmail.com>
|
||||
Date: Fri, 29 Jan 2021 13:41:06 -0500
|
||||
Subject: [PATCH] dnf: Add support for coercing upgrade to distupgrade
|
||||
|
||||
Some distributions (particularly rolling release distributions)
|
||||
prefer that normal "upgrade" actions actually trigger the distupgrade
|
||||
method in the package manager. This change enables that if the
|
||||
installed distribution release package specifies that this
|
||||
behavior must occur.
|
||||
---
|
||||
backends/dnf/pk-backend-dnf.c | 28 +++++++++++++++++++++++++++-
|
||||
1 file changed, 27 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/backends/dnf/pk-backend-dnf.c b/backends/dnf/pk-backend-dnf.c
|
||||
index 74d35c34c..05f354afe 100644
|
||||
--- a/backends/dnf/pk-backend-dnf.c
|
||||
+++ b/backends/dnf/pk-backend-dnf.c
|
||||
@@ -823,6 +823,28 @@ dnf_utils_run_query_with_newest_filter (DnfSack *sack, HyQuery query)
|
||||
return results;
|
||||
}
|
||||
|
||||
+static gboolean
|
||||
+dnf_utils_force_distupgrade_on_upgrade (DnfSack *sack)
|
||||
+{
|
||||
+ g_autoptr(GPtrArray) plist = NULL;
|
||||
+ gint candidates;
|
||||
+ const gchar *distroverpkg_names[] = { "system-release", "distribution-release", NULL };
|
||||
+ const gchar *distupgrade_provides[] = { "system-upgrade(dsync)", "product-upgrade() = dup", NULL };
|
||||
+ HyQuery query_tmp = hy_query_create (sack);
|
||||
+
|
||||
+ hy_query_filter (query_tmp, HY_PKG_REPONAME, HY_EQ, HY_SYSTEM_REPO_NAME);
|
||||
+ hy_query_filter_provides_in (query_tmp, (gchar**) distroverpkg_names);
|
||||
+ hy_query_filter_provides_in (query_tmp, (gchar**) distupgrade_provides);
|
||||
+
|
||||
+ plist = hy_query_run (query_tmp);
|
||||
+ candidates = plist->len;
|
||||
+ hy_query_free (query_tmp);
|
||||
+
|
||||
+ if (candidates > 0)
|
||||
+ return TRUE;
|
||||
+ return FALSE;
|
||||
+}
|
||||
+
|
||||
static GPtrArray *
|
||||
dnf_utils_run_query_with_filters (PkBackendJob *job, DnfSack *sack,
|
||||
HyQuery query, PkBitfield filters)
|
||||
@@ -1001,7 +1023,11 @@ pk_backend_search_thread (PkBackendJob *job, GVariant *params, gpointer user_dat
|
||||
dnf_sack_set_installonly_limit (sack, dnf_context_get_installonly_limit (job_data->context));
|
||||
|
||||
job_data->goal = hy_goal_create (sack);
|
||||
- hy_goal_upgrade_all (job_data->goal);
|
||||
+ if (dnf_utils_force_distupgrade_on_upgrade (sack)) {
|
||||
+ hy_goal_distupgrade_all (job_data->goal);
|
||||
+ } else {
|
||||
+ hy_goal_upgrade_all (job_data->goal);
|
||||
+ }
|
||||
ret = dnf_goal_depsolve (job_data->goal, DNF_ALLOW_UNINSTALL, &error);
|
||||
if (!ret) {
|
||||
pk_backend_job_error_code (job, error->code, "%s", error->message);
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
From ecd4a969939855350930511516ae20584bda7fa7 Fri Jun 11 18:53:18 2021 +0200
|
||||
From: Dario Faggioli <dfaggioli@suse.com>
|
||||
Date: Fri, Jun 11 18:53:18 2021 +0200
|
||||
|
||||
dnf-backend: honor install_weak_deps=False if it is there
|
||||
|
||||
Currently, even if we have "install_weak_deps=False" in
|
||||
/etc/dnf/dnf.conf, `pkcon install` still tries to install all
|
||||
the recommended packages.
|
||||
|
||||
For avoiding that, we need to inform libdnf that we will
|
||||
solve the goal of the transaction ourselves (by means of the
|
||||
dnf_transaction_set_dont_solve_goal() API) and then explicitly
|
||||
set the flag for ignoring the weak dependencies.
|
||||
|
||||
This fixes issue #486 and also solve
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1955484
|
||||
|
||||
diff -Nru PackageKit-1.2.2_patch/backends/dnf/pk-backend-dnf.c PackageKit-1.2.2_patch2/backends/dnf/pk-backend-dnf.c
|
||||
--- PackageKit-1.2.2_patch/backends/dnf/pk-backend-dnf.c 2021-06-10 17:55:04.016246418 +0200
|
||||
+++ PackageKit-1.2.2_patch2/backends/dnf/pk-backend-dnf.c 2021-06-12 23:39:35.829973392 +0200
|
||||
@@ -932,6 +932,7 @@
|
||||
gboolean ret;
|
||||
DnfDb *db;
|
||||
DnfState *state_local;
|
||||
+ DnfGoalActions flags;
|
||||
GPtrArray *installs = NULL;
|
||||
GPtrArray *pkglist = NULL;
|
||||
HyQuery query = NULL;
|
||||
@@ -1028,7 +1029,10 @@
|
||||
} else {
|
||||
hy_goal_upgrade_all (job_data->goal);
|
||||
}
|
||||
- ret = dnf_goal_depsolve (job_data->goal, DNF_ALLOW_UNINSTALL, &error);
|
||||
+ flags = DNF_ALLOW_UNINSTALL;
|
||||
+ if (!dnf_context_get_install_weak_deps())
|
||||
+ flags |= DNF_IGNORE_WEAK_DEPS;
|
||||
+ ret = dnf_goal_depsolve (job_data->goal, flags, &error);
|
||||
if (!ret) {
|
||||
pk_backend_job_error_code (job, error->code, "%s", error->message);
|
||||
goto out;
|
||||
@@ -2541,6 +2545,7 @@
|
||||
GError **error)
|
||||
{
|
||||
DnfState *state_local;
|
||||
+ DnfGoalActions dnf_flags = DNF_ALLOW_UNINSTALL;
|
||||
PkBackendDnfJobData *job_data = pk_backend_job_get_user_data (job);
|
||||
gboolean ret = TRUE;
|
||||
/* allow downgrades for all transaction types */
|
||||
@@ -2569,6 +2574,15 @@
|
||||
dnf_transaction_set_flags (job_data->transaction, flags);
|
||||
|
||||
state_local = dnf_state_get_child (state);
|
||||
+
|
||||
+ /* we solve the goal ourselves, so we can deal with flags */
|
||||
+ dnf_transaction_set_dont_solve_goal(job_data->transaction, TRUE);
|
||||
+ if (!dnf_context_get_install_weak_deps ())
|
||||
+ dnf_flags |= DNF_IGNORE_WEAK_DEPS;
|
||||
+ ret = dnf_goal_depsolve (job_data->goal, dnf_flags, error);
|
||||
+ if (!ret)
|
||||
+ return FALSE;
|
||||
+
|
||||
ret = dnf_transaction_depsolve (job_data->transaction,
|
||||
job_data->goal,
|
||||
state_local,
|
||||
@@ -1,272 +0,0 @@
|
||||
From ff0181389dc281effbd274f6e1ae01e8905ddf8a Mon Sep 17 00:00:00 2001
|
||||
From: Richard Hughes <richard@hughsie.com>
|
||||
Date: Thu, 19 Nov 2020 19:15:08 +0000
|
||||
Subject: [PATCH] Increase the number of packages that can be processed in one
|
||||
transaction
|
||||
|
||||
Ohh TeX Live, you taunt me.
|
||||
|
||||
Fixes https://github.com/hughsie/PackageKit/issues/442
|
||||
---
|
||||
src/pk-transaction.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/pk-transaction.c b/src/pk-transaction.c
|
||||
index 7cb1ced60..6167f0473 100644
|
||||
--- a/src/pk-transaction.c
|
||||
+++ b/src/pk-transaction.c
|
||||
@@ -77,7 +77,7 @@ static gboolean pk_transaction_is_supported_content_type (PkTransaction *transac
|
||||
#define PK_TRANSACTION_MAX_ITEMS_TO_RESOLVE 10000
|
||||
|
||||
/* maximum number of packages that can be processed in one go */
|
||||
-#define PK_TRANSACTION_MAX_PACKAGES_TO_PROCESS 5200
|
||||
+#define PK_TRANSACTION_MAX_PACKAGES_TO_PROCESS 10000
|
||||
|
||||
struct PkTransactionPrivate
|
||||
{
|
||||
From ac5c8660a82b6df96c9895eb97d242af3b6dac72 Mon Sep 17 00:00:00 2001
|
||||
From: Nate Graham <nate@kde.org>
|
||||
Date: Mon, 15 Mar 2021 11:54:14 -0600
|
||||
Subject: [PATCH] Remove large transaction size sanity check
|
||||
|
||||
Some distros regularly push updates of tens of thousands of packages,
|
||||
causing users to run into this "too many packages" error. This is not
|
||||
really an error, it's just that the sanity check didn't anticipate that
|
||||
the world might be insane. :) Let's remove it to avoid these issues.
|
||||
---
|
||||
src/pk-transaction.c | 131 +------------------------------------------
|
||||
1 file changed, 2 insertions(+), 129 deletions(-)
|
||||
|
||||
diff --git a/src/pk-transaction.c b/src/pk-transaction.c
|
||||
index 0724e5f25..258abb2cb 100644
|
||||
--- a/src/pk-transaction.c
|
||||
+++ b/src/pk-transaction.c
|
||||
@@ -76,9 +76,6 @@ static gboolean pk_transaction_is_supported_content_type (PkTransaction *transac
|
||||
/* maximum number of items that can be resolved in one go */
|
||||
#define PK_TRANSACTION_MAX_ITEMS_TO_RESOLVE 10000
|
||||
|
||||
-/* maximum number of packages that can be processed in one go */
|
||||
-#define PK_TRANSACTION_MAX_PACKAGES_TO_PROCESS 10000
|
||||
-
|
||||
struct PkTransactionPrivate
|
||||
{
|
||||
PkRoleEnum role;
|
||||
@@ -2791,18 +2788,6 @@ pk_transaction_download_packages (PkTransaction *transaction,
|
||||
goto out;
|
||||
}
|
||||
|
||||
- /* check for length sanity */
|
||||
- length = g_strv_length (package_ids);
|
||||
- if (length > PK_TRANSACTION_MAX_PACKAGES_TO_PROCESS) {
|
||||
- g_set_error (&error,
|
||||
- PK_TRANSACTION_ERROR,
|
||||
- PK_TRANSACTION_ERROR_NUMBER_OF_PACKAGES_INVALID,
|
||||
- "Too many packages to process (%i/%i)",
|
||||
- length, PK_TRANSACTION_MAX_PACKAGES_TO_PROCESS);
|
||||
- pk_transaction_set_state (transaction, PK_TRANSACTION_STATE_ERROR);
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
/* check package_ids */
|
||||
ret = pk_package_ids_check (package_ids);
|
||||
if (!ret) {
|
||||
@@ -2901,18 +2886,6 @@ pk_transaction_depends_on (PkTransaction *transaction,
|
||||
goto out;
|
||||
}
|
||||
|
||||
- /* check for length sanity */
|
||||
- length = g_strv_length (package_ids);
|
||||
- if (length > PK_TRANSACTION_MAX_PACKAGES_TO_PROCESS) {
|
||||
- g_set_error (&error,
|
||||
- PK_TRANSACTION_ERROR,
|
||||
- PK_TRANSACTION_ERROR_NUMBER_OF_PACKAGES_INVALID,
|
||||
- "Too many packages to process (%i/%i)",
|
||||
- length, PK_TRANSACTION_MAX_PACKAGES_TO_PROCESS);
|
||||
- pk_transaction_set_state (transaction, PK_TRANSACTION_STATE_ERROR);
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
/* check package_ids */
|
||||
ret = pk_package_ids_check (package_ids);
|
||||
if (!ret) {
|
||||
@@ -2965,18 +2938,6 @@ pk_transaction_get_details (PkTransaction *transaction,
|
||||
goto out;
|
||||
}
|
||||
|
||||
- /* check for length sanity */
|
||||
- length = g_strv_length (package_ids);
|
||||
- if (length > PK_TRANSACTION_MAX_PACKAGES_TO_PROCESS) {
|
||||
- g_set_error (&error,
|
||||
- PK_TRANSACTION_ERROR,
|
||||
- PK_TRANSACTION_ERROR_NUMBER_OF_PACKAGES_INVALID,
|
||||
- "Too many packages to process (%i/%i)",
|
||||
- length, PK_TRANSACTION_MAX_PACKAGES_TO_PROCESS);
|
||||
- pk_transaction_set_state (transaction, PK_TRANSACTION_STATE_ERROR);
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
/* check package_ids */
|
||||
ret = pk_package_ids_check (package_ids);
|
||||
if (!ret) {
|
||||
@@ -3030,7 +2991,7 @@ pk_transaction_get_details_local (PkTransaction *transaction,
|
||||
goto out;
|
||||
}
|
||||
|
||||
- /* check for length sanity */
|
||||
+ /* check for empty package list */
|
||||
length = g_strv_length (full_paths);
|
||||
if (length == 0) {
|
||||
g_set_error_literal (&error,
|
||||
@@ -3040,14 +3001,6 @@ pk_transaction_get_details_local (PkTransaction *transaction,
|
||||
pk_transaction_set_state (transaction, PK_TRANSACTION_STATE_ERROR);
|
||||
goto out;
|
||||
}
|
||||
- if (length > PK_TRANSACTION_MAX_PACKAGES_TO_PROCESS) {
|
||||
- g_set_error (&error,
|
||||
- PK_TRANSACTION_ERROR,
|
||||
- PK_TRANSACTION_ERROR_NUMBER_OF_PACKAGES_INVALID,
|
||||
- "Too many files to process (%i/%i)", length, PK_TRANSACTION_MAX_PACKAGES_TO_PROCESS);
|
||||
- pk_transaction_set_state (transaction, PK_TRANSACTION_STATE_ERROR);
|
||||
- goto out;
|
||||
- }
|
||||
|
||||
/* check all files exists and are valid */
|
||||
length = g_strv_length (full_paths);
|
||||
@@ -3129,7 +3082,7 @@ pk_transaction_get_files_local (PkTransaction *transaction,
|
||||
goto out;
|
||||
}
|
||||
|
||||
- /* check for length sanity */
|
||||
+ /* check for empty package list */
|
||||
length = g_strv_length (full_paths);
|
||||
if (length == 0) {
|
||||
g_set_error_literal (&error,
|
||||
@@ -3139,14 +3092,6 @@ pk_transaction_get_files_local (PkTransaction *transaction,
|
||||
pk_transaction_set_state (transaction, PK_TRANSACTION_STATE_ERROR);
|
||||
goto out;
|
||||
}
|
||||
- if (length > PK_TRANSACTION_MAX_PACKAGES_TO_PROCESS) {
|
||||
- g_set_error (&error,
|
||||
- PK_TRANSACTION_ERROR,
|
||||
- PK_TRANSACTION_ERROR_NUMBER_OF_PACKAGES_INVALID,
|
||||
- "Too many files to process (%i/%i)", length, PK_TRANSACTION_MAX_PACKAGES_TO_PROCESS);
|
||||
- pk_transaction_set_state (transaction, PK_TRANSACTION_STATE_ERROR);
|
||||
- goto out;
|
||||
- }
|
||||
|
||||
/* check all files exists and are valid */
|
||||
length = g_strv_length (full_paths);
|
||||
@@ -3256,18 +3201,6 @@ pk_transaction_get_files (PkTransaction *transaction,
|
||||
goto out;
|
||||
}
|
||||
|
||||
- /* check for length sanity */
|
||||
- length = g_strv_length (package_ids);
|
||||
- if (length > PK_TRANSACTION_MAX_PACKAGES_TO_PROCESS) {
|
||||
- g_set_error (&error,
|
||||
- PK_TRANSACTION_ERROR,
|
||||
- PK_TRANSACTION_ERROR_NUMBER_OF_PACKAGES_INVALID,
|
||||
- "Too many packages to process (%i/%i)",
|
||||
- length, PK_TRANSACTION_MAX_PACKAGES_TO_PROCESS);
|
||||
- pk_transaction_set_state (transaction, PK_TRANSACTION_STATE_ERROR);
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
/* check package_ids */
|
||||
ret = pk_package_ids_check (package_ids);
|
||||
if (!ret) {
|
||||
@@ -3466,18 +3399,6 @@ pk_transaction_required_by (PkTransaction *transaction,
|
||||
goto out;
|
||||
}
|
||||
|
||||
- /* check for length sanity */
|
||||
- length = g_strv_length (package_ids);
|
||||
- if (length > PK_TRANSACTION_MAX_PACKAGES_TO_PROCESS) {
|
||||
- g_set_error (&error,
|
||||
- PK_TRANSACTION_ERROR,
|
||||
- PK_TRANSACTION_ERROR_NUMBER_OF_PACKAGES_INVALID,
|
||||
- "Too many packages to process (%i/%i)",
|
||||
- length, PK_TRANSACTION_MAX_PACKAGES_TO_PROCESS);
|
||||
- pk_transaction_set_state (transaction, PK_TRANSACTION_STATE_ERROR);
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
/* check package_ids */
|
||||
ret = pk_package_ids_check (package_ids);
|
||||
if (!ret) {
|
||||
@@ -3530,18 +3451,6 @@ pk_transaction_get_update_detail (PkTransaction *transaction,
|
||||
goto out;
|
||||
}
|
||||
|
||||
- /* check for length sanity */
|
||||
- length = g_strv_length (package_ids);
|
||||
- if (length > PK_TRANSACTION_MAX_PACKAGES_TO_PROCESS) {
|
||||
- g_set_error (&error,
|
||||
- PK_TRANSACTION_ERROR,
|
||||
- PK_TRANSACTION_ERROR_NUMBER_OF_PACKAGES_INVALID,
|
||||
- "Too many packages to process (%i/%i)",
|
||||
- length, PK_TRANSACTION_MAX_PACKAGES_TO_PROCESS);
|
||||
- pk_transaction_set_state (transaction, PK_TRANSACTION_STATE_ERROR);
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
/* check package_ids */
|
||||
ret = pk_package_ids_check (package_ids);
|
||||
if (!ret) {
|
||||
@@ -3770,18 +3679,6 @@ pk_transaction_install_packages (PkTransaction *transaction,
|
||||
goto out;
|
||||
}
|
||||
|
||||
- /* check for length sanity */
|
||||
- length = g_strv_length (package_ids);
|
||||
- if (length > PK_TRANSACTION_MAX_PACKAGES_TO_PROCESS) {
|
||||
- g_set_error (&error,
|
||||
- PK_TRANSACTION_ERROR,
|
||||
- PK_TRANSACTION_ERROR_NUMBER_OF_PACKAGES_INVALID,
|
||||
- "Too many packages to process (%i/%i)",
|
||||
- length, PK_TRANSACTION_MAX_PACKAGES_TO_PROCESS);
|
||||
- pk_transaction_set_state (transaction, PK_TRANSACTION_STATE_ERROR);
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
/* check package_ids */
|
||||
ret = pk_package_ids_check (package_ids);
|
||||
if (!ret) {
|
||||
@@ -3969,18 +3866,6 @@ pk_transaction_remove_packages (PkTransaction *transaction,
|
||||
goto out;
|
||||
}
|
||||
|
||||
- /* check for length sanity */
|
||||
- length = g_strv_length (package_ids);
|
||||
- if (length > PK_TRANSACTION_MAX_PACKAGES_TO_PROCESS) {
|
||||
- g_set_error (&error,
|
||||
- PK_TRANSACTION_ERROR,
|
||||
- PK_TRANSACTION_ERROR_NUMBER_OF_PACKAGES_INVALID,
|
||||
- "Too many packages to process (%i/%i)",
|
||||
- length, PK_TRANSACTION_MAX_PACKAGES_TO_PROCESS);
|
||||
- pk_transaction_set_state (transaction, PK_TRANSACTION_STATE_ERROR);
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
/* check package_ids */
|
||||
ret = pk_package_ids_check (package_ids);
|
||||
if (!ret) {
|
||||
@@ -4659,18 +4544,6 @@ pk_transaction_update_packages (PkTransaction *transaction,
|
||||
goto out;
|
||||
}
|
||||
|
||||
- /* check for length sanity */
|
||||
- length = g_strv_length (package_ids);
|
||||
- if (length > PK_TRANSACTION_MAX_PACKAGES_TO_PROCESS) {
|
||||
- g_set_error (&error,
|
||||
- PK_TRANSACTION_ERROR,
|
||||
- PK_TRANSACTION_ERROR_NUMBER_OF_PACKAGES_INVALID,
|
||||
- "Too many packages to process (%i/%i)",
|
||||
- length, PK_TRANSACTION_MAX_PACKAGES_TO_PROCESS);
|
||||
- pk_transaction_set_state (transaction, PK_TRANSACTION_STATE_ERROR);
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
/* check package_ids */
|
||||
ret = pk_package_ids_check (package_ids);
|
||||
if (!ret) {
|
||||
@@ -1,33 +0,0 @@
|
||||
From ff092d0e5742f02ab1aeeafefeaaa558d32ab0b0 Mon Sep 17 00:00:00 2001
|
||||
From: Jonathan Kang <jonathankang@gnome.org>
|
||||
Date: Tue, 1 Dec 2020 16:18:12 +0800
|
||||
Subject: [PATCH] Revert "Revert "zypp: Clean up temporary files when PK
|
||||
quits""
|
||||
|
||||
packagekitd.service will be stopped on system shutdown and by manually
|
||||
doing so. Thus the main process will be killed eventually and we have
|
||||
to manually clean those tmporary libzypp files.
|
||||
|
||||
This reverts commit d8dd484ddfcea4750495fa92dcd2f580149432e7.
|
||||
|
||||
https://bugzilla.opensuse.org/show_bug.cgi?id=1169739
|
||||
---
|
||||
backends/zypp/pk-backend-zypp.cpp | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp
|
||||
index b1ce76915..9404abb1a 100644
|
||||
--- a/backends/zypp/pk-backend-zypp.cpp
|
||||
+++ b/backends/zypp/pk-backend-zypp.cpp
|
||||
@@ -1840,6 +1840,8 @@ pk_backend_destroy (PkBackend *backend)
|
||||
{
|
||||
g_debug ("zypp_backend_destroy");
|
||||
|
||||
+ filesystem::recursive_rmdir (zypp::myTmpDir ());
|
||||
+
|
||||
g_free (_repoName);
|
||||
delete priv;
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
From 3efa0c5243c1ee762cee0d21af1052e4cc245f9d Mon Sep 17 00:00:00 2001
|
||||
From: Jonathan Kang <jonathankang@gnome.org>
|
||||
Date: Fri, 26 Feb 2021 14:10:48 +0800
|
||||
Subject: [PATCH] zypp: Make sure pool is initialized at the beginning of some
|
||||
methods
|
||||
|
||||
Methods include GetDetails, GetFiles and GetUpdateDetail.
|
||||
|
||||
https://bugzilla.opensuse.org/show_bug.cgi?id=1180597
|
||||
---
|
||||
backends/zypp/pk-backend-zypp.cpp | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp
|
||||
index 4941a6b86..6da70348b 100644
|
||||
--- a/backends/zypp/pk-backend-zypp.cpp
|
||||
+++ b/backends/zypp/pk-backend-zypp.cpp
|
||||
@@ -2145,6 +2145,8 @@ backend_get_details_thread (PkBackendJob *job, GVariant *params, gpointer user_d
|
||||
return;
|
||||
}
|
||||
|
||||
+ zypp_build_pool (zypp, true);
|
||||
+
|
||||
pk_backend_job_set_status (job, PK_STATUS_ENUM_QUERY);
|
||||
|
||||
for (uint i = 0; package_ids[i]; i++) {
|
||||
@@ -2633,6 +2635,8 @@ backend_get_update_detail_thread (PkBackendJob *job, GVariant *params, gpointer
|
||||
}
|
||||
pk_backend_job_set_status (job, PK_STATUS_ENUM_QUERY);
|
||||
|
||||
+ zypp_build_pool (zypp, TRUE);
|
||||
+
|
||||
for (uint i = 0; package_ids[i]; i++) {
|
||||
sat::Solvable solvable = zypp_get_package_by_id (package_ids[i]);
|
||||
MIL << package_ids[i] << " " << solvable << endl;
|
||||
@@ -3330,6 +3334,8 @@ backend_get_files_thread (PkBackendJob *job, GVariant *params, gpointer user_dat
|
||||
return;
|
||||
}
|
||||
|
||||
+ zypp_build_pool (zypp, true);
|
||||
+
|
||||
for (uint i = 0; package_ids[i]; i++) {
|
||||
pk_backend_job_set_status (job, PK_STATUS_ENUM_QUERY);
|
||||
sat::Solvable solvable = zypp_get_package_by_id (package_ids[i]);
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
From 1989eb211f881f318b8c0cdf071dfdb3d6b6d784 Mon Sep 17 00:00:00 2001
|
||||
From: Jonathan Kang <jonathankang@gnome.org>
|
||||
Date: Wed, 27 Jan 2021 16:17:36 +0800
|
||||
Subject: [PATCH] zypp: Reset update mode after getting updates
|
||||
|
||||
This fixes the issue that different list of updates were returned
|
||||
when checking for updates in Leap.
|
||||
|
||||
https://bugzilla.opensuse.org/show_bug.cgi?id=1180150
|
||||
---
|
||||
backends/zypp/pk-backend-zypp.cpp | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp
|
||||
index 9404abb1a..4941a6b86 100644
|
||||
--- a/backends/zypp/pk-backend-zypp.cpp
|
||||
+++ b/backends/zypp/pk-backend-zypp.cpp
|
||||
@@ -1249,6 +1249,8 @@ zypp_get_package_updates (string repo, set<PoolItem> &pks)
|
||||
|
||||
if (is_tumbleweed ()) {
|
||||
resolver->setUpgradeMode (FALSE);
|
||||
+ } else {
|
||||
+ resolver->setUpdateMode (FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.29.2
|
||||
|
||||
Reference in New Issue
Block a user