Compare commits

..

No commits in common. "c8" and "c10" have entirely different histories.
c8 ... c10

15 changed files with 883 additions and 457 deletions

View File

@ -1 +0,0 @@
c205f7299520ab19ccd08276ec13fc7e273fb3c3 SOURCES/PackageKit-1.1.12.tar.xz

88
.gitignore vendored
View File

@ -1 +1,87 @@
SOURCES/PackageKit-1.1.12.tar.xz
PackageKit-0.6.6.tar.bz2
PackageKit-0.6.7.tar.bz2
/PackageKit-0.6.8.tar.bz2
/PackageKit-0.6.9.tar.bz2
/PackageKit-0.6.10.tar.bz2
/PackageKit-0.6.11.tar.bz2
/PackageKit-0.6.12.tar.bz2
/PackageKit-0.6.13.tar.bz2
/PackageKit-0.6.14.tar.bz2
/PackageKit-0.6.15.tar.bz2
/PackageKit-0.6.16.tar.xz
/PackageKit-0.6.17.tar.xz
/PackageKit-0.6.18.tar.xz
/PackageKit-0.6.19.tar.xz
/PackageKit-0.6.20.tar.xz
/PackageKit-0.6.21.tar.xz
/PackageKit-0.7.2.tar.xz
/PackageKit-0.7.4.tar.xz
/PackageKit-0.8.1.tar.xz
/PackageKit-0.8.2.tar.xz
/PackageKit-0.8.3.tar.xz
/PackageKit-0.8.4.tar.xz
/PackageKit-0.8.5.tar.xz
/PackageKit-0.8.6.tar.xz
/PackageKit-0.8.7.tar.xz
/PackageKit-0.8.8.tar.xz
/PackageKit-0.8.9.tar.xz
/PackageKit-0.8.11.tar.xz
/PackageKit-0.8.12.tar.xz
/PackageKit-0.8.13.tar.xz
/PackageKit-0.8.14.tar.xz
/PackageKit-0.8.15.tar.xz
/PackageKit-0.8.16.tar.xz
/PackageKit-0.9.1-20140130.tar.xz
/PackageKit-0.9.1-20140217.tar.xz
/PackageKit-0.9.1-20140226.tar.xz
/PackageKit-0.9.1-20140307.tar.xz
/PackageKit-0.9.1.tar.xz
/PackageKit-0.9.2.tar.xz
/PackageKit-0.9.3.tar.xz
/PackageKit-0.9.4.tar.xz
/PackageKit-0.9.5.tar.xz
/PackageKit-1.0.0.tar.xz
/PackageKit-1.0.1-20141015.tar.xz
/PackageKit-1.0.1.tar.xz
/PackageKit-1.0.3.tar.xz
/PackageKit-1.0.4.tar.xz
/PackageKit-1.0.5.tar.xz
/PackageKit-1.0.6.tar.xz
/PackageKit-1.0.7.tar.xz
/PackageKit-1.0.8.tar.xz
/PackageKit-1.0.9.tar.xz
/PackageKit-1.0.10.tar.xz
/PackageKit-1.0.11.tar.xz
/PackageKit-1.1.0.tar.xz
/PackageKit-1.1.1.tar.xz
/PackageKit-1.1.2.tar.xz
/PackageKit-1.1.3.tar.xz
/PackageKit-1.1.4-20160805.tar.xz
/libdnf-c0a107b.tar.gz
/PackageKit-1.1.4-20160825.tar.xz
/libdnf-0646992.tar.gz
/PackageKit-1.1.4-20160901.tar.xz
/libdnf-9cf4fb3.tar.gz
/PackageKit-1.1.4.tar.xz
/libdnf-ccd2e28.tar.gz
/libdnf-378d315.tar.gz
/PackageKit-1.1.5-20161221.tar.xz
/libdnf-3675456.tar.gz
/PackageKit-1.1.5.tar.xz
/libdnf-fe5a08b.tar.gz
/PackageKit-1.1.6.tar.xz
/PackageKit-1.1.7.tar.xz
/PackageKit-1.1.8.tar.xz
/PackageKit-1.1.9.tar.xz
/PackageKit-1.1.10.tar.xz
/PackageKit-1.1.11.tar.xz
/PackageKit-1.1.12.tar.xz
/PackageKit-1.1.13.tar.xz
/PackageKit-1.2.0.tar.xz
/PackageKit-1.2.1.tar.xz
/PackageKit-1.2.2.tar.xz
/PackageKit-1.2.3.tar.xz
/PackageKit-1.2.4.tar.xz
/PackageKit-1.2.5.tar.xz
/PackageKit-1.2.6.tar.xz
/PackageKit-1.2.8.tar.xz

View File

@ -4,8 +4,8 @@ diff -urNp PackageKit-0.8.14.old/etc/Vendor.conf PackageKit-0.8.14/etc/Vendor.co
@@ -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
# default=https://www.freedesktop.org/software/PackageKit/pk-package-not-found.html
-DefaultUrl=https://www.freedesktop.org/software/PackageKit/pk-package-not-found.html
+DefaultUrl=https://access.redhat.com/site/solutions/537113#Missing_Package
# The URL which is shown to the user when a codec could not be found.

View File

@ -1,95 +1,73 @@
%global _changelog_trimtime %(date +%s -d "1 year ago")
%global gitdate 20161221
%global bundled_libdnf 0
## START: Set by rpmautospec
## (rpmautospec version 0.6.5)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
release_number = 8;
base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec
%global glib2_version 2.54.0
%global libdnf_version 0.22.0
%if 0%{?bundled_libdnf}
%global commit1 fe5a08bca7e2599798af7778917da2cc31f1460e
%global shortcommit1 %(c=%{commit1}; echo ${c:0:7})
%endif
%global libdnf_version 0.43.1
Summary: Package management service
Name: PackageKit
Version: 1.1.12
Release: 8%{?dist}
License: GPLv2+ and LGPLv2+
Version: 1.2.8
Release: %autorelease
License: GPL-2.0-or-later AND LGPL-2.1-or-later
URL: http://www.freedesktop.org/software/PackageKit/
Source0: http://www.freedesktop.org/software/PackageKit/releases/%{name}-%{version}.tar.xz
%if 0%{?bundled_libdnf}
# https://github.com/rpm-software-management/libdnf
# Bundled because the library is API/ABI unstable, and we're trying to
# avoid being version locked with rpm-ostree/dnf right now.
Source1: https://github.com/rpm-software-management/libdnf/archive/%{commit1}/libdnf-%{shortcommit1}.tar.gz
Provides: bundled(libdnf) = 0.7.0
%if 0%{?fedora}
Patch0: PackageKit-0.3.8-Fedora-Vendor.conf.patch
%elif 0%{?rhel}
Patch0: PackageKit-0.3.8-RHEL-Vendor.conf.patch
%endif
# RHEL-specific: set Vendor.conf up for RHEL.
Patch0: rhel-Vendor.conf.patch
# https://pagure.io/fedora-workstation/issue/233
# https://github.com/PackageKit/PackageKit/pull/404
Patch1: package-remove-password-prompt.patch
# Backported from upstream
Patch1: 0001-dnf-Invalidate-the-sack-cache-after-downloading-new-.patch
Patch2: 0001-dnf-Don-t-override-DnfContext-s-release_ver-for-the-.patch
Patch3: 0001-command-not-found-Don-t-use-a-bash-regex-to-fix-othe.patch
Patch5: 0001-pk-transaction-Only-set-polkit-interactive-flag-if-t.patch
Patch6: 0002-pk-engine-Only-set-polkit-interactive-flag-if-method.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2283063
Patch2: appstream-mark-pk-as-compulsory.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1814820
Patch4: revert-shutdown-on-idle.patch
# https://github.com/PackageKit/PackageKit/pull/751
# https://github.com/PackageKit/PackageKit/pull/774
Patch3: runtime-warnings.patch
# https://github.com/PackageKit/PackageKit/commit/76cfb675fb31acc3ad5595d4380bfff56d2a8697
# to fix CVE-2026-41651
Patch7: 0001-Do-not-allow-re-invoking-methods-on-non-new-transact.patch
Patch4: 0001-Do-not-allow-re-invoking-methods-on-non-new-transact.patch
BuildRequires: glib2-devel >= %{glib2_version}
BuildRequires: xmlto
BuildRequires: gtk-doc
BuildRequires: sqlite-devel
BuildRequires: polkit-devel >= 0.92
BuildRequires: libtool
BuildRequires: gtk2-devel
BuildRequires: gtk3-devel
BuildRequires: docbook-utils
BuildRequires: yelp-tools
BuildRequires: intltool
BuildRequires: meson
BuildRequires: gettext
BuildRequires: vala-tools
BuildRequires: vala
BuildRequires: gstreamer1-devel
BuildRequires: gstreamer1-plugins-base-devel
BuildRequires: pango-devel
BuildRequires: fontconfig-devel
BuildRequires: libappstream-glib-devel
%if 0%{?bundled_libdnf}
BuildRequires: check-devel
BuildRequires: cmake
BuildRequires: librepo-devel
BuildRequires: libsolv-devel
BuildRequires: python2-devel
BuildRequires: python2-nose
BuildRequires: python2-sphinx
BuildRequires: rpm-devel
%else
BuildRequires: pkgconfig(appstream)
BuildRequires: libdnf-devel >= %{libdnf_version}
%endif
BuildRequires: systemd
BuildRequires: systemd-devel
BuildRequires: gobject-introspection-devel
BuildRequires: bash-completion
BuildRequires: python3-devel
%if 0%{?bundled_libdnf}
# Filter private libraries
%global __provides_exclude ^libdnf[.]so[.].*$
%global __requires_exclude ^libdnf[.]so[.].*$
%endif
# Validate metainfo
BuildRequires: libappstream-glib
Requires: %{name}-glib%{?_isa} = %{version}-%{release}
Requires: glib2%{?_isa} >= %{glib2_version}
%if ! 0%{?bundled_libdnf}
Requires: libdnf%{?_isa} >= %{libdnf_version}
%endif
Requires: shared-mime-info
Requires: systemd
@ -106,12 +84,6 @@ Obsoletes: PackageKit-yum < 0.9.1
Obsoletes: PackageKit-yum-plugin < 0.9.1
Obsoletes: PackageKit-zif < 0.8.13-2
# Removed in F23
Obsoletes: PackageKit-cached-metadata < 1.0.10-2
# Removed in F24
Obsoletes: PackageKit-browser-plugin < 1.0.11-3
# components now built-in
Obsoletes: PackageKit-debug-install < 0.9.1
Obsoletes: PackageKit-hawkey < 0.9.1
@ -120,14 +92,6 @@ Obsoletes: PackageKit-backend-devel < 0.9.6
# Udev no longer provides this functionality
Obsoletes: PackageKit-device-rebind < 0.8.13-2
# remove F22
Provides: PackageKit-debug-install = %{version}-%{release}
Provides: PackageKit-device-rebind = %{version}-%{release}
Provides: PackageKit-hawkey = %{version}-%{release}
Provides: PackageKit-yum = %{version}-%{release}
Provides: PackageKit-yum-plugin = %{version}-%{release}
Provides: PackageKit-zif = %{version}-%{release}
%description
PackageKit is a D-Bus abstraction layer that allows the session user
to manage packages in a secure way using a cross-distro,
@ -196,72 +160,34 @@ using PackageKit.
%prep
%autosetup -p1
%if 0%{?bundled_libdnf}
# Extract libdnf archive
tar -xf %{S:1}
%endif
%build
%if 0%{?bundled_libdnf}
mkdir -p libdnf-%{commit1}/build
pushd libdnf-%{commit1}/build
%cmake \
-DCMAKE_BUILD_TYPE=Release \
..
%make_build
popd
export DNF_CFLAGS="-I`pwd`/libdnf-%{commit1} `pkg-config --cflags appstream-glib`"
export DNF_LIBS="-L`pwd`/libdnf-%{commit1}/build/libdnf -ldnf -Wl,-rpath=%{_libdir}/PackageKit `pkg-config --libs appstream-glib`"
%endif
%configure \
--disable-static \
--enable-dnf \
--enable-introspection \
--enable-bash-completion \
--disable-local \
--disable-silent-rules
make %{?_smp_mflags} V=1
%meson \
-Dgtk_doc=true \
-Dpython_backend=false \
-Dpackaging_backend=dnf \
-Dlocal_checkout=false
%meson_build
%install
make install DESTDIR=$RPM_BUILD_ROOT
%meson_install
%if 0%{?bundled_libdnf}
# Install libdnf to a temporary prefix
make install DESTDIR=`pwd`/libdnf-install -C libdnf-%{commit1}/build
# Cherry pick the shared library
mkdir -p $RPM_BUILD_ROOT%{_libdir}/PackageKit
cp -a libdnf-install%{_libdir}/libdnf*.so.* $RPM_BUILD_ROOT%{_libdir}/PackageKit
%endif
rm -f $RPM_BUILD_ROOT%{_libdir}/libpackagekit*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/packagekit-backend/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/mozilla/plugins/packagekit-plugin.la
rm -f $RPM_BUILD_ROOT%{_libdir}/gtk-2.0/modules/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/gtk-3.0/modules/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/polkit-1/extensions/libpackagekit-action-lookup.la
# Create cache dir
mkdir -p %{buildroot}%{_localstatedir}/cache/PackageKit
# Create directories for downloaded appstream data
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/cache/app-info/{icons,xmls}
touch $RPM_BUILD_ROOT%{_localstatedir}/cache/PackageKit/groups.sqlite
mkdir -p %{buildroot}%{_localstatedir}/cache/app-info/{icons,xmls}
# create a link that GStreamer will recognise
pushd ${RPM_BUILD_ROOT}%{_libexecdir} > /dev/null
pushd %{buildroot}%{_libexecdir} > /dev/null
ln -s pk-gstreamer-install gst-install-plugins-helper
popd > /dev/null
# create a link that from the comps icons to PK, as PackageKit frontends
# cannot add /usr/share/pixmaps/comps to the icon search path as some distros
# do not use comps. Patching this in the frontend is not a good idea, as there
# are multiple frontends in multiple programming languages.
pushd ${RPM_BUILD_ROOT}%{_datadir}/PackageKit > /dev/null
ln -s ../pixmaps/comps icons
popd > /dev/null
%find_lang %name
%check
# FIXME: Validation fails in appstream-util because it does not recognize component type "service"
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.metainfo.xml || :
%post
# Remove leftover symlinks from /etc/systemd; the offline update service is
# instead now hooked into /usr/lib/systemd/system/system-update.target.wants
@ -271,27 +197,23 @@ systemctl disable packagekit-offline-update.service > /dev/null 2>&1 || :
%license COPYING
%doc README AUTHORS NEWS
%dir %{_datadir}/PackageKit
%dir %{_datadir}/PackageKit/helpers
%dir %{_sysconfdir}/PackageKit
%dir %{_localstatedir}/lib/PackageKit
%dir %{_localstatedir}/cache/app-info
%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
%{_datadir}/bash-completion/completions/pkcon
%dir %{_libdir}/packagekit-backend
%config(noreplace) %{_sysconfdir}/PackageKit/PackageKit.conf
%config(noreplace) %{_sysconfdir}/PackageKit/Vendor.conf
%config %{_sysconfdir}/dbus-1/system.d/*
%dir %{_datadir}/PackageKit/helpers/test_spawn
%{_datadir}/PackageKit/icons
%{_datadir}/PackageKit/helpers/test_spawn/*
%{_datadir}/man/man1/pkcon.1.gz
%{_datadir}/man/man1/pkmon.1.gz
%{_datadir}/man/man1/pkcon.1*
%{_datadir}/man/man1/pkmon.1*
%{_datadir}/polkit-1/actions/*.policy
%{_datadir}/polkit-1/rules.d/*
%{_datadir}/PackageKit/pk-upgrade-distro.sh
%{_datadir}/PackageKit/helpers/test_spawn/search-name.sh
%{_metainfodir}/org.freedesktop.packagekit.metainfo.xml
%{_libexecdir}/packagekitd
%{_libexecdir}/packagekit-direct
%{_bindir}/pkmon
@ -299,17 +221,17 @@ systemctl disable packagekit-offline-update.service > /dev/null 2>&1 || :
%exclude %{_libdir}/libpackagekit*.so.*
%{_libdir}/packagekit-backend/libpk_backend_dummy.so
%{_libdir}/packagekit-backend/libpk_backend_test_*.so
%if 0%{?bundled_libdnf}
%{_libdir}/PackageKit/
%endif
%ghost %verify(not md5 size mtime) %{_localstatedir}/lib/PackageKit/transactions.db
%ghost %verify(not md5 size mtime) %attr(0644,-,-) %{_localstatedir}/lib/PackageKit/transactions.db
%{_datadir}/dbus-1/system.d/*
%{_datadir}/dbus-1/system-services/*.service
%{_datadir}/dbus-1/interfaces/*.xml
%{_unitdir}/packagekit-offline-update.service
%{_unitdir}/packagekit.service
%{_unitdir}/system-update.target.wants/
%{_libexecdir}/pk-*offline-update
%{_libexecdir}/packagekit-dnf-refresh-repo
%{_libdir}/packagekit-backend/libpk_backend_dnf.so
%pycached %{python3_sitelib}/dnf-plugins/notify_packagekit.py
%files glib
%{_libdir}/*packagekit-glib2.so.*
@ -324,7 +246,6 @@ systemctl disable packagekit-offline-update.service > /dev/null 2>&1 || :
%{_libexecdir}/gst-install-plugins-helper
%files gtk3-module
%{_libdir}/gtk-2.0/modules/*.so
%{_libdir}/gtk-3.0/modules/*.so
%{_libdir}/gnome-settings-daemon-3.0/gtk-modules/*.desktop
@ -342,53 +263,232 @@ systemctl disable packagekit-offline-update.service > /dev/null 2>&1 || :
%{_datadir}/gir-1.0/PackageKitGlib-1.0.gir
%{_datadir}/gtk-doc/html/PackageKit
%{_datadir}/vala/vapi/packagekit-glib2.vapi
%{_datadir}/vala/vapi/packagekit-glib2.deps
%changelog
* Mon Apr 27 2026 Richard Hughes <rhughes@redhat.com> - 1.1.12-8
- Backport fix for CVE-2026-41651.
- Resolves: #RHEL-170493
## START: Generated by rpmautospec
* Mon Apr 27 2026 Richard Hughes <richard@hughsie.com> - 1.2.8-8
- Fix CVE-2026-41651
* Mon Apr 24 2023 Richard Hughes <rhughes@redhat.com> - 1.1.12-7
- Backport changes for passing interactive flag to polkit calls.
- Resolves: #2177711
* Thu Jul 25 2024 Milan Crha <mcrha@redhat.com> - 1.2.8-7
- Related: RHEL-39682 (Backport upstream patches to fix recent regressions)
* Fri May 22 2020 Michael Catanzaro <mcatanzaro@redhat.com> - 1.1.12-6
- Fix documentation links in Vendor.conf
- Resolves: #1837648
* Tue Jun 25 2024 Tomas Pelka <tpelka@redhat.com> - 1.2.8-6
- Add gating.yaml via API
* Tue May 19 2020 Michael Catanzaro <mcatanzaro@redhat.com> - 1.1.12-5
- Do not shutdown the daemon on idle
- Resolves: #1814820
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 1.2.8-5
- Bump release for June 2024 mass rebuild
* Mon Nov 25 2019 Richard Hughes <rhughes@redhat.com> - 1.1.12-4
- Do not use a bash regex to fix CNF on shells other than bash
- Resolves: #1728855
* Thu Jun 13 2024 Milan Crha <mcrha@redhat.com> - 1.2.8-4
- Resolves: RHEL-39682 (Mark PackageKit as compulsory in AppStream
metadata)
* Wed May 29 2019 Kalev Lember <klember@redhat.com> - 1.1.12-3
- Backport a patch to improve release_ver handling (#1714439)
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.8-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sat Dec 30 2023 Alessandro Astone <ales.astone@gmail.com> - 1.2.8-1
- Update to 1.2.8
* Tue Jul 25 2023 Adam Williamson <awilliam@redhat.com> - 1.2.6-11
- Backport PR #643 to fix symbol errors on Rawhide
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.6-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Thu Jun 15 2023 Python Maint <python-maint@redhat.com> - 1.2.6-9
- Rebuilt for Python 3.12
* Fri May 19 2023 Petr Písař <ppisar@redhat.com> - 1.2.6-8
- Rebuild against rpm-4.19
(https://fedoraproject.org/wiki/Changes/RPM-4.19)
* Wed Feb 22 2023 Richard Hughes <richard@hughsie.com> - 1.2.6-7
- migrated to SPDX license
* Tue Jan 24 2023 Michael Catanzaro <mcatanzaro@redhat.com> - 1.2.6-6
- Add patches to shut down on idle, including new dnf plugin
* Tue Jan 24 2023 Michael Catanzaro <mcatanzaro@redhat.com> - 1.2.6-5
- Revert "Add patches to shut down on idle, including new dnf plugin"
* Tue Jan 24 2023 Michael Catanzaro <mcatanzaro@redhat.com> - 1.2.6-4
- Revert "Avoid creating new -dnf-plugin subpackage"
* Mon Jan 23 2023 Michael Catanzaro <mcatanzaro@redhat.com> - 1.2.6-3
- Avoid creating new -dnf-plugin subpackage
* Mon Jan 23 2023 Michael Catanzaro <mcatanzaro@redhat.com> - 1.2.6-2
- Add patches to shut down on idle, including new dnf plugin
* Mon Jan 23 2023 Michael Catanzaro <mcatanzaro@redhat.com> - 1.2.6-1
- Update to 1.2.6
* Wed Jan 18 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Wed Jul 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Thu Feb 17 2022 Richard Hughes <rhughes@redhat.com> - 1.2.5-1
- New upstream release
- Properly handle allow-reinstall flag for installations
- Provide better error message if trying to install an installed package
- Searches by name and package details should be case insensitive
- Update appstream xml files if dnf_sack_add_repos() does the download
- Wait until online to activate systemd service
* Wed Jan 19 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Wed Oct 27 2021 Rex Dieter <rdieter@fedoraproject.org> - 1.2.4-3
- own /var/cache/PackageKit (#2016636)
* Fri Sep 10 2021 Adam Williamson <awilliam@redhat.com> - 1.2.4-2
- Backport PR #505 to fix offline upgrading (#2002609)
* Fri Jul 30 2021 Richard Hughes <rhughes@redhat.com> - 1.2.4-1
- New upstream release
- Add specific error code when user declined interaction
- Avoid spurious GObject::notify signal emissions
- Fix a leak on calling set_locale() a second time
- Fix a possible use-after-free under pk_client_cancel_cb()
- Honor install_weak_deps=False
- Improve thread safety on an operation cancellation
- Let the finish understand the 'cancelled' exit code
- Only set polkit interactive flag if method call has too
- Read update information also when getting list of updates
- Use 'hy_query_get_advisory_pkgs', if available
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Thu Jul 15 2021 Michael Catanzaro <mcatanzaro@redhat.com> - 1.2.3-2
- Add package-remove-password-prompt.patch for fedora-workstation#233
* Mon Mar 22 2021 Richard Hughes <rhughes@redhat.com> - 1.2.3-1
- New upstream release
- Add support for coercing upgrade to distupgrade
- Append to cron log instead of overwriting it
- Cancel a transaction if calling Cancel fails or the daemon disappears
- Remove large transaction size sanity check
* Mon Mar 08 2021 Richard Hughes <rhughes@redhat.com> - 1.2.2-5
- Drop unused gnome-doc-utils BR
* Tue Feb 09 2021 Kalev Lember <klember@redhat.com> - 1.2.2-4
- Fix multilib conflicts in generated pk-enum-types.h (#1915259)
* Mon Jan 25 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Mon Nov 9 2020 Vít Ondruch <vondruch@redhat.com> - 1.2.2-2
- Fix crash on login.
Resolves: rhbz#1836304
* Mon Nov 02 2020 Richard Hughes <rhughes@redhat.com> - 1.2.2-1
- New upstream release
- Notify systemd when beginning to shutdown
- Fix possible information disclosure
* Mon Sep 07 2020 Richard Hughes <rhughes@redhat.com> - 1.2.1-1
- New upstream release
- Actually merge in the PolicyKit translation
- Exit pkcon with retval 5 if no packages needed be installed
- Fix command-not-found handling arguments with spaces
- Fix setting libexecdir for command-not-found helper
- Use SQL statements for queries with input
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Fri May 08 2020 Adam Williamson <awilliam@redhat.com> - 1.2.0-3
- Fix packagekit-offline-update.service not being enabled (#1833176)
* Tue May 05 2020 Neal Gompa <ngompa13@gmail.com> - 1.2.0-2
- Clean up and simplify spec
- Fix packaging to work properly with EL8+
* Mon May 04 2020 Richard Hughes <rhughes@redhat.com> - 1.2.0-1
- New upstream release
- Do not do failable actions in constructors
- Load all the repos and vars directories
- Port to the meson build system
- Remove the GTK2 gtk-module support
- Revert "Shutdown the daemon on idle by default"
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.13-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Wed Jan 08 2020 Richard Hughes <rhughes@redhat.com> - 1.1.13-1
- New upstream release
- Don't use a bash regex to fix command not found on other shells
- Keep a ref on transaction while doing async polkit call
- Properly mark obsoleted packages when simulating upgrade
- Return directly when its state is going backwards
- Shrink the progress bar to fit when run in small spaces
- Support non-x86 arches in gstreamer helper
- zsh command not found should return the same as its bash equivalent
* Tue Aug 13 2019 Richard Hughes <rhughes@redhat.com> - 1.1.12-12
- Fix rpmdb permission of transaction database file
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.12-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Jul 19 2019 Richard Hughes <rhughes@redhat.com> - 1.1.12-10
- Do not trigger an inotity event when the AppStream XML data is unchanged
- Remove the unconditional copy to speed up gnome-software startup.
* Fri Jul 12 2019 Kalev Lember <klember@redhat.com> - 1.1.12-9
- Drop unused comps-extras requires
* Wed Jun 19 2019 Kalev Lember <klember@redhat.com> - 1.1.12-8
- Don't override DnfContext's release_ver for the running system
* Mon Jun 10 22:13:21 CET 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.1.12-7
- Rebuild for RPM 4.15
* Mon Jun 10 15:42:04 CET 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.1.12-6
- Rebuild for RPM 4.15
* Mon Mar 04 2019 Kalev Lember <klember@redhat.com> - 1.1.12-5
- Use new plymouth "system-upgrade" and "reboot" modes
* Mon Feb 04 2019 Kalev Lember <klember@redhat.com> - 1.1.12-4
- Update BRs for vala packaging changes
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.12-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Tue Dec 18 2018 Kalev Lember <klember@redhat.com> - 1.1.12-2
- Invalidate the sack cache after downloading new metadata
- Invalidate the sack cache after downloading new metadata (#1642878)
* Wed Nov 28 2018 Kalev Lember <klember@redhat.com> - 1.1.12-1
- Update to 1.1.12
* Wed Oct 24 2018 Richard Hughes <rhughes@redhat.com> - 1.1.10-6
- Backport a patch to fix modularity.
- Resolves: #1641091
* Tue Sep 25 2018 Richard Hughes <rhughes@redhat.com> - 1.1.11-1
- New upstream release
- Add --autoremove option to pkcon
- De-register callbacks on PkClientHelper finalize
- Don't complain if command-not-found get uninstalled while running
- Never assert when an interactive TTY is not available
- Shut down services cleanly before rebooting after offline updates
- Shutdown the daemon on idle by default
* Tue Oct 09 2018 Richard Hughes <rhughes@redhat.com> - 1.1.10-5
- Backport a patch to poke subscription manager when required
- Resolves: #1633244
* Sat Sep 22 2018 Adam Williamson <awilliam@redhat.com> - 1.1.10-5
- Backport several more fixes from master for libdnf compat
* Thu Jul 12 2018 Richard Hughes <rhughes@redhat.com> - 1.1.10-4
- Enable the DNF backend
* Tue Jul 24 2018 Stephen Gallagher <sgallagh@redhat.com> - 1.1.10-4
- Add patch to support modularity
* Wed Jul 11 2018 Charalampos Stratakis <cstratak@redhat.com> - 1.1.10-3
- Replace gnome-doc-utils with yelp-tools for the docs
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.10-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Thu Jun 14 2018 Richard Hughes <rhughes@redhat.com> - 1.1.10-2
- Don't depend on a dead package for gnome-packagekit
* Tue Jun 26 2018 Adam Williamson <awilliam@redhat.com> - 1.1.10-2
- Rebuild for new libdnf
* Mon Apr 23 2018 Richard Hughes <rhughes@redhat.com> - 1.1.10-1
- New upstream release
@ -656,3 +756,5 @@ systemctl disable packagekit-offline-update.service > /dev/null 2>&1 || :
- Remove the pkexec systemd helpers
- Remove the plugin interface
- Remove various options from the config file
## END: Generated by rpmautospec

View File

@ -1,25 +0,0 @@
From bb5d77c89eb0f98e7a76b7cdf14cfe9e79d387fa Mon Sep 17 00:00:00 2001
From: Richard Hughes <richard@hughsie.com>
Date: Mon, 25 Nov 2019 11:49:06 +0000
Subject: [PATCH] command-not-found: Don't use a bash regex to fix other shells
---
contrib/command-not-found/PackageKit.sh.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/command-not-found/PackageKit.sh.in b/contrib/command-not-found/PackageKit.sh.in
index ea90981f7..1e1fcdffd 100644
--- a/contrib/command-not-found/PackageKit.sh.in
+++ b/contrib/command-not-found/PackageKit.sh.in
@@ -11,7 +11,7 @@ command_not_found_handle () {
local retval=127
# only search for the command if we're interactive
- [[ $- =~ i ]] || runcnf=0
+ [[ $- == *"i"* ]] || runcnf=0
# don't run if DBus isn't running
[[ ! -S /run/dbus/system_bus_socket ]] && runcnf=0
--
2.23.0

View File

@ -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

View File

@ -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

View File

@ -1,56 +0,0 @@
From 0a46c047512e36d454800602b3845be35eb2dafe Mon Sep 17 00:00:00 2001
From: Philip Withnall <pwithnall@endlessos.org>
Date: Sat, 1 May 2021 01:08:59 +0100
Subject: [PATCH 1/2] pk-transaction: Only set polkit interactive flag if
transaction has too
This should fix polkit dialogues popping up when doing background
refresh operations, particularly for the
`org.freedesktop.packagekit.system-sources-refresh` action.
See
https://gitlab.gnome.org/GNOME/gnome-software/-/issues/582#note_1095101.
Note: This fix is only done through code inspection. I have not tried to
reproduce the failure case, and not tested that this commit actually
fixes it.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
---
src/pk-transaction.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/pk-transaction.c b/src/pk-transaction.c
index 83ee5588c..64b7def40 100644
--- a/src/pk-transaction.c
+++ b/src/pk-transaction.c
@@ -2252,6 +2252,7 @@ pk_transaction_authorize_actions (PkTransaction *transaction,
PkTransactionPrivate *priv = transaction->priv;
const gchar *text = NULL;
struct AuthorizeActionsData *data = NULL;
+ PolkitCheckAuthorizationFlags flags;
if (actions->len <= 0) {
g_debug ("No authentication required");
@@ -2338,13 +2339,17 @@ pk_transaction_authorize_actions (PkTransaction *transaction,
data->role = role;
data->actions = g_ptr_array_ref (actions);
+ flags = POLKIT_CHECK_AUTHORIZATION_FLAGS_NONE;
+ if (pk_backend_job_get_interactive (priv->job))
+ flags |= POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION;
+
g_debug ("authorizing action %s", action_id);
/* do authorization async */
polkit_authority_check_authorization (priv->authority,
priv->subject,
action_id,
details,
- POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION,
+ flags,
priv->cancellable,
(GAsyncReadyCallback) pk_transaction_authorize_actions_finished_cb,
data);
--
2.40.0

View File

@ -1,84 +0,0 @@
From b06fae505b66049e537ad15d3569c260e9bc976f Mon Sep 17 00:00:00 2001
From: Philip Withnall <pwithnall@endlessos.org>
Date: Sat, 1 May 2021 01:16:05 +0100
Subject: [PATCH 2/2] pk-engine: Only set polkit interactive flag if method
call has too
Same as the previous commit.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
---
src/pk-engine.c | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/src/pk-engine.c b/src/pk-engine.c
index 7ea87a448..3d6633ba6 100644
--- a/src/pk-engine.c
+++ b/src/pk-engine.c
@@ -632,6 +632,18 @@ pk_engine_is_proxy_unchanged (PkEngine *engine, const gchar *sender,
return TRUE;
}
+static PolkitCheckAuthorizationFlags
+get_polkit_flags_for_dbus_invocation (GDBusMethodInvocation *invocation)
+{
+ PolkitCheckAuthorizationFlags flags = POLKIT_CHECK_AUTHORIZATION_FLAGS_NONE;
+ GDBusMessage *message = g_dbus_method_invocation_get_message (invocation);
+
+ if (g_dbus_message_get_flags (message) & G_DBUS_MESSAGE_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION)
+ flags |= POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION;
+
+ return flags;
+}
+
static void
pk_engine_set_proxy (PkEngine *engine,
const gchar *proxy_http,
@@ -715,7 +727,7 @@ pk_engine_set_proxy (PkEngine *engine,
polkit_authority_check_authorization (engine->priv->authority, subject,
"org.freedesktop.packagekit.system-network-proxy-configure",
NULL,
- POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION,
+ get_polkit_flags_for_dbus_invocation (context),
NULL,
(GAsyncReadyCallback) pk_engine_action_obtain_proxy_authorization_finished_cb,
state);
@@ -1604,7 +1616,7 @@ pk_engine_offline_method_call (GDBusConnection *connection_, const gchar *sender
polkit_authority_check_authorization (engine->priv->authority, subject,
"org.freedesktop.packagekit.trigger-offline-update",
NULL,
- POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION,
+ get_polkit_flags_for_dbus_invocation (invocation),
NULL,
pk_engine_offline_helper_cb,
helper);
@@ -1618,7 +1630,7 @@ pk_engine_offline_method_call (GDBusConnection *connection_, const gchar *sender
polkit_authority_check_authorization (engine->priv->authority, subject,
"org.freedesktop.packagekit.clear-offline-update",
NULL,
- POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION,
+ get_polkit_flags_for_dbus_invocation (invocation),
NULL,
pk_engine_offline_helper_cb,
helper);
@@ -1645,7 +1657,7 @@ pk_engine_offline_method_call (GDBusConnection *connection_, const gchar *sender
polkit_authority_check_authorization (engine->priv->authority, subject,
"org.freedesktop.packagekit.trigger-offline-update",
NULL,
- POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION,
+ get_polkit_flags_for_dbus_invocation (invocation),
NULL,
pk_engine_offline_helper_cb,
helper);
@@ -1672,7 +1684,7 @@ pk_engine_offline_method_call (GDBusConnection *connection_, const gchar *sender
polkit_authority_check_authorization (engine->priv->authority, subject,
"org.freedesktop.packagekit.trigger-offline-upgrade",
NULL,
- POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION,
+ get_polkit_flags_for_dbus_invocation (invocation),
NULL,
pk_engine_offline_helper_cb,
helper);
--
2.40.0

View File

@ -1,41 +0,0 @@
From c9c13747e575fe2ce398cec200284d0318aaece3 Mon Sep 17 00:00:00 2001
From: Michael Catanzaro <mcatanzaro@gnome.org>
Date: Wed, 29 Apr 2020 13:44:41 -0500
Subject: [PATCH] Revert "Shutdown the daemon on idle by default"
This reverts commit 0c84d71509e851db20445c747529bd7d3724f081.
This broke the end session dialog in GNOME Shell.
I thought I had that fixed by changing GNOME Shell to autostart
PackageKit when it is not already running:
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1104
But turns out, there are more problems. The update fails if the user has
used dnf since PackageKit last quit, a scenario I did not test. It also
results in GNOME Software getting confused about what software is
installed and what software is not. The issues are discussed here:
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1227#note_784327
It's still desirable to shut down automatically, but it requires more
planning. And shutting down GNOME Software itself is frankly more
important, since it uses a lot more RAM than packagekitd.
---
src/pk-main.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/pk-main.c b/src/pk-main.c
index 7a0bbd199..5791c5fef 100644
--- a/src/pk-main.c
+++ b/src/pk-main.c
@@ -178,8 +178,6 @@ main (int argc, char *argv[])
/* after how long do we timeout? */
exit_idle_time = g_key_file_get_integer (conf, "Daemon", "ShutdownTimeout", NULL);
- if (exit_idle_time == 0)
- exit_idle_time = 300;
g_debug ("daemon shutdown set to %i seconds", exit_idle_time);
/* override the backend name */

View File

@ -0,0 +1,35 @@
From d8f84f7e0a017e0b4df1e08a2a6be832c9fb3611 Mon Sep 17 00:00:00 2001
From: Matthias Klumpp <matthias@tenstral.net>
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 @@
<url type="homepage">https://www.freedesktop.org/software/PackageKit</url>
<launchable type="service">packagekit.service</launchable>
+
+ <compulsory_for_desktop>Cinnamon</compulsory_for_desktop>
+ <compulsory_for_desktop>GNOME</compulsory_for_desktop>
+ <compulsory_for_desktop>KDE</compulsory_for_desktop>
+ <compulsory_for_desktop>LXQt</compulsory_for_desktop>
+ <compulsory_for_desktop>MATE</compulsory_for_desktop>
+ <compulsory_for_desktop>Pantheon</compulsory_for_desktop>
+ <compulsory_for_desktop>Unity</compulsory_for_desktop>
+ <compulsory_for_desktop>XFCE</compulsory_for_desktop>
+
<categories>
<category>System</category>
</categories>

View File

@ -0,0 +1,32 @@
From 8914e11968a934faa651311fd98a98a3a19218ae Mon Sep 17 00:00:00 2001
From: Michael Catanzaro <mcatanzaro@gnome.org>
Date: Wed, 3 Jun 2020 10:45:12 -0500
Subject: [PATCH] Allow admin users to remove packages without password prompt
A local, active admin user can install packages without a password
prompt, but has to enter the admin password to remove packages. This
doesn't make much sense. It should be parallel.
Note that this change has no effect on what users are able to do,
because it only applies to admin users. The password only protects
against unlocked workstation attackers, where an attacker gains physical
access to an unlocked desktop. It's pretty weird to prevent such an
attacker from removing software, but allow installing new stuff.
https://pagure.io/fedora-workstation/issue/233
---
policy/org.freedesktop.packagekit.rules | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/policy/org.freedesktop.packagekit.rules b/policy/org.freedesktop.packagekit.rules
index 6a1c8a701..95d21925f 100644
--- a/policy/org.freedesktop.packagekit.rules
+++ b/policy/org.freedesktop.packagekit.rules
@@ -1,5 +1,6 @@
polkit.addRule(function(action, subject) {
- if (action.id == "org.freedesktop.packagekit.package-install" &&
+ if ((action.id == "org.freedesktop.packagekit.package-install" ||
+ action.id == "org.freedesktop.packagekit.package-remove") &&
subject.active == true && subject.local == true &&
subject.isInGroup("wheel")) {
return polkit.Result.YES;

460
runtime-warnings.patch Normal file
View File

@ -0,0 +1,460 @@
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] 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;
}
}

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (PackageKit-1.2.8.tar.xz) = b1dc1ba3bea53e127099cfa0aaeb6e72a7ab1597ebb3baef5ca92806c208b0b6d5bcbaf8da8ea38434aa5fd725f57c96929101692be644d97f93d9cc32f6dcde