1 |
commit: 97d55e9f2677dbc82a438cfede01b01b85138a49 |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Nov 29 16:38:11 2017 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Nov 29 16:40:00 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=97d55e9f |
7 |
|
8 |
kde-frameworks/kio: Fix knewfilemenu mkpath with >=Qt-5.9.3 |
9 |
|
10 |
See also: |
11 |
https://mail.kde.org/pipermail/kde-distro-packagers/2017-November/000298.html |
12 |
|
13 |
Package-Manager: Portage-2.3.16, Repoman-2.3.6 |
14 |
|
15 |
.../kio-5.40.0-knewfilemenu-mkpath-qt-5.9.3.patch | 80 +++++++++++++++++++++ |
16 |
kde-frameworks/kio/kio-5.40.0-r2.ebuild | 83 ++++++++++++++++++++++ |
17 |
2 files changed, 163 insertions(+) |
18 |
|
19 |
diff --git a/kde-frameworks/kio/files/kio-5.40.0-knewfilemenu-mkpath-qt-5.9.3.patch b/kde-frameworks/kio/files/kio-5.40.0-knewfilemenu-mkpath-qt-5.9.3.patch |
20 |
new file mode 100644 |
21 |
index 00000000000..9645620d04d |
22 |
--- /dev/null |
23 |
+++ b/kde-frameworks/kio/files/kio-5.40.0-knewfilemenu-mkpath-qt-5.9.3.patch |
24 |
@@ -0,0 +1,80 @@ |
25 |
+From 298c0e734efdd8a7b66a531959e3fb5357a6495d Mon Sep 17 00:00:00 2001 |
26 |
+From: Eike Hein <hein@×××.org> |
27 |
+Date: Tue, 28 Nov 2017 19:42:46 +0900 |
28 |
+Subject: Fix creating a directory via KNewFileMenu+KIO::mkpath on Qt 5.9.3+ |
29 |
+ |
30 |
+Summary: |
31 |
+f62768d04652 in qtbase.git introduced a behavior change in QUrl |
32 |
+causing it to reject URLs with a path of "//foo" (note the double |
33 |
+slash) as invalid. |
34 |
+ |
35 |
+Both KNewFileMenu and KIO::mkpath contained code following this |
36 |
+pattern: |
37 |
+ |
38 |
+ url.path() + '/' + name |
39 |
+ |
40 |
+This is a bad mix with forwarding slaves like kio_desktop, which |
41 |
+translate a top-level path of / to some other URL: |
42 |
+ |
43 |
+ (desktop:)/ + / + foo = //foo |
44 |
+ |
45 |
+This patch addresses the two instances of this by wrapping the |
46 |
+string building in QDir::cleanPath, which I think is the shortest |
47 |
+and most readable way to go. |
48 |
+ |
49 |
+2353119aae8f in kio.git (D8836) was another commit fixing fallout |
50 |
+from this Qt change. Is unlikely this patch will be the last one. |
51 |
+I suspect many other variations of this problem lurk about the |
52 |
+codebase. |
53 |
+ |
54 |
+BUG:387073 |
55 |
+ |
56 |
+Reviewers: dfaure, thiago, elvisangelaccio |
57 |
+ |
58 |
+Subscribers: #frameworks |
59 |
+ |
60 |
+Tags: #frameworks |
61 |
+ |
62 |
+Differential Revision: https://phabricator.kde.org/D9029 |
63 |
+--- |
64 |
+ src/core/mkpathjob.cpp | 3 ++- |
65 |
+ src/filewidgets/knewfilemenu.cpp | 2 +- |
66 |
+ 2 files changed, 3 insertions(+), 2 deletions(-) |
67 |
+ |
68 |
+diff --git a/src/core/mkpathjob.cpp b/src/core/mkpathjob.cpp |
69 |
+index c77a9fe..f67a489 100644 |
70 |
+--- a/src/core/mkpathjob.cpp |
71 |
++++ b/src/core/mkpathjob.cpp |
72 |
+@@ -25,6 +25,7 @@ |
73 |
+ #include "mkdirjob.h" |
74 |
+ #include <QTimer> |
75 |
+ #include <QDebug> |
76 |
++#include <QDir> |
77 |
+ #include <QFileInfo> |
78 |
+ |
79 |
+ using namespace KIO; |
80 |
+@@ -123,7 +124,7 @@ void MkpathJobPrivate::slotStart() |
81 |
+ } |
82 |
+ |
83 |
+ if (m_pathIterator != m_pathComponents.constEnd()) { |
84 |
+- m_url.setPath(m_url.path() + '/' + *m_pathIterator); |
85 |
++ m_url.setPath(QDir::cleanPath(m_url.path() + '/' + *m_pathIterator)); |
86 |
+ KIO::Job* job = KIO::mkdir(m_url); |
87 |
+ q->addSubjob(job); |
88 |
+ q->setProcessedAmount(KJob::Directories, q->processedAmount(KJob::Directories) + 1); |
89 |
+diff --git a/src/filewidgets/knewfilemenu.cpp b/src/filewidgets/knewfilemenu.cpp |
90 |
+index 023eebd..98c9852 100644 |
91 |
+--- a/src/filewidgets/knewfilemenu.cpp |
92 |
++++ b/src/filewidgets/knewfilemenu.cpp |
93 |
+@@ -855,7 +855,7 @@ void KNewFileMenuPrivate::_k_slotCreateDirectory(bool writeHiddenDir) |
94 |
+ } |
95 |
+ } |
96 |
+ url = baseUrl; |
97 |
+- url.setPath(url.path() + '/' + name); |
98 |
++ url.setPath(QDir::cleanPath(url.path() + '/' + name)); |
99 |
+ } |
100 |
+ } |
101 |
+ |
102 |
+-- |
103 |
+cgit v0.11.2 |
104 |
+ |
105 |
|
106 |
diff --git a/kde-frameworks/kio/kio-5.40.0-r2.ebuild b/kde-frameworks/kio/kio-5.40.0-r2.ebuild |
107 |
new file mode 100644 |
108 |
index 00000000000..b0b6cd7af7e |
109 |
--- /dev/null |
110 |
+++ b/kde-frameworks/kio/kio-5.40.0-r2.ebuild |
111 |
@@ -0,0 +1,83 @@ |
112 |
+# Copyright 1999-2017 Gentoo Foundation |
113 |
+# Distributed under the terms of the GNU General Public License v2 |
114 |
+ |
115 |
+EAPI=6 |
116 |
+ |
117 |
+KDE_TEST="forceoptional" |
118 |
+VIRTUALX_REQUIRED="test" |
119 |
+inherit kde5 |
120 |
+ |
121 |
+DESCRIPTION="Framework providing transparent file and data management" |
122 |
+LICENSE="LGPL-2+" |
123 |
+KEYWORDS="~amd64 ~arm ~arm64 ~x86" |
124 |
+IUSE="acl +handbook kerberos +kwallet X" |
125 |
+ |
126 |
+RDEPEND=" |
127 |
+ $(add_frameworks_dep karchive) |
128 |
+ $(add_frameworks_dep kbookmarks) |
129 |
+ $(add_frameworks_dep kcodecs) |
130 |
+ $(add_frameworks_dep kcompletion) |
131 |
+ $(add_frameworks_dep kconfig) |
132 |
+ $(add_frameworks_dep kconfigwidgets) |
133 |
+ $(add_frameworks_dep kcoreaddons) |
134 |
+ $(add_frameworks_dep kdbusaddons) |
135 |
+ $(add_frameworks_dep ki18n) |
136 |
+ $(add_frameworks_dep kiconthemes) |
137 |
+ $(add_frameworks_dep kitemviews) |
138 |
+ $(add_frameworks_dep kjobwidgets) |
139 |
+ $(add_frameworks_dep knotifications) |
140 |
+ $(add_frameworks_dep kservice) |
141 |
+ $(add_frameworks_dep ktextwidgets) |
142 |
+ $(add_frameworks_dep kwidgetsaddons) |
143 |
+ $(add_frameworks_dep kwindowsystem) |
144 |
+ $(add_frameworks_dep kxmlgui) |
145 |
+ $(add_frameworks_dep solid) |
146 |
+ $(add_qt_dep qtdbus) |
147 |
+ $(add_qt_dep qtgui) |
148 |
+ $(add_qt_dep qtnetwork 'ssl') |
149 |
+ $(add_qt_dep qtscript) |
150 |
+ $(add_qt_dep qtwidgets) |
151 |
+ $(add_qt_dep qtxml) |
152 |
+ dev-libs/libxml2 |
153 |
+ dev-libs/libxslt |
154 |
+ acl? ( |
155 |
+ sys-apps/attr |
156 |
+ virtual/acl |
157 |
+ ) |
158 |
+ kerberos? ( virtual/krb5 ) |
159 |
+ kwallet? ( $(add_frameworks_dep kwallet) ) |
160 |
+ X? ( $(add_qt_dep qtx11extras) ) |
161 |
+" |
162 |
+DEPEND="${RDEPEND} |
163 |
+ $(add_qt_dep qtconcurrent) |
164 |
+ handbook? ( $(add_frameworks_dep kdoctools) ) |
165 |
+ test? ( sys-libs/zlib ) |
166 |
+ X? ( |
167 |
+ x11-libs/libX11 |
168 |
+ x11-libs/libXrender |
169 |
+ x11-proto/xproto |
170 |
+ ) |
171 |
+" |
172 |
+PDEPEND=" |
173 |
+ $(add_frameworks_dep kded) |
174 |
+" |
175 |
+ |
176 |
+PATCHES=( |
177 |
+ "${FILESDIR}/${P}-mkpath-qt-5.9.3.patch" |
178 |
+ "${FILESDIR}/${P}-knewfilemenu-mkpath-qt-5.9.3.patch" |
179 |
+) |
180 |
+ |
181 |
+# tests hang |
182 |
+RESTRICT+=" test" |
183 |
+ |
184 |
+src_configure() { |
185 |
+ local mycmakeargs=( |
186 |
+ $(cmake-utils_use_find_package acl ACL) |
187 |
+ $(cmake-utils_use_find_package handbook KF5DocTools) |
188 |
+ $(cmake-utils_use_find_package kerberos GSSAPI) |
189 |
+ $(cmake-utils_use_find_package kwallet KF5Wallet) |
190 |
+ $(cmake-utils_use_find_package X X11) |
191 |
+ ) |
192 |
+ |
193 |
+ kde5_src_configure |
194 |
+} |