diff --git a/0001-rpm-ostree-Fix-error-paths-in-Transaction.patch b/0001-rpm-ostree-Fix-error-paths-in-Transaction.patch new file mode 100644 index 0000000..a2bec3b --- /dev/null +++ b/0001-rpm-ostree-Fix-error-paths-in-Transaction.patch @@ -0,0 +1,52 @@ +From 451c683b661b9bf6103952bbeb8a118821d0b29b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Timoth=C3=A9e=20Ravier?= +Date: Mon, 18 Mar 2024 14:32:38 +0100 +Subject: [PATCH 1/2] rpm-ostree: Fix error paths in Transaction + +Make sure that all error paths mark the transaction as completed before +returning. +--- + .../backends/RpmOstreeBackend/RpmOstreeTransaction.cpp | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/libdiscover/backends/RpmOstreeBackend/RpmOstreeTransaction.cpp b/libdiscover/backends/RpmOstreeBackend/RpmOstreeTransaction.cpp +index f021f7a0f..d3bd5ca47 100644 +--- a/libdiscover/backends/RpmOstreeBackend/RpmOstreeTransaction.cpp ++++ b/libdiscover/backends/RpmOstreeBackend/RpmOstreeTransaction.cpp +@@ -211,6 +211,7 @@ void RpmOstreeTransaction::processCommand(int exitCode, QProcess::ExitStatus exi + const QJsonDocument jsonDocument = QJsonDocument::fromJson(m_stdout); + if (!jsonDocument.isObject()) { + qWarning() << "rpm-ostree-backend: Could not parse output as JSON:" << m_prog << m_args; ++ setStatus(Status::DoneWithErrorStatus); + return; + } + +@@ -218,6 +219,7 @@ void RpmOstreeTransaction::processCommand(int exitCode, QProcess::ExitStatus exi + const QString newVersion = jsonDocument.object().value(QLatin1String("Labels")).toObject().value(QLatin1String("version")).toString(); + if (newVersion.isEmpty()) { + qInfo() << "rpm-ostree-backend: Could not get the version from the container labels"; ++ setStatus(Status::DoneWithErrorStatus); + return; + } + +@@ -233,6 +235,8 @@ void RpmOstreeTransaction::processCommand(int exitCode, QProcess::ExitStatus exi + // Should never happen + qWarning() << "rpm-ostree-backend: Error: Unknown resource format. Please file a bug."; + passiveMessage(i18n("rpm-ostree-backend: Error: Unknown resource format. Please file a bug.")); ++ setStatus(Status::DoneWithErrorStatus); ++ return; + } + + // Always tell the backend to look for a new major version +@@ -259,6 +263,8 @@ void RpmOstreeTransaction::processCommand(int exitCode, QProcess::ExitStatus exi + // This should never happen + qWarning() << "rpm-ostree-backend: Error: Unknown operation requested. Please file a bug."; + passiveMessage(i18n("rpm-ostree-backend: Error: Unknown operation requested. Please file a bug.")); ++ setStatus(Status::DoneWithErrorStatus); ++ return; + } + setStatus(Status::DoneStatus); + } +-- +2.44.0 + diff --git a/0002-rpm-ostree-Fix-version-checks-for-container-path.patch b/0002-rpm-ostree-Fix-version-checks-for-container-path.patch new file mode 100644 index 0000000..89369a3 --- /dev/null +++ b/0002-rpm-ostree-Fix-version-checks-for-container-path.patch @@ -0,0 +1,50 @@ +From 1af71d2964b2e0c28c3c6c0fd6d52bc1adda9507 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Timoth=C3=A9e=20Ravier?= +Date: Mon, 18 Mar 2024 14:34:23 +0100 +Subject: [PATCH 2/2] rpm-ostree: Fix version checks for container path + +Starting with rpm-ostree v2024.3, the version is only set with the +'org.opencontainers.image.version' label and no longer with the +'version' one. + +Check the new label first and the old one second to be compatible with +all images. + +See: +- https://github.com/coreos/rpm-ostree/releases/tag/v2024.3 +- https://github.com/coreos/rpm-ostree/pull/4794 +- https://github.com/ostreedev/ostree-rs-ext/pull/581 +--- + .../RpmOstreeBackend/RpmOstreeTransaction.cpp | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +diff --git a/libdiscover/backends/RpmOstreeBackend/RpmOstreeTransaction.cpp b/libdiscover/backends/RpmOstreeBackend/RpmOstreeTransaction.cpp +index d3bd5ca47..2b5b1f52e 100644 +--- a/libdiscover/backends/RpmOstreeBackend/RpmOstreeTransaction.cpp ++++ b/libdiscover/backends/RpmOstreeBackend/RpmOstreeTransaction.cpp +@@ -215,12 +215,17 @@ void RpmOstreeTransaction::processCommand(int exitCode, QProcess::ExitStatus exi + return; + } + +- // Get the version stored in .Labels.version +- const QString newVersion = jsonDocument.object().value(QLatin1String("Labels")).toObject().value(QLatin1String("version")).toString(); ++ // Get the version stored in 'org.opencontainers.image.version' label ++ QString newVersion = ++ jsonDocument.object().value(QLatin1String("Labels")).toObject().value(QLatin1String("org.opencontainers.image.version")).toString(); + if (newVersion.isEmpty()) { +- qInfo() << "rpm-ostree-backend: Could not get the version from the container labels"; +- setStatus(Status::DoneWithErrorStatus); +- return; ++ // Check the 'version' label for compatibility with older rpm-ostree releases (< v2024.03) ++ newVersion = jsonDocument.object().value(QLatin1String("Labels")).toObject().value(QLatin1String("version")).toString(); ++ if (newVersion.isEmpty()) { ++ qWarning() << "rpm-ostree-backend: Could not get the version from the container labels"; ++ setStatus(Status::DoneWithErrorStatus); ++ return; ++ } + } + + QVersionNumber newVersionNumber = QVersionNumber::fromString(newVersion); +-- +2.44.0 + diff --git a/plasma-discover.spec b/plasma-discover.spec index a1bdff7..0dd8fe0 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.0.2 -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 @@ -27,6 +27,10 @@ Source10: discoverrc # It is double the time that Fedora repos are set to in DNF (6h). Patch200: discover-pk-refresh-timer.patch +# See: https://invent.kde.org/plasma/discover/-/merge_requests/790 +Patch201: 0001-rpm-ostree-Fix-error-paths-in-Transaction.patch +Patch202: 0002-rpm-ostree-Fix-version-checks-for-container-path.patch + ## upstreamable patches BuildRequires: appstream-qt-devel >= 1.0.0~ @@ -305,6 +309,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.kde.discover.desk %changelog +* Sat Mar 23 2024 Timothée Ravier - 6.0.2-2 +- Backport patches to fix rpm-ostree container support + * Tue Mar 12 2024 Marc Deop i Argemí - 6.0.2-1 - 6.0.2