Compare commits
10 Commits
24b809cdbe
...
99a7b994c6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99a7b994c6 | ||
|
|
8e36cd1cce | ||
|
|
46aa58f6ed | ||
|
|
5649b8663e | ||
|
|
38a9c634b9 | ||
|
|
be95313c6a | ||
|
|
931da66bde | ||
|
|
0ade47ec23 | ||
|
|
e81bfb86f0 | ||
|
|
88dd8b658d |
@ -1,33 +0,0 @@
|
||||
From f3398f8e48203246d6346b5c7c4ec5ea065181e6 Mon Sep 17 00:00:00 2001
|
||||
From: Richard Hughes <richard@hughsie.com>
|
||||
Date: Fri, 19 Jul 2019 15:01:49 +0100
|
||||
Subject: [PATCH] Do not trigger an inotity event when the AppStream XML data
|
||||
is unchanged
|
||||
|
||||
We already call dnf_utils_refresh_repo_appstream() on startup, but only as
|
||||
required. Remove the unconditional copy to speed up gnome-software startup.
|
||||
---
|
||||
backends/dnf/pk-backend-dnf.c | 7 -------
|
||||
1 file changed, 7 deletions(-)
|
||||
|
||||
diff --git a/backends/dnf/pk-backend-dnf.c b/backends/dnf/pk-backend-dnf.c
|
||||
index 779896c2d..503a6eb0a 100644
|
||||
--- a/backends/dnf/pk-backend-dnf.c
|
||||
+++ b/backends/dnf/pk-backend-dnf.c
|
||||
@@ -565,13 +565,6 @@ dnf_utils_add_remote (PkBackendJob *job,
|
||||
if (!ret)
|
||||
return FALSE;
|
||||
|
||||
- /* update the AppStream copies in /var */
|
||||
- for (guint i = 0; i < repos->len; i++) {
|
||||
- DnfRepo *repo = g_ptr_array_index (repos, i);
|
||||
- if (!dnf_utils_refresh_repo_appstream (repo, error))
|
||||
- return FALSE;
|
||||
- }
|
||||
-
|
||||
/* done */
|
||||
if (!dnf_state_done (state, error))
|
||||
return FALSE;
|
||||
--
|
||||
2.21.0
|
||||
|
||||
@ -1,58 +0,0 @@
|
||||
From 53dcc7b20c66408c6d2e6fe8b9b56eb974e7f5df Mon Sep 17 00:00:00 2001
|
||||
From: Buildteam <buildteam@openeuler.org>
|
||||
Date: Sun, 29 Dec 2019 16:10:20 +0800
|
||||
Subject: [PATCH] PackageKit: modify support URL
|
||||
|
||||
Signed-off-by: Buildteam <buildteam@openeuler.org>
|
||||
---
|
||||
etc/Vendor.conf | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/etc/Vendor.conf b/etc/Vendor.conf
|
||||
index 8db873b..ec48908 100644
|
||||
--- a/etc/Vendor.conf
|
||||
+++ b/etc/Vendor.conf
|
||||
@@ -12,7 +12,7 @@
|
||||
# If the value is set to 'none' then no link is shown.
|
||||
#
|
||||
# default=http://www.packagekit.org/pk-package-not-found.html
|
||||
-DefaultUrl=http://www.packagekit.org/pk-package-not-found.html
|
||||
+DefaultUrl=https://gitee.com/openeuler/community/issues
|
||||
|
||||
# The URL which is shown to the user when a codec could not be found.
|
||||
# It should explain why certain codecs cannot be used, and perhaps show
|
||||
@@ -21,7 +21,7 @@ DefaultUrl=http://www.packagekit.org/pk-package-not-found.html
|
||||
# If the value is set to 'none' then the value of DefaultUrl is used.
|
||||
#
|
||||
# default=none
|
||||
-CodecUrl=none
|
||||
+CodecUrl=https://gitee.com/openeuler/community/issues
|
||||
|
||||
# The URL which is shown to the user when hardware drivers could not be found.
|
||||
# It should explain why some hardware is not supported, and links to futher
|
||||
@@ -30,7 +30,7 @@ CodecUrl=none
|
||||
# If the value is set to 'none' then the value of DefaultUrl is used.
|
||||
#
|
||||
# default=none
|
||||
-HardwareUrl=none
|
||||
+HardwareUrl=https://gitee.com/openeuler/community/issues
|
||||
|
||||
# The URL which is shown to the user when fonts could not be found.
|
||||
# Alternatives should probably be suggested where possible.
|
||||
@@ -38,7 +38,7 @@ HardwareUrl=none
|
||||
# If the value is set to 'none' then the value of DefaultUrl is used.
|
||||
#
|
||||
# default=none
|
||||
-FontUrl=none
|
||||
+FontUrl=https://gitee.com/openeuler/community/issues
|
||||
|
||||
# The URL which is shown to the user when programs handing a mime tpye could not
|
||||
# be found. It should probably explain how to use wine if the program is a
|
||||
@@ -47,4 +47,4 @@ FontUrl=none
|
||||
# If the value is set to 'none' then the value of DefaultUrl is used.
|
||||
#
|
||||
# default=none
|
||||
-MimeUrl=none
|
||||
+MimeUrl=https://gitee.com/openeuler/community/issues
|
||||
--
|
||||
1.8.3.1
|
||||
@ -1,45 +0,0 @@
|
||||
From be075445cafd370abf1ad3e6e85f2baebef056cb Mon Sep 17 00:00:00 2001
|
||||
From: Kalev Lember <klember@redhat.com>
|
||||
Date: Wed, 30 Jan 2019 15:37:21 +0100
|
||||
Subject: [PATCH] dnf: Don't override DnfContext's release_ver for the running
|
||||
system
|
||||
|
||||
Only override release_ver for the system upgrade DnfContext and leave it
|
||||
at the default value for the default context. This makes
|
||||
dnf_context_setup() automatically figure out the release_ver based on
|
||||
the running system: it looks at various provides in rpmdb and finally
|
||||
falls back to VERSION_ID from /etc/os-release.
|
||||
|
||||
The goal here is to make it possible to adjust the value that gets
|
||||
passed to librepo by changing system-release(releasever) provides in
|
||||
fedora-release (which DnfContext correctly handles if we leave the
|
||||
release_ver set to the default value).
|
||||
|
||||
https://pagure.io/releng/issue/7445
|
||||
---
|
||||
backends/dnf/pk-backend-dnf.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/backends/dnf/pk-backend-dnf.c b/backends/dnf/pk-backend-dnf.c
|
||||
index 47e565915..779896c2d 100644
|
||||
--- a/backends/dnf/pk-backend-dnf.c
|
||||
+++ b/backends/dnf/pk-backend-dnf.c
|
||||
@@ -156,7 +156,6 @@ pk_backend_setup_dnf_context (DnfContext *context, GKeyFile *conf, const gchar *
|
||||
dnf_context_set_repo_dir (context, repo_dir);
|
||||
lock_dir = g_build_filename (destdir, "/var/run", NULL);
|
||||
dnf_context_set_lock_dir (context, lock_dir);
|
||||
- dnf_context_set_release_ver (context, release_ver);
|
||||
dnf_context_set_rpm_verbosity (context, "info");
|
||||
|
||||
/* use this initial data if repos are not present */
|
||||
@@ -3401,6 +3400,7 @@ pk_backend_upgrade_system_thread (PkBackendJob *job, GVariant *params, gpointer
|
||||
g_autoptr(DnfContext) context = NULL;
|
||||
|
||||
context = dnf_context_new ();
|
||||
+ dnf_context_set_release_ver (context, release_ver);
|
||||
ret = pk_backend_setup_dnf_context (context, priv->conf, release_ver, &error);
|
||||
if (!ret) {
|
||||
g_debug ("failed to setup context: %s", error->message);
|
||||
--
|
||||
2.21.0
|
||||
|
||||
@ -1,38 +0,0 @@
|
||||
From cdbd27d699b51e37c533d07abd2f1ab26e11355c Mon Sep 17 00:00:00 2001
|
||||
From: Kalev Lember <klember@redhat.com>
|
||||
Date: Tue, 18 Dec 2018 01:02:27 +0100
|
||||
Subject: [PATCH] dnf: Invalidate the sack cache after downloading new metadata
|
||||
|
||||
This fixes first resolve() after refresh() to correctly return the new
|
||||
data.
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1642878
|
||||
---
|
||||
backends/dnf/pk-backend-dnf.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/backends/dnf/pk-backend-dnf.c b/backends/dnf/pk-backend-dnf.c
|
||||
index 5961f1258..47e565915 100644
|
||||
--- a/backends/dnf/pk-backend-dnf.c
|
||||
+++ b/backends/dnf/pk-backend-dnf.c
|
||||
@@ -1568,6 +1568,7 @@ pk_backend_refresh_cache_thread (PkBackendJob *job,
|
||||
gpointer user_data)
|
||||
{
|
||||
PkBackendDnfJobData *job_data = pk_backend_job_get_user_data (job);
|
||||
+ PkBackend *backend = pk_backend_job_get_backend (job);
|
||||
DnfRepo *repo;
|
||||
DnfState *state_local;
|
||||
DnfState *state_loop;
|
||||
@@ -1699,6 +1700,9 @@ pk_backend_refresh_cache_thread (PkBackendJob *job,
|
||||
return;
|
||||
}
|
||||
|
||||
+ /* invalidate the sack cache after downloading new metadata */
|
||||
+ pk_backend_sack_cache_invalidate (backend, "downloaded new metadata");
|
||||
+
|
||||
/* regenerate the libsolv metadata */
|
||||
state_local = dnf_state_get_child (job_data->state);
|
||||
sack = dnf_utils_create_sack_for_filters (job, 0,
|
||||
--
|
||||
2.19.1
|
||||
|
||||
@ -1,56 +0,0 @@
|
||||
From 4b3f4913e50510eed5fbd3bc4cf94a49dec939ab Mon Sep 17 00:00:00 2001
|
||||
From: Kalev Lember <klember@redhat.com>
|
||||
Date: Wed, 27 Feb 2019 10:08:50 +0100
|
||||
Subject: [PATCH] offline update: Use new plymouth "system-upgrade" and
|
||||
"reboot" modes
|
||||
|
||||
These landed in plymouth git yesterday to implement
|
||||
https://wiki.gnome.org/Design/OS/BootProgress
|
||||
|
||||
Using the new API conditionally is tricky as it's command line API;
|
||||
enterprise distros that don't have new enough plymouth should probably
|
||||
just revert this commit.
|
||||
---
|
||||
client/pk-offline-update.c | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/client/pk-offline-update.c b/client/pk-offline-update.c
|
||||
index 90ecacd06..6f6591427 100644
|
||||
--- a/client/pk-offline-update.c
|
||||
+++ b/client/pk-offline-update.c
|
||||
@@ -188,7 +188,7 @@ pk_offline_update_reboot (void)
|
||||
|
||||
/* reboot using systemd */
|
||||
sd_journal_print (LOG_INFO, "rebooting");
|
||||
- pk_offline_update_set_plymouth_mode ("shutdown");
|
||||
+ pk_offline_update_set_plymouth_mode ("reboot");
|
||||
/* TRANSLATORS: we've finished doing offline updates */
|
||||
pk_offline_update_set_plymouth_msg (_("Rebooting after installing updates…"));
|
||||
connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
|
||||
@@ -371,6 +371,7 @@ pk_offline_update_do_update (PkTask *task, PkProgressBar *progressbar, GError **
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
+ pk_offline_update_set_plymouth_mode ("updates");
|
||||
/* TRANSLATORS: we've started doing offline updates */
|
||||
pk_offline_update_set_plymouth_msg (_("Installing updates; this could take a while..."));
|
||||
pk_offline_update_write_dummy_results ();
|
||||
@@ -403,6 +404,7 @@ pk_offline_update_do_upgrade (PkTask *task, PkProgressBar *progressbar, GError *
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
+ pk_offline_update_set_plymouth_mode ("system-upgrade");
|
||||
/* TRANSLATORS: we've started doing offline system upgrade */
|
||||
pk_offline_update_set_plymouth_msg (_("Installing system upgrade; this could take a while..."));
|
||||
pk_offline_update_write_dummy_results ();
|
||||
@@ -485,7 +487,6 @@ main (int argc, char *argv[])
|
||||
|
||||
task = pk_task_new ();
|
||||
pk_client_set_interactive (PK_CLIENT (task), FALSE);
|
||||
- pk_offline_update_set_plymouth_mode ("updates");
|
||||
|
||||
if (g_strcmp0 (link, PK_OFFLINE_PREPARED_UPGRADE_FILENAME) == 0 &&
|
||||
g_file_test (PK_OFFLINE_PREPARED_UPGRADE_FILENAME, G_FILE_TEST_EXISTS)) {
|
||||
--
|
||||
2.21.0
|
||||
|
||||
@ -1,52 +0,0 @@
|
||||
#Copyright (C) 2019. Huawei Technologies Co., Ltd. All rights reserved.
|
||||
#
|
||||
#This program is free software; you can redistribute it and/or modify
|
||||
#it under the terms of GPLv2+ and LGPLv2+
|
||||
#
|
||||
#This program is distributed in the hope that it will be useful,
|
||||
#but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See GPLv2+ and LGPLv2+ for more details.
|
||||
|
||||
diff -uNrp a/contrib/command-not-found/pk-command-not-found.c b/contrib/command-not-found/pk-command-not-found.c
|
||||
--- a/contrib/command-not-found/pk-command-not-found.c 2018-09-25 16:37:29.000000000 +0800
|
||||
+++ b/contrib/command-not-found/pk-command-not-found.c 2019-08-26 10:14:11.184000000 +0800
|
||||
@@ -143,6 +143,31 @@ pk_cnf_find_alternatives_replace (const
|
||||
|
||||
/**
|
||||
*
|
||||
+ * Add last char, so gre -> grep
|
||||
+ **/
|
||||
+static void
|
||||
+pk_cnf_find_alternatives_add (const gchar *cmd, guint len, GPtrArray *array)
|
||||
+{
|
||||
+ guint i;
|
||||
+ gchar *possible;
|
||||
+ gchar *alt="abcdefghijklmnopqrstuvwxyz";
|
||||
+ for(i = 0;i < 26; i++)
|
||||
+ {
|
||||
+ gchar *temp = malloc((len+2)*sizeof(gchar));
|
||||
+ if(NULL != temp)
|
||||
+ {
|
||||
+ memset(temp,0,(len+2)*sizeof(gchar));
|
||||
+ strncpy(temp,cmd,len);
|
||||
+ temp[len]=alt[i];
|
||||
+ temp[len+1]='\0';
|
||||
+ possible = temp;
|
||||
+ g_ptr_array_add (array, possible);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ *
|
||||
* Truncate first and last char, so lshall -> lshal
|
||||
**/
|
||||
static void
|
||||
@@ -349,6 +374,7 @@ pk_cnf_find_alternatives (const gchar *c
|
||||
unique = g_ptr_array_new ();
|
||||
pk_cnf_find_alternatives_swizzle (cmd, len, possible);
|
||||
pk_cnf_find_alternatives_replace (cmd, len, possible);
|
||||
+ pk_cnf_find_alternatives_add (cmd, len, possible);
|
||||
if (len > 3)
|
||||
pk_cnf_find_alternatives_truncate (cmd, len, possible);
|
||||
pk_cnf_find_alternatives_remove_double (cmd, len, possible);
|
||||
Binary file not shown.
BIN
PackageKit-1.2.8.tar.xz
Normal file
BIN
PackageKit-1.2.8.tar.xz
Normal file
Binary file not shown.
@ -1,32 +1,18 @@
|
||||
Name: PackageKit
|
||||
Version: 1.1.12
|
||||
Release: 9
|
||||
Version: 1.2.8
|
||||
Release: 3
|
||||
License: GPLv2+ and LGPLv2+
|
||||
Summary: Package management service
|
||||
URL: https://www.freedesktop.org/software/PackageKit/
|
||||
Source0: https://www.freedesktop.org/software/PackageKit/releases/%{name}-%{version}.tar.xz
|
||||
|
||||
# Fedora-specific: set Vendor.conf up for Fedora.
|
||||
Patch1: PackageKit-0.3.9-Command-not-found-AddFn.patch
|
||||
|
||||
# Backported from upstream
|
||||
Patch2: 0001-dnf-Invalidate-the-sack-cache-after-downloading-new-.patch
|
||||
|
||||
# https://github.com/hughsie/PackageKit/pull/316
|
||||
Patch3: 0001-offline-update-Use-new-plymouth-system-upgrade-and-r.patch
|
||||
|
||||
# https://pagure.io/releng/issue/7445
|
||||
Patch4: 0001-dnf-Don-t-override-DnfContext-s-release_ver-for-the-.patch
|
||||
|
||||
# https://github.com/hughsie/PackageKit/pull/330
|
||||
Patch5: 0001-Do-not-trigger-an-inotity-event-when-the-AppStream-X.patch
|
||||
|
||||
# modify support URL
|
||||
Patch6: 0001-PackageKit-modify-support-URL.patch
|
||||
Patch6000: backport-pkcon-Use-appropriate-callbacks-for-client-task-asyn.patch
|
||||
Patch6001: Revert-PkClient-Replace-the-GSimpleAsyncResult-with-.patch
|
||||
|
||||
BuildRequires: glib2-devel xmlto gtk-doc sqlite-devel polkit-devel libtool gtk2-devel gtk3-devel docbook-utils
|
||||
BuildRequires: gnome-doc-utils intltool gettext vala gstreamer1-devel gstreamer1-plugins-base-devel pango-devel
|
||||
BuildRequires: fontconfig-devel libappstream-glib-devel libdnf-devel systemd-devel gobject-introspection-devel bash-completion
|
||||
BuildRequires: meson appstream-devel
|
||||
|
||||
Requires: glib2 libdnf shared-mime-info systemd gobject-introspection crontabs pango
|
||||
|
||||
@ -94,38 +80,47 @@ using PackageKit.
|
||||
%autosetup -p1
|
||||
|
||||
%build
|
||||
%configure --enable-dnf --enable-bash-completion --disable-local --disable-silent-rules
|
||||
|
||||
%make_build V=1
|
||||
%meson \
|
||||
-Dgtk_doc=true \
|
||||
-Dpython_backend=false \
|
||||
-Dpackaging_backend=dnf \
|
||||
-Dlocal_checkout=false
|
||||
%meson_build
|
||||
|
||||
%install
|
||||
%make_install
|
||||
%meson_install
|
||||
|
||||
%delete_la_and_a
|
||||
mkdir -p %{buildroot}%{_localstatedir}/cache/PackageKit
|
||||
mkdir -p %{buildroot}%{_localstatedir}/cache/app-info/{icons,xmls}
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/cache/app-info/{icons,xmls}
|
||||
|
||||
touch $RPM_BUILD_ROOT%{_localstatedir}/cache/PackageKit/groups.sqlite
|
||||
|
||||
pushd ${RPM_BUILD_ROOT}%{_libexecdir} > /dev/null
|
||||
pushd %{buildroot}%{_libexecdir} > /dev/null
|
||||
ln -s pk-gstreamer-install gst-install-plugins-helper
|
||||
popd > /dev/null
|
||||
|
||||
mkdir -p %{buildroot}%{_unitdir}/system-update.target.wants/
|
||||
ln -sf ../Packagekit-offline.service %{buildroot}%{_unitdir}/system-update.target.wants/packagekit-offline-update.service
|
||||
|
||||
%find_lang %name
|
||||
|
||||
%post
|
||||
systemctl disable packagekit-offline-update.service > /dev/null 2>&1 || :
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%files -f %{name}.lang
|
||||
%license COPYING
|
||||
%doc AUTHORS
|
||||
%doc AUTHORS README NEWS
|
||||
%dir %{_datadir}/PackageKit
|
||||
%dir %{_sysconfdir}/PackageKit
|
||||
%dir %{_localstatedir}/lib/PackageKit
|
||||
%dir %{_localstatedir}/cache/app-info/icons
|
||||
%dir %{_localstatedir}/cache/app-info/xmls
|
||||
%dir %{_localstatedir}/cache/PackageKit
|
||||
%ghost %verify(not md5 size mtime) %{_localstatedir}/cache/PackageKit/groups.sqlite
|
||||
%config(noreplace) %{_sysconfdir}/PackageKit/PackageKit.conf
|
||||
%config(noreplace) %{_sysconfdir}/PackageKit/Vendor.conf
|
||||
%config(noreplace) %{_sysconfdir}/sysconfig/packagekit-background
|
||||
%config %{_sysconfdir}/cron.daily/packagekit-background.cron
|
||||
%config %{_sysconfdir}/dbus-1/system.d/*
|
||||
##%config %{_sysconfdir}/dbus-1/system.d/*
|
||||
%{_metainfodir}/org.freedesktop.packagekit.metainfo.xml
|
||||
%{_libexecdir}/packagekitd
|
||||
%{_libexecdir}/packagekit-direct
|
||||
%{_libexecdir}/pk-offline-update
|
||||
@ -146,11 +141,16 @@ systemctl disable packagekit-offline-update.service > /dev/null 2>&1 || :
|
||||
%{_unitdir}/packagekit-offline-update.service
|
||||
%{_unitdir}/packagekit.service
|
||||
%{_unitdir}/system-update.target.wants/
|
||||
%{python3_sitelib}/dnf-plugins/
|
||||
%{_libexecdir}/packagekit-dnf-refresh-repo
|
||||
%{_datadir}/dbus-1/system.d/org.freedesktop.PackageKit.conf
|
||||
%{_datadir}/vala/vapi/packagekit-glib2.deps
|
||||
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root)
|
||||
%{_libdir}/*.so
|
||||
%{_libdir}/gtk-2.0/modules/*.so
|
||||
##%{_libdir}/gtk-2.0/modules/*.so
|
||||
%{_libdir}/gtk-3.0/modules/*.so
|
||||
%{_libdir}/gnome-settings-daemon-3.0/gtk-modules/*.desktop
|
||||
%{_libdir}/pkgconfig/*.pc
|
||||
@ -172,6 +172,36 @@ systemctl disable packagekit-offline-update.service > /dev/null 2>&1 || :
|
||||
%config(noreplace) %{_sysconfdir}/PackageKit/CommandNotFound.conf
|
||||
|
||||
%changelog
|
||||
* Fri Aug 23 2024 lingsheng <lingsheng1@h-partners.com> - 1.2.8-3
|
||||
- Type: bugfix
|
||||
- ID: NA
|
||||
- SUG: NA
|
||||
- DESC: Revert PkClient: Replace the GSimpleAsyncResult with the GTask API
|
||||
|
||||
* Tue Jul 23 2024 zhouyihang <zhouyihang3@h-partners.com> - 1.2.8-2
|
||||
- Type: bugfix
|
||||
- ID: NA
|
||||
- SUG: NA
|
||||
- DESC: pkcon: Use appropriate callbacks for client / task async calls
|
||||
|
||||
* Tue Feb 06 2024 zhouwenpei <zhouwenpei1@h-partners.com> - 1.2.8-1
|
||||
- Type: update
|
||||
- ID: NA
|
||||
- SUG: NA
|
||||
- DESC: update to version 1.2.8
|
||||
|
||||
* Fri Oct 20 2023 li weigang <weigangli99@gmail.com> - 1.2.7-1
|
||||
- Type: update
|
||||
- ID: NA
|
||||
- SUG: NA
|
||||
- DESC: update to version 1.2.7
|
||||
|
||||
* Tue Sep 28 2021 yangcheng <yangcheng87@huawei.com> - 1.1.12-10
|
||||
- Type:CVE
|
||||
- ID:cve-2020-16121
|
||||
- SUG:NA
|
||||
- DESC:fix CVE-2020-16121
|
||||
|
||||
* Tue Mar 10 2020 chengguipeng <chengguipeng1@huawei.com> - 1.1.12-9
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
|
||||
617
Revert-PkClient-Replace-the-GSimpleAsyncResult-with-.patch
Normal file
617
Revert-PkClient-Replace-the-GSimpleAsyncResult-with-.patch
Normal file
@ -0,0 +1,617 @@
|
||||
From 9756228d02e05661c15e0fc4b9a230d0d2b02d1b Mon Sep 17 00:00:00 2001
|
||||
From: lingsheng <lingsheng1@h-partners.com>
|
||||
Date: Fri, 23 Aug 2024 10:53:29 +0000
|
||||
Subject: [PATCH] Revert PkClient: Replace the GSimpleAsyncResult with the
|
||||
GTask API
|
||||
|
||||
Reverted patch:https://github.com/PackageKit/Packagekit/commit/b068646d2fbb246c590a47531688c69df2699fa6
|
||||
|
||||
---
|
||||
lib/packagekit-glib2/pk-client.c | 164 ++++++++++++++++---------------
|
||||
1 file changed, 86 insertions(+), 78 deletions(-)
|
||||
|
||||
diff --git a/lib/packagekit-glib2/pk-client.c b/lib/packagekit-glib2/pk-client.c
|
||||
index c3eadc2..8792dd3 100644
|
||||
--- a/lib/packagekit-glib2/pk-client.c
|
||||
+++ b/lib/packagekit-glib2/pk-client.c
|
||||
@@ -163,7 +163,7 @@ struct _PkClientState
|
||||
GDBusProxy *proxy_props;
|
||||
GCancellable *cancellable;
|
||||
GCancellable *cancellable_client;
|
||||
- GTask *res;
|
||||
+ GSimpleAsyncResult *res;
|
||||
PkBitfield filters;
|
||||
PkClient *client;
|
||||
PkProgress *progress;
|
||||
@@ -210,15 +210,11 @@ pk_client_state_remove (PkClient *client, PkClientState *state)
|
||||
}
|
||||
}
|
||||
|
||||
-/*
|
||||
- * pk_client_state_finish:
|
||||
- * @state: (transfer full): the #PkClientState
|
||||
- * @error: (transfer full): the #GError
|
||||
- **/
|
||||
static void
|
||||
-pk_client_state_finish (PkClientState *state, GError *error)
|
||||
+pk_client_state_finish (PkClientState *state, const GError *error)
|
||||
{
|
||||
gboolean ret;
|
||||
+ g_autoptr(GError) error_local = NULL;
|
||||
|
||||
if (state->res == NULL)
|
||||
return;
|
||||
@@ -240,17 +236,15 @@ pk_client_state_finish (PkClientState *state, GError *error)
|
||||
g_object_unref (G_OBJECT (state->proxy_props));
|
||||
|
||||
if (state->ret) {
|
||||
- g_task_return_pointer (state->res,
|
||||
- g_object_ref (state->results),
|
||||
- g_object_unref);
|
||||
+ g_simple_async_result_set_op_res_gpointer (state->res,
|
||||
+ g_object_ref (state->results),
|
||||
+ g_object_unref);
|
||||
} else {
|
||||
- g_task_return_error (state->res, error);
|
||||
+ g_simple_async_result_set_from_error (state->res, error);
|
||||
}
|
||||
|
||||
/* remove any socket file */
|
||||
if (state->client_helper != NULL) {
|
||||
- g_autoptr(GError) error_local = NULL;
|
||||
-
|
||||
if (!pk_client_helper_stop (state->client_helper, &error_local))
|
||||
g_warning ("failed to stop the client helper: %s", error_local->message);
|
||||
g_object_unref (state->client_helper);
|
||||
@@ -259,6 +253,9 @@ pk_client_state_finish (PkClientState *state, GError *error)
|
||||
/* remove from list */
|
||||
pk_client_state_remove (state->client, state);
|
||||
|
||||
+ /* complete */
|
||||
+ g_simple_async_result_complete_in_idle (state->res);
|
||||
+
|
||||
/* mark the state as finished */
|
||||
g_clear_object (&state->res);
|
||||
}
|
||||
@@ -343,7 +340,7 @@ pk_client_cancel_cb (GObject *source_object,
|
||||
g_debug ("failed to cancel: %s", error->message);
|
||||
|
||||
if (state)
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -370,7 +367,7 @@ pk_client_cancellable_cancel_cb (GCancellable *cancellable,
|
||||
g_debug ("Cancelled, but no proxy, not sure what to do here");
|
||||
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, local_error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -396,10 +393,9 @@ pk_client_state_new (PkClient *client,
|
||||
|
||||
state = g_object_new (PK_TYPE_CLIENT_STATE, NULL);
|
||||
state->role = role;
|
||||
- state->cancellable = g_cancellable_new ();
|
||||
- state->res = g_task_new (client, state->cancellable, callback_ready, user_data);
|
||||
+ state->res = g_simple_async_result_new (G_OBJECT (client), callback_ready, user_data, source_tag);
|
||||
state->client = g_object_ref (client);
|
||||
- g_task_set_source_tag (state->res, source_tag);
|
||||
+ state->cancellable = g_cancellable_new ();
|
||||
|
||||
if (cancellable != NULL) {
|
||||
state->cancellable_client = g_object_ref (cancellable);
|
||||
@@ -1007,7 +1003,7 @@ pk_client_copy_downloaded_finished_cb (GFile *file, GAsyncResult *res, PkClientS
|
||||
|
||||
/* get the result */
|
||||
if (!g_file_copy_finish (file, res, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1076,7 +1072,7 @@ pk_client_copy_downloaded_file (PkClientState *state, const gchar *package_id, c
|
||||
PK_CLIENT_ERROR,
|
||||
PK_ERROR_ENUM_FILE_CONFLICTS,
|
||||
"file %s already exists", path);
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
g_file_copy_async (source, destination, G_FILE_COPY_OVERWRITE,
|
||||
@@ -1182,7 +1178,7 @@ pk_client_signal_finished (PkClientState *state,
|
||||
"Failed: %s",
|
||||
pk_exit_enum_to_string (exit_enum));
|
||||
}
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1617,7 +1613,7 @@ pk_client_signal_cb (GDBusProxy *proxy,
|
||||
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, local_error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1638,7 +1634,7 @@ pk_client_notify_name_owner_cb (GObject *obj,
|
||||
|
||||
local_error = g_error_new_literal (PK_CLIENT_ERROR, PK_CLIENT_ERROR_FAILED,
|
||||
"PackageKit daemon disappeared");
|
||||
- pk_client_state_finish (state, g_steal_pointer (&local_error));
|
||||
+ pk_client_state_finish (state, local_error);
|
||||
} else {
|
||||
pk_client_state_unset_proxy (state);
|
||||
g_cancellable_cancel (state->cancellable);
|
||||
@@ -1695,7 +1691,7 @@ pk_client_method_cb (GObject *source_object,
|
||||
if (value == NULL) {
|
||||
/* fix up the D-Bus error */
|
||||
pk_client_fixup_dbus_error (error);
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1740,7 +1736,7 @@ pk_client_set_hints_cb (GObject *source_object,
|
||||
if (value == NULL) {
|
||||
/* fix up the D-Bus error */
|
||||
pk_client_fixup_dbus_error (error);
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2352,7 +2348,7 @@ pk_client_get_tid_cb (GObject *object, GAsyncResult *res, gpointer user_data)
|
||||
|
||||
state->tid = pk_control_get_tid_finish (control, res, &error);
|
||||
if (state->tid == NULL) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2385,11 +2381,17 @@ pk_client_get_tid_cb (GObject *object, GAsyncResult *res, gpointer user_data)
|
||||
PkResults *
|
||||
pk_client_generic_finish (PkClient *client, GAsyncResult *res, GError **error)
|
||||
{
|
||||
+ GSimpleAsyncResult *simple;
|
||||
+
|
||||
g_return_val_if_fail (PK_IS_CLIENT (client), NULL);
|
||||
- g_return_val_if_fail (G_IS_TASK (res), NULL);
|
||||
+ g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (res), NULL);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
|
||||
- return g_task_propagate_pointer (G_TASK (res), error);
|
||||
+ simple = G_SIMPLE_ASYNC_RESULT (res);
|
||||
+ if (g_simple_async_result_propagate_error (simple, error))
|
||||
+ return NULL;
|
||||
+
|
||||
+ return g_object_ref (g_simple_async_result_get_op_res_gpointer (simple));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2432,7 +2434,7 @@ pk_client_resolve_async (PkClient *client, PkBitfield filters, gchar **packages,
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2485,7 +2487,7 @@ pk_client_search_names_async (PkClient *client, PkBitfield filters, gchar **valu
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2539,7 +2541,7 @@ pk_client_search_details_async (PkClient *client, PkBitfield filters, gchar **va
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2591,7 +2593,7 @@ pk_client_search_groups_async (PkClient *client, PkBitfield filters, gchar **val
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2643,7 +2645,7 @@ pk_client_search_files_async (PkClient *client, PkBitfield filters, gchar **valu
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2695,7 +2697,7 @@ pk_client_get_details_async (PkClient *client, gchar **package_ids, GCancellable
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2744,14 +2746,14 @@ pk_client_get_details_local_async (PkClient *client, gchar **files, GCancellable
|
||||
state->progress = pk_progress_new ();
|
||||
state->files = pk_client_convert_real_paths (files, &error);
|
||||
if (state->files == NULL) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2800,14 +2802,14 @@ pk_client_get_files_local_async (PkClient *client, gchar **files, GCancellable *
|
||||
state->progress = pk_progress_new ();
|
||||
state->files = pk_client_convert_real_paths (files, &error);
|
||||
if (state->files == NULL) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2859,7 +2861,7 @@ pk_client_get_update_detail_async (PkClient *client, gchar **package_ids, GCance
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2912,7 +2914,7 @@ pk_client_download_packages_async (PkClient *client, gchar **package_ids, const
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2962,7 +2964,7 @@ pk_client_get_updates_async (PkClient *client, PkBitfield filters, GCancellable
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3012,7 +3014,7 @@ pk_client_get_old_transactions_async (PkClient *client, guint number, GCancellab
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3067,7 +3069,7 @@ pk_client_depends_on_async (PkClient *client, PkBitfield filters, gchar **packag
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3117,7 +3119,7 @@ pk_client_get_packages_async (PkClient *client, PkBitfield filters, GCancellable
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3172,7 +3174,7 @@ pk_client_required_by_async (PkClient *client, PkBitfield filters, gchar **packa
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3229,7 +3231,7 @@ pk_client_what_provides_async (PkClient *client,
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3278,7 +3280,7 @@ pk_client_get_distro_upgrades_async (PkClient *client, GCancellable *cancellable
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3329,7 +3331,7 @@ pk_client_get_files_async (PkClient *client, gchar **package_ids, GCancellable *
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3377,7 +3379,7 @@ pk_client_get_categories_async (PkClient *client, GCancellable *cancellable,
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3443,7 +3445,7 @@ pk_client_remove_packages_async (PkClient *client,
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3496,7 +3498,7 @@ pk_client_refresh_cache_async (PkClient *client, gboolean force, GCancellable *c
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3549,7 +3551,7 @@ pk_client_install_packages_async (PkClient *client, PkBitfield transaction_flags
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3603,7 +3605,7 @@ pk_client_install_signature_async (PkClient *client, PkSigTypeEnum type, const g
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3661,7 +3663,7 @@ pk_client_update_packages_async (PkClient *client,
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3686,7 +3688,7 @@ pk_client_copy_native_finished_cb (GFile *file, GAsyncResult *res, gpointer user
|
||||
|
||||
/* get the result */
|
||||
if (!g_file_copy_finish (file, res, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3797,7 +3799,7 @@ pk_client_install_files_async (PkClient *client,
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3807,7 +3809,7 @@ pk_client_install_files_async (PkClient *client,
|
||||
/* check files are valid */
|
||||
state->files = pk_client_convert_real_paths (files, &error);
|
||||
if (state->files == NULL) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3869,7 +3871,7 @@ pk_client_accept_eula_async (PkClient *client, const gchar *eula_id, GCancellabl
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3919,7 +3921,7 @@ pk_client_get_repo_list_async (PkClient *client, PkBitfield filters, GCancellabl
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3971,7 +3973,7 @@ pk_client_repo_enable_async (PkClient *client, const gchar *repo_id, gboolean en
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4026,7 +4028,7 @@ pk_client_repo_set_data_async (PkClient *client, const gchar *repo_id, const gch
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4086,7 +4088,7 @@ pk_client_repo_remove_async (PkClient *client,
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4147,7 +4149,7 @@ pk_client_upgrade_system_async (PkClient *client,
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4205,7 +4207,7 @@ pk_client_repair_system_async (PkClient *client,
|
||||
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL && g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4234,7 +4236,7 @@ pk_client_adopt_get_proxy_cb (GObject *object,
|
||||
|
||||
state->proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
|
||||
if (state->proxy == NULL) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4287,7 +4289,7 @@ pk_client_adopt_async (PkClient *client,
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4327,25 +4329,28 @@ pk_client_adopt_async (PkClient *client,
|
||||
PkProgress *
|
||||
pk_client_get_progress_finish (PkClient *client, GAsyncResult *res, GError **error)
|
||||
{
|
||||
+ GSimpleAsyncResult *simple;
|
||||
+
|
||||
g_return_val_if_fail (PK_IS_CLIENT (client), NULL);
|
||||
- g_return_val_if_fail (G_IS_TASK (res), NULL);
|
||||
+ g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (res), NULL);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
|
||||
- return g_task_propagate_pointer (G_TASK (res), error);
|
||||
+ simple = G_SIMPLE_ASYNC_RESULT (res);
|
||||
+ if (g_simple_async_result_propagate_error (simple, error))
|
||||
+ return NULL;
|
||||
+
|
||||
+ return g_object_ref (g_simple_async_result_get_op_res_gpointer (simple));
|
||||
}
|
||||
|
||||
/*
|
||||
* pk_client_get_progress_state_finish:
|
||||
- * @state: a #PkClientState
|
||||
- * @error: (transfer full)
|
||||
**/
|
||||
static void
|
||||
-pk_client_get_progress_state_finish (PkClientState *state, GError *error)
|
||||
+pk_client_get_progress_state_finish (PkClientState *state, const GError *error)
|
||||
{
|
||||
if (state->cancellable_id > 0) {
|
||||
g_cancellable_disconnect (state->cancellable_client,
|
||||
state->cancellable_id);
|
||||
- state->cancellable_id = 0;
|
||||
}
|
||||
g_clear_object (&state->cancellable);
|
||||
g_clear_object (&state->cancellable_client);
|
||||
@@ -4356,15 +4361,18 @@ pk_client_get_progress_state_finish (PkClientState *state, GError *error)
|
||||
g_object_unref (G_OBJECT (state->proxy_props));
|
||||
|
||||
if (state->ret) {
|
||||
- g_task_return_pointer (state->res,
|
||||
- g_object_ref (state->progress),
|
||||
- g_object_unref);
|
||||
+ g_simple_async_result_set_op_res_gpointer (state->res,
|
||||
+ g_object_ref (state->progress),
|
||||
+ g_object_unref);
|
||||
} else {
|
||||
- g_task_return_error (state->res, g_steal_pointer (&error));
|
||||
+ g_simple_async_result_set_from_error (state->res, error);
|
||||
}
|
||||
|
||||
/* remove from list */
|
||||
pk_client_state_remove (state->client, state);
|
||||
+
|
||||
+ /* complete */
|
||||
+ g_simple_async_result_complete_in_idle (state->res);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4380,7 +4388,7 @@ pk_client_get_progress_cb (GObject *source_object,
|
||||
|
||||
state->proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
|
||||
if (state->proxy == NULL) {
|
||||
- pk_client_get_progress_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_get_progress_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4425,7 +4433,7 @@ pk_client_get_progress_async (PkClient *client,
|
||||
/* check not already cancelled */
|
||||
if (cancellable != NULL &&
|
||||
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
|
||||
- pk_client_state_finish (state, g_steal_pointer (&error));
|
||||
+ pk_client_state_finish (state, error);
|
||||
return;
|
||||
}
|
||||
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -0,0 +1,432 @@
|
||||
From 671ef87143c0a68e5f11cfbd0c305caaebecc204 Mon Sep 17 00:00:00 2001
|
||||
From: sid <sidtosh4@gmail.com>
|
||||
Date: Fri, 10 May 2024 21:46:54 +0100
|
||||
Subject: [PATCH 1/1] pkcon: Use appropriate callbacks for client / task async
|
||||
calls
|
||||
|
||||
Fixes: #747
|
||||
|
||||
Conflict:NA
|
||||
Reference:https://github.com/PackageKit/PackageKit/commit/671ef87143c0a68e5f11cfbd0c305caaebecc204
|
||||
---
|
||||
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 @@ out:
|
||||
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,
|
||||
--
|
||||
2.33.0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user