kde-frameworks/kpackage: Fix runtime crash
authorAndreas Sturmlechner <asturm@gentoo.org>
Sat, 27 Apr 2019 18:45:19 +0000 (20:45 +0200)
committerAndreas Sturmlechner <asturm@gentoo.org>
Sat, 27 Apr 2019 20:51:36 +0000 (22:51 +0200)
Package-Manager: Portage-2.3.65, Repoman-2.3.12
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
kde-frameworks/kpackage/files/kpackage-5.57.0-runtime-crashfix.patch [new file with mode: 0644]
kde-frameworks/kpackage/kpackage-5.57.0-r1.ebuild [new file with mode: 0644]

diff --git a/kde-frameworks/kpackage/files/kpackage-5.57.0-runtime-crashfix.patch b/kde-frameworks/kpackage/files/kpackage-5.57.0-runtime-crashfix.patch
new file mode 100644 (file)
index 0000000..5d13d3f
--- /dev/null
@@ -0,0 +1,42 @@
+From c3e896e02f9a8dc92d6e26cdbc87fe5c6b9cf3bf Mon Sep 17 00:00:00 2001
+From: David Faure <faure@kde.org>
+Date: Sun, 14 Apr 2019 19:44:50 +0200
+Subject: Don't use qAsConst over a temporary variable
+
+Summary:
+(will crash because the temporary will be destroyed before being used)
+
+Detected with
+  ag -sr qAsConst'\([^)]*\(' .
+
+Test Plan: builds
+
+Reviewers: mlaurent, cfeck, apol
+
+Reviewed By: mlaurent
+
+Subscribers: kde-frameworks-devel
+
+Tags: #frameworks
+
+Differential Revision: https://phabricator.kde.org/D20552
+---
+ src/kpackage/package.cpp | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/kpackage/package.cpp b/src/kpackage/package.cpp
+index 130eec6..801f1c2 100644
+--- a/src/kpackage/package.cpp
++++ b/src/kpackage/package.cpp
+@@ -429,7 +429,8 @@ QStringList Package::entryList(const QByteArray &key) const
+     QStringList list;
+     for (const QString &prefix : qAsConst(d->contentsPrefixPaths)) {
+         //qCDebug(KPACKAGE_LOG) << "     looking in" << prefix;
+-        for (const QString &path : qAsConst(it.value().paths)) {
++        const QStringList paths = it.value().paths;
++        for (const QString &path : paths) {
+             //qCDebug(KPACKAGE_LOG) << "         looking in" << path;
+             if (it.value().directory) {
+                 //qCDebug(KPACKAGE_LOG) << "it's a directory, so trying out" << d->path + prefix + path;
+-- 
+cgit v1.1
diff --git a/kde-frameworks/kpackage/kpackage-5.57.0-r1.ebuild b/kde-frameworks/kpackage/kpackage-5.57.0-r1.ebuild
new file mode 100644 (file)
index 0000000..a65b0d9
--- /dev/null
@@ -0,0 +1,37 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit kde5
+
+DESCRIPTION="Framework to install and load packages of non binary content"
+LICENSE="LGPL-2+"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+IUSE="man"
+
+BDEPEND="
+       man? ( $(add_frameworks_dep kdoctools) )
+"
+DEPEND="
+       $(add_frameworks_dep karchive)
+       $(add_frameworks_dep kcoreaddons)
+       $(add_frameworks_dep ki18n)
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=( "${FILESDIR}/${P}-runtime-crashfix.patch" )
+
+src_configure() {
+       local mycmakeargs=(
+               $(cmake-utils_use_find_package man KF5DocTools)
+       )
+
+       kde5_src_configure
+}
+
+src_test() {
+       #bug 650214
+       local myctestargs=( -E "(plasma-plasmoidpackagetest)" )
+       kde5_src_test
+}