public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: kde-frameworks/solid/, kde-frameworks/solid/files/
@ 2018-05-18 21:15 Andreas Sturmlechner
  0 siblings, 0 replies; 6+ messages in thread
From: Andreas Sturmlechner @ 2018-05-18 21:15 UTC (permalink / raw
  To: gentoo-commits

commit:     2788f8958bc6e09965f9b238ce9653f4159d5823
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Fri May 18 21:05:11 2018 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Fri May 18 21:09:53 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2788f895

kde-frameworks/solid: Fix dolphin crash on unmount

Package-Manager: Portage-2.3.38, Repoman-2.3.9

 .../files/solid-5.46.0-crash-on-unmount.patch      | 193 +++++++++++++++++++++
 kde-frameworks/solid/solid-5.46.0-r1.ebuild        |  35 ++++
 2 files changed, 228 insertions(+)

diff --git a/kde-frameworks/solid/files/solid-5.46.0-crash-on-unmount.patch b/kde-frameworks/solid/files/solid-5.46.0-crash-on-unmount.patch
new file mode 100644
index 00000000000..378890b6b87
--- /dev/null
+++ b/kde-frameworks/solid/files/solid-5.46.0-crash-on-unmount.patch
@@ -0,0 +1,193 @@
+From 967dc53dc9a5d1c7ba0c9f57fcb9bc640cd9663b Mon Sep 17 00:00:00 2001
+From: Kai Uwe Broulik <kde@privat.broulik.de>
+Date: Wed, 16 May 2018 14:37:33 +0200
+Subject: [FStab Handling] Clean up process running by using lambdas
+
+Encapsulates the QProcess* into the job it's supposed to be doing without storing it as a member and polluting state when multiple
+actions are requested simultaneously.
+
+CCBUG: 388499
+
+Differential Revision: https://phabricator.kde.org/D9653
+---
+ src/solid/devices/backends/fstab/fstabhandling.cpp | 29 +++++++--------
+ src/solid/devices/backends/fstab/fstabhandling.h   |  9 ++---
+ .../devices/backends/fstab/fstabstorageaccess.cpp  | 42 ++++++++--------------
+ .../devices/backends/fstab/fstabstorageaccess.h    |  3 --
+ 4 files changed, 30 insertions(+), 53 deletions(-)
+
+diff --git a/src/solid/devices/backends/fstab/fstabhandling.cpp b/src/solid/devices/backends/fstab/fstabhandling.cpp
+index 9d078dd..e56f55a 100644
+--- a/src/solid/devices/backends/fstab/fstabhandling.cpp
++++ b/src/solid/devices/backends/fstab/fstabhandling.cpp
+@@ -226,34 +226,31 @@ QStringList Solid::Backends::Fstab::FstabHandling::options(const QString &device
+     return options;
+ }
+ 
+-QProcess *Solid::Backends::Fstab::FstabHandling::callSystemCommand(const QString &commandName,
+-        const QStringList &args,
+-        QObject *obj, const char *slot)
++bool Solid::Backends::Fstab::FstabHandling::callSystemCommand(const QString &commandName, const QStringList &args,
++                                                              const QObject *receiver, std::function<void(QProcess *)> callback)
+ {
+     QStringList env = QProcess::systemEnvironment();
+     env.replaceInStrings(QRegExp("^PATH=(.*)", Qt::CaseInsensitive), "PATH=/sbin:/bin:/usr/sbin/:/usr/bin");
+ 
+-    QProcess *process = new QProcess(obj);
++    QProcess *process = new QProcess();
+ 
+-    QObject::connect(process, SIGNAL(finished(int,QProcess::ExitStatus)),
+-                     obj, slot);
++    QObject::connect(process, static_cast<void(QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), receiver,
++        [process, callback](int exitCode, QProcess::ExitStatus exitStatus) {
++            Q_UNUSED(exitCode);
++            Q_UNUSED(exitStatus);
++            callback(process);
++            process->deleteLater();
++    });
+ 
+     process->setEnvironment(env);
+     process->start(commandName, args);
+ 
+     if (process->waitForStarted()) {
+-        return process;
+-    } else {
+-        delete process;
+-        return nullptr;
++        return true;
+     }
+-}
+ 
+-QProcess *Solid::Backends::Fstab::FstabHandling::callSystemCommand(const QString &commandName,
+-        const QString &device,
+-        QObject *obj, const char *slot)
+-{
+-    return callSystemCommand(commandName, QStringList() << device, obj, slot);
++    delete process;
++    return false;
+ }
+ 
+ void Solid::Backends::Fstab::FstabHandling::_k_updateMtabMountPointsCache()
+diff --git a/src/solid/devices/backends/fstab/fstabhandling.h b/src/solid/devices/backends/fstab/fstabhandling.h
+index 2b6b9d9..bcd6c33 100644
+--- a/src/solid/devices/backends/fstab/fstabhandling.h
++++ b/src/solid/devices/backends/fstab/fstabhandling.h
+@@ -25,6 +25,8 @@
+ #include <QtCore/QString>
+ #include <QtCore/QMultiHash>
+ 
++#include <functional>
++
+ class QProcess;
+ class QObject;
+ 
+@@ -44,12 +46,7 @@ public:
+     static QStringList currentMountPoints(const QString &device);
+     static QStringList mountPoints(const QString &device);
+     static QStringList options(const QString &device);
+-    static QProcess *callSystemCommand(const QString &commandName,
+-                                       const QStringList &args,
+-                                       QObject *obj, const char *slot);
+-    static QProcess *callSystemCommand(const QString &commandName,
+-                                       const QString &device,
+-                                       QObject *obj, const char *slot);
++    static bool callSystemCommand(const QString &commandName, const QStringList &args, const QObject *recvr, std::function<void(QProcess *)> callback);
+     static void flushMtabCache();
+     static void flushFstabCache();
+ 
+diff --git a/src/solid/devices/backends/fstab/fstabstorageaccess.cpp b/src/solid/devices/backends/fstab/fstabstorageaccess.cpp
+index a4063ff..e8fce5b 100644
+--- a/src/solid/devices/backends/fstab/fstabstorageaccess.cpp
++++ b/src/solid/devices/backends/fstab/fstabstorageaccess.cpp
+@@ -91,10 +91,13 @@ bool FstabStorageAccess::setup()
+         return false;
+     }
+     m_fstabDevice->broadcastActionRequested("setup");
+-    m_process = FstabHandling::callSystemCommand("mount", filePath(),
+-                this, SLOT(slotSetupFinished(int,QProcess::ExitStatus)));
+-
+-    return m_process != nullptr;
++    return FstabHandling::callSystemCommand("mount", {filePath()}, this, [this](QProcess *process) {
++        if (process->exitCode() == 0) {
++            m_fstabDevice->broadcastActionDone("setup", Solid::NoError, QString());
++        } else {
++            m_fstabDevice->broadcastActionDone("setup", Solid::UnauthorizedOperation, process->readAllStandardError());
++        }
++    });
+ }
+ 
+ void FstabStorageAccess::slotSetupRequested()
+@@ -108,10 +111,13 @@ bool FstabStorageAccess::teardown()
+         return false;
+     }
+     m_fstabDevice->broadcastActionRequested("teardown");
+-    m_process = FstabHandling::callSystemCommand("umount", filePath(),
+-                this, SLOT(slotTeardownFinished(int,QProcess::ExitStatus)));
+-
+-    return m_process != nullptr;
++    return FstabHandling::callSystemCommand("umount", {filePath()}, this, [this](QProcess *process) {
++        if (process->exitCode() == 0) {
++            m_fstabDevice->broadcastActionDone("teardown", Solid::NoError, QString());
++        } else {
++            m_fstabDevice->broadcastActionDone("teardown", Solid::UnauthorizedOperation, process->readAllStandardError());
++        }
++    });
+ }
+ 
+ void FstabStorageAccess::slotTeardownRequested()
+@@ -119,31 +125,11 @@ void FstabStorageAccess::slotTeardownRequested()
+     emit teardownRequested(m_fstabDevice->udi());
+ }
+ 
+-void FstabStorageAccess::slotSetupFinished(int exitCode, QProcess::ExitStatus /*exitStatus*/)
+-{
+-    if (exitCode == 0) {
+-        m_fstabDevice->broadcastActionDone("setup", Solid::NoError, QString());
+-    } else {
+-        m_fstabDevice->broadcastActionDone("setup", Solid::UnauthorizedOperation, m_process->readAllStandardError());
+-    }
+-    delete m_process;
+-}
+-
+ void FstabStorageAccess::slotSetupDone(int error, const QString &errorString)
+ {
+     emit setupDone(static_cast<Solid::ErrorType>(error), errorString, m_fstabDevice->udi());
+ }
+ 
+-void FstabStorageAccess::slotTeardownFinished(int exitCode, QProcess::ExitStatus /*exitStatus*/)
+-{
+-    if (exitCode == 0) {
+-        m_fstabDevice->broadcastActionDone("teardown", Solid::NoError, QString());
+-    } else {
+-        m_fstabDevice->broadcastActionDone("teardown", Solid::UnauthorizedOperation, m_process->readAllStandardError());
+-    }
+-    delete m_process;
+-}
+-
+ void FstabStorageAccess::slotTeardownDone(int error, const QString &errorString)
+ {
+     emit teardownDone(static_cast<Solid::ErrorType>(error), errorString, m_fstabDevice->udi());
+diff --git a/src/solid/devices/backends/fstab/fstabstorageaccess.h b/src/solid/devices/backends/fstab/fstabstorageaccess.h
+index 10ca0a9..61deb88 100644
+--- a/src/solid/devices/backends/fstab/fstabstorageaccess.h
++++ b/src/solid/devices/backends/fstab/fstabstorageaccess.h
+@@ -68,8 +68,6 @@ Q_SIGNALS:
+     void teardownRequested(const QString &udi) Q_DECL_OVERRIDE;
+ 
+ private Q_SLOTS:
+-    void slotSetupFinished(int exitCode, QProcess::ExitStatus exitStatus);
+-    void slotTeardownFinished(int exitCode, QProcess::ExitStatus exitStatus);
+     void onMtabChanged(const QString &device);
+     void connectDBusSignals();
+ 
+@@ -80,7 +78,6 @@ private Q_SLOTS:
+ 
+ private:
+     Solid::Backends::Fstab::FstabDevice *m_fstabDevice;
+-    QProcess *m_process;
+     QString m_filePath;
+     bool m_isAccessible;
+     bool m_isIgnored;
+-- 
+cgit v0.11.2
+

diff --git a/kde-frameworks/solid/solid-5.46.0-r1.ebuild b/kde-frameworks/solid/solid-5.46.0-r1.ebuild
new file mode 100644
index 00000000000..89de724de8e
--- /dev/null
+++ b/kde-frameworks/solid/solid-5.46.0-r1.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+VIRTUALX_REQUIRED="test"
+inherit kde5
+
+DESCRIPTION="Provider for platform independent hardware discovery, abstraction and management"
+LICENSE="LGPL-2.1+"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+IUSE="nls"
+
+RDEPEND="
+	$(add_qt_dep qtdbus)
+	$(add_qt_dep qtdeclarative)
+	$(add_qt_dep qtwidgets)
+	$(add_qt_dep qtxml)
+	sys-fs/udisks:2
+	virtual/udev
+"
+DEPEND="${RDEPEND}
+	nls? ( $(add_qt_dep linguist-tools) )
+	test? ( $(add_qt_dep qtconcurrent) )
+"
+
+PATCHES=( "${FILESDIR}/${P}-crash-on-unmount.patch" )
+
+pkg_postinst() {
+	kde5_pkg_postinst
+
+	if ! has_version "app-misc/media-player-info" ; then
+		einfo "For media player support, install app-misc/media-player-info"
+	fi
+}


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: kde-frameworks/solid/, kde-frameworks/solid/files/
@ 2021-08-01 19:32 Andreas Sturmlechner
  0 siblings, 0 replies; 6+ messages in thread
From: Andreas Sturmlechner @ 2021-08-01 19:32 UTC (permalink / raw
  To: gentoo-commits

commit:     5ef49fb17ef357eb022915082470ccbe8537b199
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Aug  1 19:25:59 2021 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun Aug  1 19:32:38 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5ef49fb1

kde-frameworks/solid: Backport upstream port to qstrcmp()

Upstream commit e5964d13f36901e7768ca38064125a5c5c28a939

See also: https://mail.kde.org/pipermail/distributions/2021-July/001036.html

Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../solid/files/solid-5.84.0-qstrcmp.patch         | 35 ++++++++++++++
 kde-frameworks/solid/solid-5.84.0-r1.ebuild        | 53 ++++++++++++++++++++++
 2 files changed, 88 insertions(+)

diff --git a/kde-frameworks/solid/files/solid-5.84.0-qstrcmp.patch b/kde-frameworks/solid/files/solid-5.84.0-qstrcmp.patch
new file mode 100644
index 00000000000..bdba981b8ac
--- /dev/null
+++ b/kde-frameworks/solid/files/solid-5.84.0-qstrcmp.patch
@@ -0,0 +1,35 @@
+From e5964d13f36901e7768ca38064125a5c5c28a939 Mon Sep 17 00:00:00 2001
+From: Ahmad Samir <a.samirh78@gmail.com>
+Date: Thu, 22 Jul 2021 01:26:37 +0200
+Subject: [PATCH] Use qstrcmp instead of strcmp
+
+qstrcmp can handle NULL args.
+
+This fixes an issue on Slackware, which doesn't use systemd and /var/run
+is a bind mount of /run, and for some reason mnt_fs_get_root(fs) would return
+NULL, which led to crashes in dolphin and plasmashell, see:
+https://invent.kde.org/frameworks/solid/-/commit/ef0b0dfa00b1de70c6d8e6913bbfdb79e7d3d1b6#note_276583
+---
+ src/solid/devices/backends/udisks2/udisksstorageaccess.cpp | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/solid/devices/backends/udisks2/udisksstorageaccess.cpp b/src/solid/devices/backends/udisks2/udisksstorageaccess.cpp
+index 1566787..35d1aa8 100644
+--- a/src/solid/devices/backends/udisks2/udisksstorageaccess.cpp
++++ b/src/solid/devices/backends/udisks2/udisksstorageaccess.cpp
+@@ -92,9 +92,9 @@ static QString baseMountPoint(const QByteArray &dev)
+             const QByteArray devicePath = dev.endsWith('\x00') ? dev.chopped(1) : dev;
+ 
+             while (mnt_table_next_fs(table, itr, &fs) == 0) {
+-                if (mnt_fs_get_srcpath(fs) == devicePath
+-                    // Base mount point will have "/" as root fs
+-                    && (strcmp(mnt_fs_get_root(fs), "/") == 0)) {
++                if (mnt_fs_get_srcpath(fs) == devicePath //
++                    && (qstrcmp(mnt_fs_get_root(fs), "/") == 0) // Base mount point will have "/" as root fs
++                ) {
+                     mountPoint = QFile::decodeName(mnt_fs_get_target(fs));
+                     break;
+                 }
+-- 
+GitLab
+

diff --git a/kde-frameworks/solid/solid-5.84.0-r1.ebuild b/kde-frameworks/solid/solid-5.84.0-r1.ebuild
new file mode 100644
index 00000000000..dfd61f86b42
--- /dev/null
+++ b/kde-frameworks/solid/solid-5.84.0-r1.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+QTMIN=5.15.2
+VIRTUALX_REQUIRED="test"
+inherit ecm kde.org optfeature
+
+DESCRIPTION="Provider for platform independent hardware discovery, abstraction and management"
+
+LICENSE="LGPL-2.1+"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
+IUSE="ios nls"
+
+RDEPEND="
+	>=dev-qt/qtdbus-${QTMIN}:5
+	>=dev-qt/qtdeclarative-${QTMIN}:5
+	>=dev-qt/qtgui-${QTMIN}:5
+	>=dev-qt/qtxml-${QTMIN}:5
+	sys-apps/util-linux
+	sys-fs/udisks:2
+	virtual/libudev:=
+	ios? (
+		app-pda/libimobiledevice:=
+		app-pda/libplist:=
+	)
+"
+DEPEND="${RDEPEND}
+	test? ( >=dev-qt/qtconcurrent-${QTMIN}:5 )
+"
+BDEPEND="
+	sys-devel/bison
+	sys-devel/flex
+	nls? ( >=dev-qt/linguist-tools-${QTMIN}:5 )
+"
+
+PATCHES=( "${FILESDIR}/${P}-qstrcmp.patch" )
+
+src_configure() {
+	local mycmakeargs=(
+		$(cmake_use_find_package ios IMobileDevice)
+		$(cmake_use_find_package ios PList)
+	)
+	ecm_src_configure
+}
+
+pkg_postinst() {
+	if [[ -z "${REPLACING_VERSIONS}" ]]; then
+		optfeature "media player devices support" app-misc/media-player-info
+	fi
+	ecm_pkg_postinst
+}


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: kde-frameworks/solid/, kde-frameworks/solid/files/
@ 2022-01-20 13:26 Andreas Sturmlechner
  0 siblings, 0 replies; 6+ messages in thread
From: Andreas Sturmlechner @ 2022-01-20 13:26 UTC (permalink / raw
  To: gentoo-commits

commit:     9cce54b509898e120239847fb54850a05f75f5ae
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 20 12:07:31 2022 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Thu Jan 20 13:24:19 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9cce54b5

kde-frameworks/solid: Properly round up battery's capacity

Upstream commit 2f305a7134f27489203c3fd2e9ca81790f35ac3b
KDE-bug: https://bugs.kde.org/show_bug.cgi?id=448372

Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 ...id-5.90.0-properly-round-battery-capacity.patch | 31 ++++++++++++
 kde-frameworks/solid/solid-5.90.0-r1.ebuild        | 55 ++++++++++++++++++++++
 2 files changed, 86 insertions(+)

diff --git a/kde-frameworks/solid/files/solid-5.90.0-properly-round-battery-capacity.patch b/kde-frameworks/solid/files/solid-5.90.0-properly-round-battery-capacity.patch
new file mode 100644
index 000000000000..77296074bfa7
--- /dev/null
+++ b/kde-frameworks/solid/files/solid-5.90.0-properly-round-battery-capacity.patch
@@ -0,0 +1,31 @@
+From 2f305a7134f27489203c3fd2e9ca81790f35ac3b Mon Sep 17 00:00:00 2001
+From: ivan tkachenko <me@ratijas.tk>
+Date: Mon, 17 Jan 2022 02:24:44 +0300
+Subject: [PATCH] [upower] Properly round up battery's capacity
+
+The same rounding is already used for charge percent just few lines
+above. Without it, for example, values that are close to 100%
+(e.g. 99.9825%) were rounded down to 99% instead of up to 100%.
+
+BUG: 448372
+FIXED-IN: 5.91
+---
+ src/solid/devices/backends/upower/upowerbattery.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/solid/devices/backends/upower/upowerbattery.cpp b/src/solid/devices/backends/upower/upowerbattery.cpp
+index 22b25d9..055856b 100644
+--- a/src/solid/devices/backends/upower/upowerbattery.cpp
++++ b/src/solid/devices/backends/upower/upowerbattery.cpp
+@@ -84,7 +84,7 @@ int Battery::chargePercent() const
+ 
+ int Battery::capacity() const
+ {
+-    return m_device.data()->prop("Capacity").toDouble();
++    return qRound(m_device.data()->prop("Capacity").toDouble());
+ }
+ 
+ bool Battery::isRechargeable() const
+-- 
+GitLab
+

diff --git a/kde-frameworks/solid/solid-5.90.0-r1.ebuild b/kde-frameworks/solid/solid-5.90.0-r1.ebuild
new file mode 100644
index 000000000000..4848819bb62a
--- /dev/null
+++ b/kde-frameworks/solid/solid-5.90.0-r1.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+QTMIN=5.15.2
+VIRTUALX_REQUIRED="test"
+inherit ecm kde.org optfeature
+
+DESCRIPTION="Provider for platform independent hardware discovery, abstraction and management"
+
+LICENSE="LGPL-2.1+"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
+IUSE="ios nls"
+
+RDEPEND="
+	>=dev-qt/qtdbus-${QTMIN}:5
+	>=dev-qt/qtdeclarative-${QTMIN}:5
+	>=dev-qt/qtgui-${QTMIN}:5
+	>=dev-qt/qtxml-${QTMIN}:5
+	sys-apps/util-linux
+	sys-fs/udisks:2
+	virtual/libudev:=
+	ios? (
+		app-pda/libimobiledevice:=
+		app-pda/libplist:=
+	)
+"
+DEPEND="${RDEPEND}
+	test? ( >=dev-qt/qtconcurrent-${QTMIN}:5 )
+"
+BDEPEND="
+	sys-devel/bison
+	sys-devel/flex
+	nls? ( >=dev-qt/linguist-tools-${QTMIN}:5 )
+"
+
+PATCHES=(
+	"${FILESDIR}/${P}-properly-round-battery-capacity.patch" # KDE-bug 448372
+)
+
+src_configure() {
+	local mycmakeargs=(
+		$(cmake_use_find_package ios IMobileDevice)
+		$(cmake_use_find_package ios PList)
+	)
+	ecm_src_configure
+}
+
+pkg_postinst() {
+	if [[ -z "${REPLACING_VERSIONS}" ]]; then
+		optfeature "media player devices support" app-misc/media-player-info
+	fi
+	ecm_pkg_postinst
+}


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: kde-frameworks/solid/, kde-frameworks/solid/files/
@ 2024-11-05 22:50 Andreas Sturmlechner
  0 siblings, 0 replies; 6+ messages in thread
From: Andreas Sturmlechner @ 2024-11-05 22:50 UTC (permalink / raw
  To: gentoo-commits

commit:     3f422998c2f5436dca345f6e37efebee09b34488
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Tue Nov  5 22:48:47 2024 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Tue Nov  5 22:50:03 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3f422998

kde-frameworks/solid: Fix crash on udisks eject

KDE-bug: https://bugs.kde.org/show_bug.cgi?id=464149

Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../files/solid-6.7.0-fix-crash-on-eject.patch     | 69 ++++++++++++++++++++++
 kde-frameworks/solid/solid-6.7.0-r1.ebuild         | 50 ++++++++++++++++
 2 files changed, 119 insertions(+)

diff --git a/kde-frameworks/solid/files/solid-6.7.0-fix-crash-on-eject.patch b/kde-frameworks/solid/files/solid-6.7.0-fix-crash-on-eject.patch
new file mode 100644
index 000000000000..4b37cec7b13a
--- /dev/null
+++ b/kde-frameworks/solid/files/solid-6.7.0-fix-crash-on-eject.patch
@@ -0,0 +1,69 @@
+From 1852a8c8460a100c3fd09021bf4b26410866def6 Mon Sep 17 00:00:00 2001
+From: Nicolas Fella <nicolas.fella@gmx.de>
+Date: Sun, 1 Sep 2024 23:19:55 +0200
+Subject: [PATCH 1/2] [udisks] Don't add/remove devices in slotMediaChanged
+
+We get notified when devices are added via InterfacesAdded/InterfacesRemoved.
+
+When ejecting from a CD drive we first get slotMediaChanged, where we
+remove the device from m_deviceCache. Then we get InterfacesRemoved
+for org.freedesktop.UDisks2.Filesystem. Because the
+org.freedesktop.UDisks2.Block interface is still there we remove and
+immediately readd the device. Then in DeviceManagerPrivate::_k_deviceAdded
+we call createBackendObject, which fails to create a backend because
+the uid is not in m_deviceCache any more. Then we assert because the
+backend is empty.
+
+CCBUG: 464149
+
+(cherry picked from commit 99510948944ecda04f9cec6b3bd94b140d191a1c)
+---
+
+From 1c76a103ebae87c99fa7461bc2760544ca0945f8 Mon Sep 17 00:00:00 2001
+From: Nicolas Fella <nicolas.fella@gmx.de>
+Date: Fri, 1 Nov 2024 17:44:39 +0100
+Subject: [PATCH 2/2] Restore MediaChanged handling for Audio CDs
+
+99510948944ecda04f9cec6b3bd94b140d191a1c removed this because
+it's unneeded for non-audio CDs and is causing problems.
+
+However without it adding or removing audio CDs isn't handled,
+so restore it, but only if there is no FileSystem interface
+(i.e. no data CD)
+
+(cherry picked from commit df5843ed76065f0e56d1189d010e10497c17f936)
+---
+ src/solid/devices/backends/udisks2/udisksmanager.cpp | 19 +++++++++++--------
+ 1 file changed, 11 insertions(+), 8 deletions(-)
+
+diff --git a/src/solid/devices/backends/udisks2/udisksmanager.cpp b/src/solid/devices/backends/udisks2/udisksmanager.cpp
+index 1f1a7e73..799face7 100644
+--- a/src/solid/devices/backends/udisks2/udisksmanager.cpp
++++ b/src/solid/devices/backends/udisks2/udisksmanager.cpp
+@@ -265,15 +265,18 @@ void Manager::slotMediaChanged(const QDBusMessage &msg)
+     qulonglong size = properties.value(QStringLiteral("Size")).toULongLong();
+     qCDebug(UDISKS2) << "MEDIA CHANGED in" << udi << "; size is:" << size;
+ 
+-    if (!m_deviceCache.contains(udi) && size > 0) { // we don't know the optdisc, got inserted
+-        m_deviceCache.append(udi);
+-        Q_EMIT deviceAdded(udi);
+-    }
++    Device device(udi);
++    if (!device.interfaces().contains(u"org.freedesktop.UDisks2.Filesystem")) {
++        if (!m_deviceCache.contains(udi) && size > 0) { // we don't know the optdisc, got inserted
++            m_deviceCache.append(udi);
++            Q_EMIT deviceAdded(udi);
++        }
+ 
+-    if (m_deviceCache.contains(udi) && size == 0) { // we know the optdisc, got removed
+-        Q_EMIT deviceRemoved(udi);
+-        m_deviceCache.removeAll(udi);
+-        DeviceBackend::destroyBackend(udi);
++        if (m_deviceCache.contains(udi) && size == 0) { // we know the optdisc, got removed
++            Q_EMIT deviceRemoved(udi);
++            m_deviceCache.removeAll(udi);
++            DeviceBackend::destroyBackend(udi);
++        }
+     }
+ }
+ 

diff --git a/kde-frameworks/solid/solid-6.7.0-r1.ebuild b/kde-frameworks/solid/solid-6.7.0-r1.ebuild
new file mode 100644
index 000000000000..f87091791eb3
--- /dev/null
+++ b/kde-frameworks/solid/solid-6.7.0-r1.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+QTMIN=6.6.2
+inherit ecm frameworks.kde.org optfeature
+
+DESCRIPTION="Provider for platform independent hardware discovery, abstraction and management"
+
+LICENSE="LGPL-2.1+"
+KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86"
+IUSE="ios"
+
+RDEPEND="
+	>=dev-qt/qtbase-${QTMIN}:6[dbus,gui,xml]
+	>=dev-qt/qtdeclarative-${QTMIN}:6
+	sys-apps/util-linux
+	sys-fs/udisks:2
+	virtual/libudev:=
+	ios? (
+		app-pda/libimobiledevice:=
+		app-pda/libplist:=
+	)
+"
+DEPEND="${RDEPEND}
+	test? ( >=dev-qt/qtbase-${QTMIN}:6[concurrent] )
+"
+BDEPEND="
+	app-alternatives/lex
+	app-alternatives/yacc
+	>=dev-qt/qttools-${QTMIN}:6[linguist]
+"
+
+PATCHES=( "${FILESDIR}/${P}-fix-crash-on-eject.patch" ) # KDE-bug 464149
+
+src_configure() {
+	local mycmakeargs=(
+		$(cmake_use_find_package ios IMobileDevice)
+		$(cmake_use_find_package ios PList)
+	)
+	ecm_src_configure
+}
+
+pkg_postinst() {
+	if [[ -z "${REPLACING_VERSIONS}" ]]; then
+		optfeature "media player devices support" app-misc/media-player-info
+	fi
+	ecm_pkg_postinst
+}


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: kde-frameworks/solid/, kde-frameworks/solid/files/
@ 2024-11-15 13:46 Andreas Sturmlechner
  0 siblings, 0 replies; 6+ messages in thread
From: Andreas Sturmlechner @ 2024-11-15 13:46 UTC (permalink / raw
  To: gentoo-commits

commit:     a628f1fbc68740bf9a9ea3c829b5df8a6783328c
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 15 13:31:17 2024 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Fri Nov 15 13:46:30 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a628f1fb

kde-frameworks/solid: fstab: Emit accessibilityChanged only when changed

See also:
https://invent.kde.org/frameworks/solid/-/merge_requests/179

Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 ....0-accessibilityChanged-only-when-changed.patch | 43 ++++++++++++++++++
 kde-frameworks/solid/solid-5.116.0-r1.ebuild       | 52 ++++++++++++++++++++++
 2 files changed, 95 insertions(+)

diff --git a/kde-frameworks/solid/files/solid-5.116.0-accessibilityChanged-only-when-changed.patch b/kde-frameworks/solid/files/solid-5.116.0-accessibilityChanged-only-when-changed.patch
new file mode 100644
index 000000000000..4791f19dfb49
--- /dev/null
+++ b/kde-frameworks/solid/files/solid-5.116.0-accessibilityChanged-only-when-changed.patch
@@ -0,0 +1,43 @@
+From d8d9502e5fee9e35ee4b8dc7e5aeabee962fb0c2 Mon Sep 17 00:00:00 2001
+From: Kai Uwe Broulik <kai.uwe.broulik@basyskom.com>
+Date: Wed, 18 Sep 2024 12:37:37 +0200
+Subject: [PATCH] fstab: Emit accessibilityChanged only when actually changed
+
+Otherwise this will signal a change whenever mtab changes,
+leading to redundant updates and wakeups downstream.
+
+Signed-off-by: Kiriakos Antoniadis <kiriakos.antoniadis@advantest.com>
+(cherry picked from commit 493e5e3b919d7e421e5355c43fd5dbdfcdbabaa8)
+---
+ .../devices/backends/fstab/fstabstorageaccess.cpp    | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/src/solid/devices/backends/fstab/fstabstorageaccess.cpp b/src/solid/devices/backends/fstab/fstabstorageaccess.cpp
+index 6baaf1d7..5c46cc82 100644
+--- a/src/solid/devices/backends/fstab/fstabstorageaccess.cpp
++++ b/src/solid/devices/backends/fstab/fstabstorageaccess.cpp
+@@ -145,13 +145,17 @@ void FstabStorageAccess::onMtabChanged(const QString &device)
+     if (currentMountPoints.isEmpty()) {
+         // device umounted
+         m_filePath = FstabHandling::mountPoints(device).first();
+-        m_isAccessible = false;
+-        Q_EMIT accessibilityChanged(false, QString(FSTAB_UDI_PREFIX) + "/" + device);
++        if (m_isAccessible) {
++            m_isAccessible = false;
++            Q_EMIT accessibilityChanged(false, QString(FSTAB_UDI_PREFIX) + "/" + device);
++        }
+     } else {
+         // device added
+         m_filePath = currentMountPoints.first();
+-        m_isAccessible = true;
+-        Q_EMIT accessibilityChanged(true, QString(FSTAB_UDI_PREFIX) + "/" + device);
++        if (!m_isAccessible) {
++            m_isAccessible = true;
++            Q_EMIT accessibilityChanged(true, QString(FSTAB_UDI_PREFIX) + "/" + device);
++        }
+     }
+ }
+ 
+-- 
+GitLab
+

diff --git a/kde-frameworks/solid/solid-5.116.0-r1.ebuild b/kde-frameworks/solid/solid-5.116.0-r1.ebuild
new file mode 100644
index 000000000000..aa3e75dc981d
--- /dev/null
+++ b/kde-frameworks/solid/solid-5.116.0-r1.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+QTMIN=5.15.9
+inherit ecm frameworks.kde.org optfeature
+
+DESCRIPTION="Provider for platform independent hardware discovery, abstraction and management"
+
+LICENSE="LGPL-2.1+"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86"
+IUSE="ios"
+
+RDEPEND="
+	>=dev-qt/qtdbus-${QTMIN}:5
+	>=dev-qt/qtdeclarative-${QTMIN}:5
+	>=dev-qt/qtgui-${QTMIN}:5
+	>=dev-qt/qtxml-${QTMIN}:5
+	sys-apps/util-linux
+	sys-fs/udisks:2
+	virtual/libudev:=
+	ios? (
+		app-pda/libimobiledevice:=
+		app-pda/libplist:=
+	)
+"
+DEPEND="${RDEPEND}
+	test? ( >=dev-qt/qtconcurrent-${QTMIN}:5 )
+"
+BDEPEND="
+	app-alternatives/lex
+	app-alternatives/yacc
+	>=dev-qt/linguist-tools-${QTMIN}:5
+"
+
+PATCHES=( "${FILESDIR}/${P}-accessibilityChanged-only-when-changed.patch" )
+
+src_configure() {
+	local mycmakeargs=(
+		$(cmake_use_find_package ios IMobileDevice)
+		$(cmake_use_find_package ios PList)
+	)
+	ecm_src_configure
+}
+
+pkg_postinst() {
+	if [[ -z "${REPLACING_VERSIONS}" ]]; then
+		optfeature "media player devices support" app-misc/media-player-info
+	fi
+	ecm_pkg_postinst
+}


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: kde-frameworks/solid/, kde-frameworks/solid/files/
@ 2024-12-14 22:37 Andreas Sturmlechner
  0 siblings, 0 replies; 6+ messages in thread
From: Andreas Sturmlechner @ 2024-12-14 22:37 UTC (permalink / raw
  To: gentoo-commits

commit:     e22889b93a3eacdce57bdb30cc0204164f705071
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 14 22:35:15 2024 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sat Dec 14 22:36:49 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e22889b9

kde-frameworks/solid: Add null check for StorageAccess interface

... in storageAccessFromPath

KDE-bug: https://bugs.kde.org/show_bug.cgi?id=497299
KDE-bug: https://bugs.kde.org/show_bug.cgi?id=492578

Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../solid/files/solid-6.7.0-crashfix.patch         | 68 ++++++++++++++++++++++
 kde-frameworks/solid/solid-6.7.0-r2.ebuild         | 53 +++++++++++++++++
 kde-frameworks/solid/solid-6.8.0-r1.ebuild         | 50 ++++++++++++++++
 3 files changed, 171 insertions(+)

diff --git a/kde-frameworks/solid/files/solid-6.7.0-crashfix.patch b/kde-frameworks/solid/files/solid-6.7.0-crashfix.patch
new file mode 100644
index 000000000000..3f4ad2c9377b
--- /dev/null
+++ b/kde-frameworks/solid/files/solid-6.7.0-crashfix.patch
@@ -0,0 +1,68 @@
+From 11a21dfad782c3862f6a3fba9bcf4fd5c5005777 Mon Sep 17 00:00:00 2001
+From: Nicolas Fella <nicolas.fella@gmx.de>
+Date: Wed, 11 Dec 2024 22:58:47 +0100
+Subject: [PATCH] Add null check for StorageAccess interface in
+ storageAccessFromPath
+
+In slotInterfacesRemoved we do a remove+add cycle
+
+During that cycle the backend object is null, so querying the StorageAccess
+interface will return null.
+
+This means that when something calls storageAccessFromPath in reaction to
+the removed signal we will get a null StorageAccess.
+
+The overall design is a bit shaky here, but we can handle it more gracefully
+by checking the result for null
+
+BUG: 497299
+
+CCBUG: 492578
+
+SENTRY: PLASMA-WORKSPACE-11Q1
+
+SENTRY: KDECONNECT-KDE-BK
+
+SENTRY: DOLPHIN-320
+
+SENTRY: KDED-7M
+
+SENTRY: FALLTHROUGH-62S
+
+SENTRY: KATE-Y3
+
+SENTRY: KDENLIVE-VR
+
+SENTRY: XDG-DESKTOP-PORTAL-KDE-3R
+
+SENTRY: KDEVELOP-93
+
+SENTRY: KRUNNER-GD
+
+SENTRY: PLASMA-WORKSPACE-1986
+
+SENTRY: ELISA-9H
+(cherry picked from commit 2f8825b489ecc69bed67a49abdcb643d1fa42b4a)
+---
+ src/solid/devices/frontend/devicemanager.cpp | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/solid/devices/frontend/devicemanager.cpp b/src/solid/devices/frontend/devicemanager.cpp
+index 896a1826..9559592a 100644
+--- a/src/solid/devices/frontend/devicemanager.cpp
++++ b/src/solid/devices/frontend/devicemanager.cpp
+@@ -161,6 +161,11 @@ Solid::Device Solid::Device::storageAccessFromPath(const QString &path)
+         }
+ 
+         auto storageAccess = device.as<StorageAccess>();
++
++        if (!storageAccess) {
++            continue;
++        }
++
+         QString mountPath = storageAccess->filePath();
+ 
+         if (mountPath.size() <= match_length || !path.startsWith(mountPath)) {
+-- 
+GitLab
+

diff --git a/kde-frameworks/solid/solid-6.7.0-r2.ebuild b/kde-frameworks/solid/solid-6.7.0-r2.ebuild
new file mode 100644
index 000000000000..b0d4d513d64e
--- /dev/null
+++ b/kde-frameworks/solid/solid-6.7.0-r2.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+QTMIN=6.6.2
+inherit ecm frameworks.kde.org optfeature
+
+DESCRIPTION="Provider for platform independent hardware discovery, abstraction and management"
+
+LICENSE="LGPL-2.1+"
+KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86"
+IUSE="ios"
+
+RDEPEND="
+	>=dev-qt/qtbase-${QTMIN}:6[dbus,gui,xml]
+	>=dev-qt/qtdeclarative-${QTMIN}:6
+	sys-apps/util-linux
+	sys-fs/udisks:2
+	virtual/libudev:=
+	ios? (
+		app-pda/libimobiledevice:=
+		app-pda/libplist:=
+	)
+"
+DEPEND="${RDEPEND}
+	test? ( >=dev-qt/qtbase-${QTMIN}:6[concurrent] )
+"
+BDEPEND="
+	app-alternatives/lex
+	app-alternatives/yacc
+	>=dev-qt/qttools-${QTMIN}:6[linguist]
+"
+
+PATCHES=(
+	"${FILESDIR}/${P}-fix-crash-on-eject.patch" # KDE-bug 464149
+	"${FILESDIR}/${P}-crashfix.patch" # KDE-bugs 497299, 492578
+)
+
+src_configure() {
+	local mycmakeargs=(
+		$(cmake_use_find_package ios IMobileDevice)
+		$(cmake_use_find_package ios PList)
+	)
+	ecm_src_configure
+}
+
+pkg_postinst() {
+	if [[ -z "${REPLACING_VERSIONS}" ]]; then
+		optfeature "media player devices support" app-misc/media-player-info
+	fi
+	ecm_pkg_postinst
+}

diff --git a/kde-frameworks/solid/solid-6.8.0-r1.ebuild b/kde-frameworks/solid/solid-6.8.0-r1.ebuild
new file mode 100644
index 000000000000..78ea44f3b1dd
--- /dev/null
+++ b/kde-frameworks/solid/solid-6.8.0-r1.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+QTMIN=6.7.2
+inherit ecm frameworks.kde.org optfeature
+
+DESCRIPTION="Provider for platform independent hardware discovery, abstraction and management"
+
+LICENSE="LGPL-2.1+"
+KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86"
+IUSE="ios"
+
+RDEPEND="
+	>=dev-qt/qtbase-${QTMIN}:6[dbus,gui,xml]
+	>=dev-qt/qtdeclarative-${QTMIN}:6
+	sys-apps/util-linux
+	sys-fs/udisks:2
+	virtual/libudev:=
+	ios? (
+		app-pda/libimobiledevice:=
+		app-pda/libplist:=
+	)
+"
+DEPEND="${RDEPEND}
+	test? ( >=dev-qt/qtbase-${QTMIN}:6[concurrent] )
+"
+BDEPEND="
+	app-alternatives/lex
+	app-alternatives/yacc
+	>=dev-qt/qttools-${QTMIN}:6[linguist]
+"
+
+PATCHES=( "${FILESDIR}/${PN}-6.7.0-crashfix.patch" ) # KDE-bugs 497299, 492578
+
+src_configure() {
+	local mycmakeargs=(
+		$(cmake_use_find_package ios IMobileDevice)
+		$(cmake_use_find_package ios PList)
+	)
+	ecm_src_configure
+}
+
+pkg_postinst() {
+	if [[ -z "${REPLACING_VERSIONS}" ]]; then
+		optfeature "media player devices support" app-misc/media-player-info
+	fi
+	ecm_pkg_postinst
+}


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-12-14 22:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-20 13:26 [gentoo-commits] repo/gentoo:master commit in: kde-frameworks/solid/, kde-frameworks/solid/files/ Andreas Sturmlechner
  -- strict thread matches above, loose matches on Subject: below --
2024-12-14 22:37 Andreas Sturmlechner
2024-11-15 13:46 Andreas Sturmlechner
2024-11-05 22:50 Andreas Sturmlechner
2021-08-01 19:32 Andreas Sturmlechner
2018-05-18 21:15 Andreas Sturmlechner

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