public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/plasma-discover] f45: Backport MR #1443 to fix RHBZ #2480694
@ 2026-10-20 20:56 Adam Williamson
  0 siblings, 0 replies; only message in thread
From: Adam Williamson @ 2026-10-20 20:56 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/plasma-discover
Branch : f45
Commit : 3017c55942d53222081ef1cc7868acf9127035f9
Author : Adam Williamson <adamwill@fedoraproject.org>
Date   : 2026-10-20T13:56:26-07:00
Stats  : +72/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/plasma-discover/c/3017c55942d53222081ef1cc7868acf9127035f9?branch=f45

Log:
Backport MR #1443 to fix RHBZ #2480694

---
diff --git a/0001-PackageKitBackend-always-return-highest-versioned-av.patch b/0001-PackageKitBackend-always-return-highest-versioned-av.patch
new file mode 100644
index 0000000..d8cd291
--- /dev/null
+++ b/0001-PackageKitBackend-always-return-highest-versioned-av.patch
@@ -0,0 +1,64 @@
+From dd43490456805dfde4efb500800a3578cffc78b7 Mon Sep 17 00:00:00 2001
+From: Adam Williamson <adamwill@fedoraproject.org>
+Date: Mon, 19 Oct 2026 17:02:17 -0700
+Subject: [PATCH] PackageKitBackend: always return highest versioned
+ availablePackageId
+
+When the m_packages struct contains multiple package IDs,
+PackageKitResource::availablePackageId() has always just made an
+assumption about which one to return. Before 9572f935 it assumed
+the last one was the right one. Since 9572f935 it assumes the first
+one is the right one.
+
+I don't think any assumption is a good idea, here. The current
+assumption seems to be incorrect, per
+https://bugzilla.redhat.com/show_bug.cgi?id=2480694 and my
+investigation in comment 13. Just flipping back to assuming the
+last ID is the right one doesn't seem like a good idea.
+
+Instead, let's actually iterate over the available IDs, get the
+version for each one, and return the one with the highest version.
+
+This should fix things so we don't install old versions when
+multiple versions are available from different repositories.
+
+Signed-off-by: Adam Williamson <adamwill@fedoraproject.org>
+---
+ .../PackageKitBackend/PackageKitResource.cpp       | 14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/libdiscover/backends/PackageKitBackend/PackageKitResource.cpp b/libdiscover/backends/PackageKitBackend/PackageKitResource.cpp
+index cb3411eb5..57a3f0dc1 100644
+--- a/libdiscover/backends/PackageKitBackend/PackageKitResource.cpp
++++ b/libdiscover/backends/PackageKitBackend/PackageKitResource.cpp
+@@ -12,6 +12,7 @@
+ #include "appstream/AppStreamUtils.h"
+ #include "config-paths.h"
+ #include <AppStreamQt/spdx.h>
++#include <AppStreamQt/utils.h>
+ #include <KIO/ApplicationLauncherJob>
+ #include <KLocalizedString>
+ #include <KService>
+@@ -72,7 +73,18 @@ QString PackageKitResource::availablePackageId() const
+ 
+     const auto it = m_packages.constFind(PackageKit::Transaction::InfoAvailable);
+     if (it != m_packages.constEnd()) {
+-        return it->first();
++        // find highest versioned entry
++        QString highest;
++        QVector<QString> pkgstocheck = it->archPkgIds;
++        if (it->archPkgIds.isEmpty()) {
++            pkgstocheck = it->nonarchPkgIds;
++        }
++        for (const QString &val : pkgstocheck) {
++            if (highest.isEmpty() || AppStream::Utils::vercmpSimple(PackageKit::Daemon::packageVersion(val), PackageKit::Daemon::packageVersion(highest)) > 0) {
++                highest = val;
++            }
++        }
++        return highest;
+     }
+     return installedPackageId();
+ }
+-- 
+2.55.0
+

diff --git a/plasma-discover.spec b/plasma-discover.spec
index 07c1a35..51cd048 100644
--- a/plasma-discover.spec
+++ b/plasma-discover.spec
@@ -9,7 +9,7 @@
 Name:    plasma-discover
 Summary: KDE and Plasma resources management GUI
 Version: 6.7.5
-Release: 1%{?dist}
+Release: 2%{?dist}
 
 License: BSD-3-Clause AND CC0-1.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-only AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-3.0-only AND (GPL-2.0-only OR GPL-3.0-only) AND (LGPL-2.1-only OR LGPL-3.0-only)
 URL:     https://invent.kde.org/plasma/discover
@@ -29,6 +29,10 @@ Source10: discoverrc
 Patch200: discover-pk-refresh-timer.patch
 
 ## upstreamable patches
+# https://invent.kde.org/plasma/discover/-/merge_requests/1443
+# https://bugzilla.redhat.com/show_bug.cgi?id=2480694
+# make sure we install the highest available version of apps
+Patch201: 0001-PackageKitBackend-always-return-highest-versioned-av.patch
 
 # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
 ExcludeArch: %{ix86}
@@ -312,6 +316,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.kde.discover.desk
 %{_kf6_qtplugindir}/discover/kns-backend.so
 
 %changelog
+* Tue Oct 20 2026 Adam Williamson <adamwill@fedoraproject.org> - 6.7.5-2
+- Backport MR #1443 to fix RHBZ #2480694
+
 * Tue Sep 08 2026 Steve Cossette <farchord@gmail.com> - 6.7.5-1
 - 6.7.5
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-20 20:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-20 20:56 [rpms/plasma-discover] f45: Backport MR #1443 to fix RHBZ #2480694 Adam Williamson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox