diff --git a/PackageKit-1.2.7.tar.xz b/PackageKit-1.2.7.tar.xz deleted file mode 100644 index 99e23f4bed047a5d4a8cdd26ffc7b0d716dbbc6a..0000000000000000000000000000000000000000 Binary files a/PackageKit-1.2.7.tar.xz and /dev/null differ diff --git a/PackageKit-1.2.8.tar.xz b/PackageKit-1.2.8.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..5e253c65dfe98713308823d4c0cbefcd8d4d27e6 Binary files /dev/null and b/PackageKit-1.2.8.tar.xz differ diff --git a/PackageKit.spec b/PackageKit.spec index 184b11b70cf9d7bba92c66d3c37c969e6566d9ee..7f677f881c5d593ffddafc93a1fd3fa8d7cbf311 100644 --- a/PackageKit.spec +++ b/PackageKit.spec @@ -1,10 +1,10 @@ -%define anolis_release 2 +%define anolis_release 1 %global glib2_version 2.54.0 %global libdnf_version 0.43.1 Summary: Package management service Name: PackageKit -Version: 1.2.7 +Version: 1.2.8 Release: %{anolis_release}%{?dist} License: GPLv2+ and LGPLv2+ URL: http://www.freedesktop.org/software/PackageKit/ @@ -12,6 +12,8 @@ Source0: http://www.freedesktop.org/software/PackageKit/releases/%{name}-%{ver # https://github.com/PackageKit/PackageKit/pull/404 Patch1: package-remove-password-prompt.patch +Patch2: appstream-mark-pk-as-compulsory.patch +Patch3: runtime-warnings.patch # https://github.com/PackageKit/PackageKit/pull/578 # https://github.com/PackageKit/PackageKit/pull/599 @@ -264,6 +266,10 @@ systemctl disable packagekit-offline-update.service > /dev/null 2>&1 || : %doc README AUTHORS NEWS %changelog +* Mon Jul 14 2025 wenyuzifang - 1.2.8-1 +- Updated to version 1.2.8 to fix XXXXXX +- Fixes infinite wait and runtime warnings when backend does not support operations. + * Tue Jul 30 2024 Tingyin Duan - 1.2.7-2 - update to version 1.2.7: - change path of dbus-1/system.d/* @@ -275,4 +281,4 @@ systemctl disable packagekit-offline-update.service > /dev/null 2>&1 || : - Rebuild with python3.11 * Mon Mar 20 2023 happy_orange - 1.2.6-1 -- package init from upstream +- package init from upstream \ No newline at end of file diff --git a/appstream-mark-pk-as-compulsory.patch b/appstream-mark-pk-as-compulsory.patch new file mode 100644 index 0000000000000000000000000000000000000000..d5752603ad6f9f143bf7904dfe6a3ab00802a27d --- /dev/null +++ b/appstream-mark-pk-as-compulsory.patch @@ -0,0 +1,35 @@ +From d8f84f7e0a017e0b4df1e08a2a6be832c9fb3611 Mon Sep 17 00:00:00 2001 +From: Matthias Klumpp +Date: Tue, 21 May 2024 02:33:55 +0200 +Subject: [PATCH] metainfo: Mark PK as compulsory for most desktops + +Ideally, AppStream needs a way to just mark a component as critical for +the system to function and prevent its removal. But this is okay as a +temporary fix. + +Resolves: #759 +--- + data/org.freedesktop.packagekit.metainfo.xml | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/data/org.freedesktop.packagekit.metainfo.xml b/data/org.freedesktop.packagekit.metainfo.xml +index 13b7a316d..ce47582a8 100644 +--- a/data/org.freedesktop.packagekit.metainfo.xml ++++ b/data/org.freedesktop.packagekit.metainfo.xml +@@ -27,6 +27,16 @@ + https://www.freedesktop.org/software/PackageKit + + packagekit.service ++ ++ Cinnamon ++ GNOME ++ KDE ++ LXQt ++ MATE ++ Pantheon ++ Unity ++ XFCE ++ + + System + diff --git a/runtime-warnings.patch b/runtime-warnings.patch new file mode 100644 index 0000000000000000000000000000000000000000..777001f75ccea47c6972fce798c28057b9c63d4e --- /dev/null +++ b/runtime-warnings.patch @@ -0,0 +1,460 @@ +From 671ef87143c0a68e5f11cfbd0c305caaebecc204 Mon Sep 17 00:00:00 2001 +From: sid +Date: Fri, 10 May 2024 21:46:54 +0100 +Subject: [PATCH] pkcon: Use appropriate callbacks for client / task async + calls + +Fixes: #747 +--- + client/pk-console.c | 112 ++++++++++++++++++++++++++------------------ + 1 file changed, 66 insertions(+), 46 deletions(-) + +diff --git a/client/pk-console.c b/client/pk-console.c +index 056e37e65..ad42c3b49 100644 +--- a/client/pk-console.c ++++ b/client/pk-console.c +@@ -637,7 +637,7 @@ pk_console_progress_cb (PkProgress *progress, PkProgressType type, gpointer data + } + + static void +-pk_console_finished_cb (GObject *object, GAsyncResult *res, gpointer data) ++pk_console_process_results (PkResults *results, PkConsoleCtx *ctx, const GError *finish_error) + { + const gchar *filename; + gboolean ret; +@@ -645,11 +645,8 @@ pk_console_finished_cb (GObject *object, GAsyncResult *res, gpointer data) + PkPackageSack *sack; + PkRestartEnum restart; + PkRoleEnum role; +- PkConsoleCtx *ctx = (PkConsoleCtx *) data; +- g_autoptr(GError) error = NULL; + g_autoptr(GFile) file = NULL; + g_autoptr(PkError) error_code = NULL; +- g_autoptr(PkResults) results = NULL; + + /* no more progress */ + if (ctx->is_console) { +@@ -659,13 +656,11 @@ pk_console_finished_cb (GObject *object, GAsyncResult *res, gpointer data) + g_print ("%s\n", _("Results:")); + } + +- /* get the results */ +- results = pk_task_generic_finish (PK_TASK (ctx->task), res, &error); + if (results == NULL) { + /* TRANSLATORS: we failed to get any results, which is pretty + * fatal in my book */ +- g_print ("%s: %s\n", _("Fatal error"), error->message); +- switch (error->code - 0xff) { ++ g_print ("%s: %s\n", _("Fatal error"), finish_error->message); ++ switch (finish_error->code - 0xff) { + case PK_ERROR_ENUM_ALL_PACKAGES_ALREADY_INSTALLED: + case PK_ERROR_ENUM_REPO_NOT_AVAILABLE: + ctx->retval = PK_EXIT_CODE_NOTHING_USEFUL; +@@ -821,6 +816,7 @@ pk_console_finished_cb (GObject *object, GAsyncResult *res, gpointer data) + + /* write the sack to disk */ + if (role == PK_ROLE_ENUM_GET_PACKAGES && filename != NULL) { ++ g_autoptr(GError) error = NULL; + file = g_file_new_for_path (filename); + ret = pk_package_sack_to_file (sack, file, &error); + if (!ret) { +@@ -833,6 +829,30 @@ pk_console_finished_cb (GObject *object, GAsyncResult *res, gpointer data) + g_main_loop_quit (ctx->loop); + } + ++static void ++pk_console_client_finished_cb (GObject *object, GAsyncResult *res, gpointer data) ++{ ++ g_autoptr(GError) error = NULL; ++ g_autoptr(PkResults) results = NULL; ++ PkConsoleCtx *ctx = (PkConsoleCtx *) data; ++ ++ results = pk_client_generic_finish (PK_CLIENT (ctx->task), res, &error); ++ ++ pk_console_process_results (results, ctx, error); ++} ++ ++static void ++pk_console_task_finished_cb (GObject *object, GAsyncResult *res, gpointer data) ++{ ++ g_autoptr(GError) error = NULL; ++ g_autoptr(PkResults) results = NULL; ++ PkConsoleCtx *ctx = (PkConsoleCtx *) data; ++ ++ results = pk_task_generic_finish (PK_TASK (ctx->task), res, &error); ++ ++ pk_console_process_results (results, ctx, error); ++} ++ + static gchar * + pk_console_resolve_package (PkConsoleCtx *ctx, const gchar *package_name, GError **error) + { +@@ -1057,7 +1077,7 @@ pk_console_install_packages (PkConsoleCtx *ctx, gchar **packages, GError **error + pk_task_install_packages_async (PK_TASK (ctx->task), + package_ids, ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_task_finished_cb, ctx); + return TRUE; + } + +@@ -1086,7 +1106,7 @@ pk_console_remove_packages (PkConsoleCtx *ctx, gchar **packages, gboolean autore + TRUE, autoremove, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_task_finished_cb, ctx); + return TRUE; + } + +@@ -1115,7 +1135,7 @@ pk_console_download_packages (PkConsoleCtx *ctx, gchar **packages, const gchar * + directory, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_task_finished_cb, ctx); + return TRUE; + } + +@@ -1145,7 +1165,7 @@ pk_console_update_packages (PkConsoleCtx *ctx, gchar **packages, GError **error) + package_ids, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_task_finished_cb, ctx); + return TRUE; + } + +@@ -1188,7 +1208,7 @@ pk_console_update_system (PkConsoleCtx *ctx, GError **error) + package_ids, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_task_finished_cb, ctx); + return TRUE; + } + +@@ -1200,7 +1220,7 @@ pk_console_upgrade_system (PkConsoleCtx *ctx, const gchar *distro_id, const gcha + pk_upgrade_kind_enum_from_string (upgrade_kind), + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_task_finished_cb, ctx); + return TRUE; + } + +@@ -1230,7 +1250,7 @@ pk_console_required_by (PkConsoleCtx *ctx, gchar **packages, GError **error) + TRUE, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_task_finished_cb, ctx); + return TRUE; + } + +@@ -1259,7 +1279,7 @@ pk_console_depends_on (PkConsoleCtx *ctx, gchar **packages, GError **error) + FALSE, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_task_finished_cb, ctx); + return TRUE; + } + +@@ -1275,7 +1295,7 @@ pk_console_get_details (PkConsoleCtx *ctx, gchar **packages, GError **error) + packages, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_client_finished_cb, ctx); + return TRUE; + } + +@@ -1296,7 +1316,7 @@ pk_console_get_details (PkConsoleCtx *ctx, gchar **packages, GError **error) + package_ids, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_task_finished_cb, ctx); + return TRUE; + } + +@@ -1307,7 +1327,7 @@ pk_console_get_details_local (PkConsoleCtx *ctx, gchar **files, GError **error) + files, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_client_finished_cb, ctx); + return TRUE; + } + +@@ -1318,7 +1338,7 @@ pk_console_get_files_local (PkConsoleCtx *ctx, gchar **files, GError **error) + files, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_client_finished_cb, ctx); + return TRUE; + } + +@@ -1334,7 +1354,7 @@ pk_console_get_files (PkConsoleCtx *ctx, gchar **packages, GError **error) + packages, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_client_finished_cb, ctx); + return TRUE; + } + +@@ -1355,7 +1375,7 @@ pk_console_get_files (PkConsoleCtx *ctx, gchar **packages, GError **error) + package_ids, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_task_finished_cb, ctx); + return TRUE; + } + +@@ -1383,7 +1403,7 @@ pk_console_get_update_detail (PkConsoleCtx *ctx, gchar **packages, GError **erro + package_ids, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_task_finished_cb, ctx); + return TRUE; + } + +@@ -1830,7 +1850,7 @@ main (int argc, char *argv[]) + argv + 3, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_task_finished_cb, ctx); + + } else if (strcmp (value, "details") == 0) { + if (details == NULL) { +@@ -1847,7 +1867,7 @@ main (int argc, char *argv[]) + argv + 3, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_task_finished_cb, ctx); + + } else if (strcmp (value, "group") == 0) { + if (details == NULL) { +@@ -1864,7 +1884,7 @@ main (int argc, char *argv[]) + argv + 3, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_task_finished_cb, ctx); + + } else if (strcmp (value, "file") == 0) { + if (details == NULL) { +@@ -1881,7 +1901,7 @@ main (int argc, char *argv[]) + argv + 3, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_task_finished_cb, ctx); + } else { + /* fallback to a generic search */ + pk_task_search_details_async (PK_TASK (ctx->task), +@@ -1889,7 +1909,7 @@ main (int argc, char *argv[]) + argv + 2, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_task_finished_cb, ctx); + } + + } else if (strcmp (mode, "install") == 0) { +@@ -1920,7 +1940,7 @@ main (int argc, char *argv[]) + argv + 2, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_task_finished_cb, ctx); + + } else if (strcmp (mode, "install-sig") == 0) { + if (value == NULL || details == NULL || parameter == NULL) { +@@ -1938,7 +1958,7 @@ main (int argc, char *argv[]) + parameter, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_client_finished_cb, ctx); + + } else if (strcmp (mode, "remove") == 0) { + if (value == NULL) { +@@ -1992,7 +2012,7 @@ main (int argc, char *argv[]) + value, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_client_finished_cb, ctx); + + } else if (strcmp (mode, "update") == 0) { + if (value == NULL) { +@@ -2019,7 +2039,7 @@ main (int argc, char *argv[]) + argv + 2, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_task_finished_cb, ctx); + + } else if (strcmp (mode, "repo-enable") == 0) { + if (value == NULL) { +@@ -2036,7 +2056,7 @@ main (int argc, char *argv[]) + TRUE, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_task_finished_cb, ctx); + + } else if (strcmp (mode, "repo-disable") == 0) { + if (value == NULL) { +@@ -2053,7 +2073,7 @@ main (int argc, char *argv[]) + FALSE, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_task_finished_cb, ctx); + + } else if (strcmp (mode, "repo-set-data") == 0) { + if (value == NULL || details == NULL || parameter == NULL) { +@@ -2070,7 +2090,7 @@ main (int argc, char *argv[]) + parameter, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_client_finished_cb, ctx); + + } else if (strcmp (mode, "repo-remove") == 0) { + if (value == NULL || details == NULL) { +@@ -2088,14 +2108,14 @@ main (int argc, char *argv[]) + atoi (details), + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_client_finished_cb, ctx); + + } else if (strcmp (mode, "repo-list") == 0) { + pk_task_get_repo_list_async (PK_TASK (ctx->task), + ctx->filters, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_task_finished_cb, ctx); + + } else if (strcmp (mode, "get-time") == 0) { + PkRoleEnum role; +@@ -2144,7 +2164,7 @@ main (int argc, char *argv[]) + pk_client_get_distro_upgrades_async (PK_CLIENT (ctx->task), + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_client_finished_cb, ctx); + + } else if (strcmp (mode, "get-update-detail") == 0) { + if (value == NULL) { +@@ -2186,7 +2206,7 @@ main (int argc, char *argv[]) + argv + 2, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_task_finished_cb, ctx); + + } else if (strcmp (mode, "get-details") == 0) { + if (value == NULL) { +@@ -2237,20 +2257,20 @@ main (int argc, char *argv[]) + ctx->filters, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_task_finished_cb, ctx); + + } else if (strcmp (mode, "get-categories") == 0) { + pk_task_get_categories_async (PK_TASK (ctx->task), + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_task_finished_cb, ctx); + + } else if (strcmp (mode, "get-packages") == 0) { + pk_task_get_packages_async (PK_TASK (ctx->task), + ctx->filters, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_task_finished_cb, ctx); + + } else if (strcmp (mode, "upgrade-system") == 0) { + /* do the system upgrade */ +@@ -2341,7 +2361,7 @@ main (int argc, char *argv[]) + 10, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_client_finished_cb, ctx); + + } else if (strcmp (mode, "refresh") == 0) { + gboolean force = (value != NULL && g_strcmp0 (value, "force") == 0); +@@ -2349,12 +2369,12 @@ main (int argc, char *argv[]) + force, + ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_task_finished_cb, ctx); + + } else if (strcmp (mode, "repair") == 0) { + pk_task_repair_system_async (PK_TASK (ctx->task), ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_task_finished_cb, ctx); + + } else if (strcmp (mode, "list-create") == 0) { + if (value == NULL) { +@@ -2386,7 +2406,7 @@ main (int argc, char *argv[]) + g_free); + pk_task_get_packages_async (PK_TASK (ctx->task), ctx->filters, ctx->cancellable, + pk_console_progress_cb, ctx, +- pk_console_finished_cb, ctx); ++ pk_console_task_finished_cb, ctx); + } else { + error = g_error_new (PK_CONSOLE_ERROR, + PK_ERROR_ENUM_INTERNAL_ERROR, +From cbb5a6d5ca849e4dca5a68b13ee655146996f002 Mon Sep 17 00:00:00 2001 +Date: Mon, 22 Jul 2024 12:20:16 +0200 +Subject: [PATCH] pk-client: Fix runtime warning when backend does not support + role + +The daemon returns "op not supported by the backend" as part of the method +call response, but this response can be received after the "Destroy" signal, +which causes infinite wait for the transaction end and runtime warnings +about NULL error being passed to the g_task_return_error() on the client side. + +This is a regression from commit https://github.com/PackageKit/PackageKit/commit/44215db95d9cfda23045d9a9b97175519f473eb2 +--- + lib/packagekit-glib2/pk-client.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/lib/packagekit-glib2/pk-client.c b/lib/packagekit-glib2/pk-client.c +index 735c718cb..3cbb0d859 100644 +--- a/lib/packagekit-glib2/pk-client.c ++++ b/lib/packagekit-glib2/pk-client.c +@@ -1616,11 +1616,11 @@ pk_client_signal_cb (GDBusProxy *proxy, + if (g_strcmp0 (signal_name, "Destroy") == 0) { + g_autoptr(GError) local_error = NULL; + +- if (state->waiting_for_finished) ++ if (state->waiting_for_finished) { + local_error = g_error_new_literal (PK_CLIENT_ERROR, PK_CLIENT_ERROR_FAILED, + "PackageKit transaction disappeared"); +- +- pk_client_state_finish (state, g_steal_pointer (&local_error)); ++ pk_client_state_finish (state, g_steal_pointer (&local_error)); ++ } + return; + } + }