1 |
commit: 25c13ec9aa6daad7f4a16f36de0264d2a4cd38aa |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Apr 27 18:50:05 2017 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Apr 29 11:56:21 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=25c13ec9 |
7 |
|
8 |
kde-frameworks/kconfig: Add fix for relativePath |
9 |
|
10 |
Package-Manager: Portage-2.3.3, Repoman-2.3.1 |
11 |
|
12 |
.../files/kconfig-5.33.0-relativePath.patch | 88 ++++++++++++++++++++++ |
13 |
kde-frameworks/kconfig/kconfig-5.33.0-r1.ebuild | 28 +++++++ |
14 |
2 files changed, 116 insertions(+) |
15 |
|
16 |
diff --git a/kde-frameworks/kconfig/files/kconfig-5.33.0-relativePath.patch b/kde-frameworks/kconfig/files/kconfig-5.33.0-relativePath.patch |
17 |
new file mode 100644 |
18 |
index 00000000000..80bffc15a29 |
19 |
--- /dev/null |
20 |
+++ b/kde-frameworks/kconfig/files/kconfig-5.33.0-relativePath.patch |
21 |
@@ -0,0 +1,88 @@ |
22 |
+commit 3ad00c4e56eb9fe6ea7386f8ca1db6e15c26ac11 |
23 |
+Author: Wolfgang Bauer <wbauer@×××.at> |
24 |
+Date: Tue Apr 25 23:37:11 2017 +0200 |
25 |
+ |
26 |
+ Fix relativePath calculation in KDesktopFile::locateLocal() |
27 |
+ |
28 |
+ The "dir" and "path" variables were obviously swapped here by mistake. |
29 |
+ This resulted in the relativePath always being empty, and made the |
30 |
+ function return "~/.local/share/" (or "~/.config/") instead of the |
31 |
+ correct path. |
32 |
+ |
33 |
+ BUG: 345100 |
34 |
+ FIXED-IN: 5.34.0 |
35 |
+ Differential Revision: https://phabricator.kde.org/D5502 |
36 |
+ |
37 |
+diff --git a/autotests/kdesktopfiletest.cpp b/autotests/kdesktopfiletest.cpp |
38 |
+index 393a6a0..a046196 100644 |
39 |
+--- a/autotests/kdesktopfiletest.cpp |
40 |
++++ b/autotests/kdesktopfiletest.cpp |
41 |
+@@ -255,3 +255,34 @@ void KDesktopFileTest::testTryExecWithAuthorizeAction() |
42 |
+ QVERIFY(!desktopFile.tryExec()); |
43 |
+ } |
44 |
+ } |
45 |
++ |
46 |
++void KDesktopFileTest::testLocateLocal_data() |
47 |
++{ |
48 |
++ QString systemConfigLocation = QStandardPaths::standardLocations(QStandardPaths::GenericConfigLocation).last(); |
49 |
++ QString writableConfigLocation = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation); |
50 |
++ QString systemDataLocation = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation).last(); |
51 |
++ QString writableDataLocation = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation); |
52 |
++ |
53 |
++ QTest::addColumn<QString>("path"); |
54 |
++ QTest::addColumn<QString>("result"); |
55 |
++ |
56 |
++ QTest::newRow("configLocation, system-wide") << systemConfigLocation + "/test.desktop" << writableConfigLocation + "/test.desktop"; |
57 |
++ QTest::newRow("autostart, system-wide") << systemConfigLocation + "/autostart/test.desktop" << writableConfigLocation + "/autostart/test.desktop"; |
58 |
++ QTest::newRow("dataLocation, system-wide") << systemDataLocation + "/test.desktop" << writableDataLocation + "/test.desktop"; |
59 |
++ QTest::newRow("applications, system-wide") << systemDataLocation + "/applications/test.desktop" << writableDataLocation + "/applications/test.desktop"; |
60 |
++ QTest::newRow("desktop-directories, system-wide") << systemDataLocation + "/desktop-directories/test.directory" << writableDataLocation + "/desktop-directories/test.directory"; |
61 |
++ QTest::newRow("configLocation, writable") << writableConfigLocation + "/test.desktop" << writableConfigLocation + "/test.desktop"; |
62 |
++ QTest::newRow("autostart, writable") << writableConfigLocation + "/autostart/test.desktop" << writableConfigLocation + "/autostart/test.desktop"; |
63 |
++ QTest::newRow("dataLocation, writable") << writableDataLocation + "/test.desktop" << writableDataLocation + "/test.desktop"; |
64 |
++ QTest::newRow("applications, writable") << writableDataLocation + "/applications/test.desktop" << writableDataLocation + "/applications/test.desktop"; |
65 |
++ QTest::newRow("desktop-directories, writable") << writableDataLocation + "/desktop-directories/test.directory" << writableDataLocation + "/desktop-directories/test.directory"; |
66 |
++ QTest::newRow("unknown location") << "/test.desktop" << writableDataLocation + "/test.desktop"; |
67 |
++} |
68 |
++ |
69 |
++void KDesktopFileTest::testLocateLocal() |
70 |
++{ |
71 |
++ QFETCH(QString, path); |
72 |
++ QFETCH(QString, result); |
73 |
++ |
74 |
++ QCOMPARE(KDesktopFile::locateLocal(path), result); |
75 |
++} |
76 |
+diff --git a/autotests/kdesktopfiletest.h b/autotests/kdesktopfiletest.h |
77 |
+index eb0bd1d..ed6679a 100644 |
78 |
+--- a/autotests/kdesktopfiletest.h |
79 |
++++ b/autotests/kdesktopfiletest.h |
80 |
+@@ -34,6 +34,8 @@ private Q_SLOTS: |
81 |
+ void testActionGroup(); |
82 |
+ void testIsAuthorizedDesktopFile(); |
83 |
+ void testTryExecWithAuthorizeAction(); |
84 |
++ void testLocateLocal_data(); |
85 |
++ void testLocateLocal(); |
86 |
+ |
87 |
+ }; |
88 |
+ |
89 |
+diff --git a/src/core/kdesktopfile.cpp b/src/core/kdesktopfile.cpp |
90 |
+index 4a55030..52a97ec 100644 |
91 |
+--- a/src/core/kdesktopfile.cpp |
92 |
++++ b/src/core/kdesktopfile.cpp |
93 |
+@@ -83,14 +83,14 @@ QString KDesktopFile::locateLocal(const QString &path) |
94 |
+ // Relative to config? (e.g. for autostart) |
95 |
+ Q_FOREACH (const QString &dir, QStandardPaths::standardLocations(QStandardPaths::GenericConfigLocation)) { |
96 |
+ if (path.startsWith(dir + plus)) { |
97 |
+- relativePath = dir.mid(path.length() + 1); |
98 |
++ relativePath = path.mid(dir.length() + 1); |
99 |
+ return QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + QLatin1Char('/') + relativePath; |
100 |
+ } |
101 |
+ } |
102 |
+ // Relative to xdg data dir? (much more common) |
103 |
+ Q_FOREACH (const QString &dir, QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation)) { |
104 |
+ if (path.startsWith(dir + plus)) { |
105 |
+- relativePath = dir.mid(path.length() + 1); |
106 |
++ relativePath = path.mid(dir.length() + 1); |
107 |
+ } |
108 |
+ } |
109 |
+ if (relativePath.isEmpty()) { |
110 |
|
111 |
diff --git a/kde-frameworks/kconfig/kconfig-5.33.0-r1.ebuild b/kde-frameworks/kconfig/kconfig-5.33.0-r1.ebuild |
112 |
new file mode 100644 |
113 |
index 00000000000..14e605e5b1c |
114 |
--- /dev/null |
115 |
+++ b/kde-frameworks/kconfig/kconfig-5.33.0-r1.ebuild |
116 |
@@ -0,0 +1,28 @@ |
117 |
+# Copyright 1999-2017 Gentoo Foundation |
118 |
+# Distributed under the terms of the GNU General Public License v2 |
119 |
+ |
120 |
+EAPI=6 |
121 |
+ |
122 |
+VIRTUALX_REQUIRED="test" |
123 |
+inherit kde5 |
124 |
+ |
125 |
+DESCRIPTION="Framework for reading and writing configuration" |
126 |
+LICENSE="LGPL-2+" |
127 |
+KEYWORDS="~amd64 ~arm ~x86" |
128 |
+IUSE="nls" |
129 |
+ |
130 |
+RDEPEND=" |
131 |
+ $(add_qt_dep qtgui) |
132 |
+ $(add_qt_dep qtxml) |
133 |
+" |
134 |
+DEPEND="${RDEPEND} |
135 |
+ nls? ( $(add_qt_dep linguist-tools) ) |
136 |
+ test? ( $(add_qt_dep qtconcurrent) ) |
137 |
+" |
138 |
+ |
139 |
+# bug 560086 |
140 |
+RESTRICT+=" test" |
141 |
+ |
142 |
+DOCS=( DESIGN docs/DESIGN.kconfig docs/options.md ) |
143 |
+ |
144 |
+PATCHES=( "${FILESDIR}/${P}-relativePath.patch" ) |