SHA256
1
0
forked from pool/PackageKit

3 Commits

Author SHA256 Message Date
Jonathan Kang
276ffc4839 Add PackageKit-zypp-parallel-package-downloads.patch
zypp: Implement parallel downloading
(gh#PackageKit/PackageKit/commit/dd39d2982, bsc#1244920).
2025-10-21 09:44:52 +08:00
ecc0ef3e8d Accepting request 1208158 from GNOME:Factory
- Drop rcFOO symlinks (PED-266)
- Drop usage of update-alternatives, but simplify installation of
  /usr/libexec/gst-install-plugins-helper as a direct symlink to
  pk-gstreamer-install. (forwarded request 1208110 from dimstar)

OBS-URL: https://build.opensuse.org/request/show/1208158
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/PackageKit?expand=0&rev=240
2024-10-16 21:37:33 +00:00
6ed8a14be9 - Drop rcFOO symlinks (PED-266)
- Drop usage of update-alternatives, but simplify installation of
  /usr/libexec/gst-install-plugins-helper as a direct symlink to
  pk-gstreamer-install.

OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/PackageKit?expand=0&rev=459
2024-10-15 14:45:40 +00:00
3 changed files with 150 additions and 24 deletions

View File

@@ -0,0 +1,125 @@
Index: PackageKit-1.2.8/backends/zypp/meson.build
===================================================================
--- PackageKit-1.2.8.orig/backends/zypp/meson.build
+++ PackageKit-1.2.8/backends/zypp/meson.build
@@ -1,6 +1,6 @@
add_languages('cpp')
-zypp_dep = dependency('libzypp', version: '>=17.31.0')
+zypp_dep = dependency('libzypp', version: '>=17.36.4')
# define if libzypp returns package size in bytes
zypp_args = []
Index: PackageKit-1.2.8/backends/zypp/pk-backend-zypp.cpp
===================================================================
--- PackageKit-1.2.8.orig/backends/zypp/pk-backend-zypp.cpp
+++ PackageKit-1.2.8/backends/zypp/pk-backend-zypp.cpp
@@ -68,6 +68,7 @@
#include <zypp/Resolvable.h>
#include <zypp/SrcPackage.h>
#include <zypp/TmpPath.h>
+#include <zypp/UserData.h>
#include <zypp/ZYpp.h>
#include <zypp/ZYppCallbacks.h>
#include <zypp/ZYppFactory.h>
@@ -160,6 +161,8 @@ guint _dl_count = 0;
guint _dl_progress = 0;
guint _dl_status = 0;
+gint _preload_progress = 0;
+
/**
* Build a package_id from the specified resolvable. The returned
* gchar * should be freed with g_free ().
@@ -505,6 +508,59 @@ struct DigestReportReceiver : public zyp
}
};
+struct CommitPreloadReportReceiver : public zypp::callback::ReceiveReport<zypp::media::CommitPreloadReport>, ZyppBackendReceiver
+{
+ virtual void start(const zypp::callback::UserData &userData = zypp::callback::UserData())
+ {
+ MIL << "[CommitPreload] Started preloading files..." << endl;
+
+ _preload_progress = 0;
+ pk_backend_job_set_status (_job, PK_STATUS_ENUM_DOWNLOAD);
+ }
+
+ virtual bool progress(int value, const zypp::callback::UserData &userData = zypp::callback::UserData())
+ {
+ // Only update the progress if it's a different value
+ if (_preload_progress != value) {
+ MIL << "[CommitPreload] Progress: " << value << "%" << endl;
+
+ _preload_progress = value;
+ pk_backend_job_set_percentage (_job, value);
+ }
+
+ return true;
+ }
+
+ virtual void fileStart (const Pathname &localfile, const zypp::callback::UserData &userData = zypp::callback::UserData())
+ {
+ MIL << "[CommitPreload] Starting: " << localfile.asString() << endl;
+ }
+
+ virtual void fileDone (const Pathname &localfile, Error error, const zypp::callback::UserData &userData = zypp::callback::UserData())
+ {
+ if (error == NO_ERROR)
+ MIL << "[CommitPreload] Finished: " << localfile.asString() << endl;
+ else {
+ MIL << "[CommitPreload] Error on: " << localfile.asString() << " (" << error << ")" << endl;
+ if (userData.haskey("description"))
+ MIL << " Reason: " << userData.get<std::string>("description") << endl;
+ }
+ }
+
+ virtual void finish(Result res, const zypp::callback::UserData &userData = zypp::callback::UserData())
+ {
+ if (res == SUCCESS) {
+ MIL << "[CommitPreload] All files fetched successfully." << endl;
+ }
+ else {
+ MIL << "[CommitPreload] Some files are missing!" << endl;
+ }
+
+ _preload_progress = 100;
+ pk_backend_job_set_percentage (_job, 100);
+ }
+};
+
class EventDirector
{
private:
@@ -517,6 +573,7 @@ class EventDirector
ZyppBackend::DigestReportReceiver _digestReport;
ZyppBackend::MediaChangeReportReceiver _mediaChangeReport;
ZyppBackend::ProgressReportReceiver _progressReport;
+ ZyppBackend::CommitPreloadReportReceiver _commitPreloadReport;
public:
EventDirector ()
@@ -530,6 +587,7 @@ class EventDirector
_digestReport.connect ();
_mediaChangeReport.connect ();
_progressReport.connect ();
+ _commitPreloadReport.connect ();
}
void setJob(PkBackendJob *job)
@@ -543,6 +601,7 @@ class EventDirector
_digestReport._job = job;
_mediaChangeReport._job = job;
_progressReport._job = job;
+ _commitPreloadReport._job = job;
}
~EventDirector ()
@@ -556,6 +615,7 @@ class EventDirector
_digestReport.disconnect ();
_mediaChangeReport.disconnect ();
_progressReport.disconnect ();
+ _commitPreloadReport.disconnect ();
}
};

View File

@@ -1,3 +1,18 @@
-------------------------------------------------------------------
Thu Aug 21 08:47:17 UTC 2025 - Jonathan Kang <songchuan.kang@suse.com>
- Add PackageKit-zypp-parallel-package-downloads.patch:
zypp: Implement parallel downloading
(gh#PackageKit/PackageKit/commit/dd39d2982, bsc#1244920).
-------------------------------------------------------------------
Tue Oct 15 11:48:02 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>
- Drop rcFOO symlinks (PED-266)
- Drop usage of update-alternatives, but simplify installation of
/usr/libexec/gst-install-plugins-helper as a direct symlink to
pk-gstreamer-install.
-------------------------------------------------------------------
Thu Sep 12 07:53:31 UTC 2024 - Jonathan Kang <songchuan.kang@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package PackageKit
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -61,6 +61,8 @@ Patch16: PackageKit-dynamic-export.patch
Patch17: PackageKit-mark-as-compulsory.patch
# PATCH-FIX-UPSTREAM PackageKit-zypp-dont-install-updateCandidateObj.patch bsc#1227389, gh#PackageKit/PackageKit/commit/209aa6295 sckang@suse.com -- zypp: Mark the correct packages to-be-installed
Patch18: PackageKit-zypp-dont-install-updateCandidateObj.patch
# PATCH-FIX-UPSTREAM PackageKit-zypp-parallel-package-downloads.patch gh#PackageKit/PackageKit/commit/dd39d2982, bsc#1244920 sckang@suse.com -- zypp: Implement parallel downloading
Patch19: PackageKit-zypp-parallel-package-downloads.patch
# PATCH-FIX-SLE PackageKit-find-python-3-6.patch alynx.zhou@suse.com -- Build PackageKit with Python 3.6
Patch1001: PackageKit-find-python-3-6.patch
@@ -176,8 +178,6 @@ need it.
Summary: Install GStreamer codecs using PackageKit
License: GPL-2.0-or-later
Group: Productivity/Multimedia/Other
Requires(post): update-alternatives
Requires(postun): update-alternatives
Recommends: %{name} = %{version}
Supplements: (%{name} and gstreamer-plugins-base)
@@ -290,6 +290,7 @@ This package provides the upstream default configuration for PackageKit.
%patch -P 16 -p1
%patch -P 17 -p1
%patch -P 18 -p1
%patch -P 19 -p1
%if 0%{?sle_version} && 0%{?sle_version} < 160000
%patch -P 1001 -p1
%endif
@@ -318,15 +319,12 @@ This package provides the upstream default configuration for PackageKit.
mkdir -p %{buildroot}%{_unitdir}/system-update.target.wants/
ln -sf ../packagekit-offline-update.service %{buildroot}%{_unitdir}/system-update.target.wants/packagekit-offline-update.service
%endif
# Prepare for update-alternatives
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
ln -s -f %{_sysconfdir}/alternatives/gst-install-plugins-helper %{buildroot}/%{_libexecdir}/gst-install-plugins-helper
# Add rcFOO symlinks
mkdir -p %{buildroot}%{_sbindir}
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcpackagekit
%if %{with offline_updates}
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcpackagekit-offline-update
%endif
# create a link that GStreamer will recognise
pushd %{buildroot}%{_libexecdir} > /dev/null
ln -s pk-gstreamer-install gst-install-plugins-helper
popd > /dev/null
# install transactions.db to another directory so that we can use tmpfiles.d to create a link to it under /var/lib/PackageKit
install -m 0644 %{buildroot}%{_localstatedir}/lib/PackageKit/transactions.db %{buildroot}%{_datadir}/PackageKit/transactions.db
rm %{buildroot}%{_localstatedir}/lib/PackageKit/transactions.db
@@ -376,15 +374,6 @@ install -m 0644 %{SOURCE3} %{buildroot}%{_prefix}/lib/tmpfiles.d/%{name}.conf
%service_del_postun_without_restart packagekit-offline-update.service
%endif
%post gstreamer-plugin
update-alternatives --install %{_libexecdir}/gst-install-plugins-helper gst-install-plugins-helper %{_libexecdir}/pk-gstreamer-install 10
%postun gstreamer-plugin
# Note: we don't use "$1 -eq 0", to avoid issues if the package gets renamed
if [ ! -f %{_libexecdir}/pk-gstreamer-install ]; then
update-alternatives --remove gst-install-plugins-helper %{_libexecdir}/pk-gstreamer-install
fi
%post -n libpackagekit-glib2-18 -p /sbin/ldconfig
%postun -n libpackagekit-glib2-18 -p /sbin/ldconfig
@@ -416,7 +405,6 @@ fi
%{_unitdir}/packagekit.service
%{_unitdir}/packagekit-background.service
%{_unitdir}/packagekit-background.timer
%{_sbindir}/rcpackagekit
%{_mandir}/man?/*%{ext_man}
%{_tmpfilesdir}/PackageKit.conf
%if %{with offline_updates}
@@ -424,7 +412,6 @@ fi
%{_unitdir}/packagekit-offline-update.service
%dir %{_unitdir}/system-update.target.wants
%{_unitdir}/system-update.target.wants/packagekit-offline-update.service
%{_sbindir}/rcpackagekit-offline-update
%endif
%ghost %dir %{_localstatedir}/lib/PackageKit
%ghost %dir %{_localstatedir}/cache/PackageKit
@@ -448,7 +435,6 @@ fi
%endif
%files gstreamer-plugin
%ghost %{_sysconfdir}/alternatives/gst-install-plugins-helper
%{_libexecdir}/gst-install-plugins-helper
%{_libexecdir}/pk-gstreamer-install