Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: kde-frameworks/kwallet/, kde-frameworks/kwallet/files/
Date: Sat, 27 May 2017 14:54:33
Message-Id: 1495896854.d03e9c5d4c856533146450a842e0afb1150b8089.asturm@gentoo
1 commit: d03e9c5d4c856533146450a842e0afb1150b8089
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sat May 27 14:37:09 2017 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sat May 27 14:54:14 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d03e9c5d
7
8 kde-frameworks/kwallet: Service both org.kde.kwalletd5 and ...kwalletd
9
10 Gentoo-bug: 597610
11
12 Package-Manager: Portage-2.3.5, Repoman-2.3.1
13
14 .../kwallet/files/kwallet-5.34.0-kwalletd4-1.patch | 36 ++++++++++++
15 .../kwallet/files/kwallet-5.34.0-kwalletd4-2.patch | 51 ++++++++++++++++
16 .../kwallet/files/kwallet-5.34.0-kwalletd4-3.patch | 51 ++++++++++++++++
17 .../kwallet/files/kwallet-5.34.0-kwalletd4-4.patch | 60 +++++++++++++++++++
18 .../kwallet/files/kwallet-5.34.0-kwalletd4-5.patch | 68 ++++++++++++++++++++++
19 kde-frameworks/kwallet/kwallet-5.34.0-r1.ebuild | 57 ++++++++++++++++++
20 6 files changed, 323 insertions(+)
21
22 diff --git a/kde-frameworks/kwallet/files/kwallet-5.34.0-kwalletd4-1.patch b/kde-frameworks/kwallet/files/kwallet-5.34.0-kwalletd4-1.patch
23 new file mode 100644
24 index 00000000000..e231369e780
25 --- /dev/null
26 +++ b/kde-frameworks/kwallet/files/kwallet-5.34.0-kwalletd4-1.patch
27 @@ -0,0 +1,36 @@
28 +From bf775a9a9fa2c8ba66bf5106969b076c68ecedca Mon Sep 17 00:00:00 2001
29 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@×××××××××××.de>
30 +Date: Sun, 31 May 2015 06:40:38 +0200
31 +Subject: [PATCH 1/5] Check for unique applicaton instance as early as possible
32 +MIME-Version: 1.0
33 +Content-Type: text/plain; charset=UTF-8
34 +Content-Transfer-Encoding: 8bit
35 +
36 +Exit before KWalletD and the MigrationAgent has been initialized.
37 +The return value is changed, but concurrent instatiation of kwalletd is
38 +not a fault.
39 +
40 +Signed-off-by: Stefan Brüns <stefan.bruens@×××××××××××.de>
41 +---
42 + src/runtime/kwalletd/main.cpp | 3 ++-
43 + 1 file changed, 2 insertions(+), 1 deletion(-)
44 +
45 +diff --git a/src/runtime/kwalletd/main.cpp b/src/runtime/kwalletd/main.cpp
46 +index ff96208..c98c1b3 100644
47 +--- a/src/runtime/kwalletd/main.cpp
48 ++++ b/src/runtime/kwalletd/main.cpp
49 +@@ -189,9 +189,10 @@ int main(int argc, char **argv)
50 + aboutdata.addAuthor(i18n("George Staikos"), i18n("Former maintainer"), QStringLiteral("staikos@×××.org"));
51 + aboutdata.addAuthor(i18n("Thiago Maceira"), i18n("D-Bus Interface"), QStringLiteral("thiago@×××.org"));
52 +
53 ++ KDBusService dbusUniqueInstance(KDBusService::Unique);
54 ++
55 + KWalletD walletd;
56 + MigrationAgent migrationAgent(&walletd, hash);
57 +- KDBusService dbusUniqueInstance(KDBusService::Unique);
58 +
59 + // NOTE: the command should be parsed only after KDBusService instantiation
60 + QCommandLineParser cmdParser;
61 +--
62 +2.12.0
63 +
64
65 diff --git a/kde-frameworks/kwallet/files/kwallet-5.34.0-kwalletd4-2.patch b/kde-frameworks/kwallet/files/kwallet-5.34.0-kwalletd4-2.patch
66 new file mode 100644
67 index 00000000000..dd6a7833335
68 --- /dev/null
69 +++ b/kde-frameworks/kwallet/files/kwallet-5.34.0-kwalletd4-2.patch
70 @@ -0,0 +1,51 @@
71 +From f63407a129910cac5b2f7bbf56a348932fdeb05a Mon Sep 17 00:00:00 2001
72 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@×××××××××××.de>
73 +Date: Sun, 31 May 2015 06:56:44 +0200
74 +Subject: [PATCH 2/5] Only start timer for migration agent if necessary
75 +MIME-Version: 1.0
76 +Content-Type: text/plain; charset=UTF-8
77 +Content-Transfer-Encoding: 8bit
78 +
79 +Signed-off-by: Stefan Brüns <stefan.bruens@×××××××××××.de>
80 +---
81 + src/runtime/kwalletd/migrationagent.cpp | 10 ++++++----
82 + 1 file changed, 6 insertions(+), 4 deletions(-)
83 +
84 +diff --git a/src/runtime/kwalletd/migrationagent.cpp b/src/runtime/kwalletd/migrationagent.cpp
85 +index f3da947..110a5e0 100644
86 +--- a/src/runtime/kwalletd/migrationagent.cpp
87 ++++ b/src/runtime/kwalletd/migrationagent.cpp
88 +@@ -41,7 +41,11 @@ MigrationAgent::MigrationAgent(KWalletD* kd, const char *hash) :
89 + , _kde4_daemon(nullptr)
90 + , _pam_hash(hash)
91 + {
92 +- QTimer::singleShot(100, this, SLOT(migrateWallets()));
93 ++ if (isAlreadyMigrated()) {
94 ++ qDebug() << "old wallets were already migrated";
95 ++ } else {
96 ++ QTimer::singleShot(100, this, SLOT(migrateWallets()));
97 ++ }
98 + }
99 +
100 + void MigrationAgent::migrateWallets()
101 +@@ -55,7 +59,7 @@ void MigrationAgent::migrateWallets()
102 + // if the migration wizard returns without error
103 + // create "alreadyMigrated=true" setting
104 + qDebug() << "Migration agent starting...";
105 +- if (!isAlreadyMigrated()) {
106 ++ {
107 + if (connectOldDaemon()) {
108 + if (!isEmptyOldWallet()) {
109 + if (isMigrationWizardOk()) {
110 +@@ -70,8 +74,6 @@ void MigrationAgent::migrateWallets()
111 + } else {
112 + qDebug() << "KDE4 kwalletd not present, stopping migration agent";
113 + }
114 +- } else {
115 +- qDebug() << "old wallets were already migrated";
116 + }
117 + qDebug() << "Migration agent stop.";
118 + }
119 +--
120 +2.12.0
121 +
122
123 diff --git a/kde-frameworks/kwallet/files/kwallet-5.34.0-kwalletd4-3.patch b/kde-frameworks/kwallet/files/kwallet-5.34.0-kwalletd4-3.patch
124 new file mode 100644
125 index 00000000000..f993faf95cf
126 --- /dev/null
127 +++ b/kde-frameworks/kwallet/files/kwallet-5.34.0-kwalletd4-3.patch
128 @@ -0,0 +1,51 @@
129 +From 574fdd416b5f6b0907826034916c03dddb08341a Mon Sep 17 00:00:00 2001
130 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@×××××××××××.de>
131 +Date: Sun, 31 May 2015 06:47:55 +0200
132 +Subject: [PATCH 3/5] Whitespace fixup
133 +MIME-Version: 1.0
134 +Content-Type: text/plain; charset=UTF-8
135 +Content-Transfer-Encoding: 8bit
136 +
137 +Signed-off-by: Stefan Brüns <stefan.bruens@×××××××××××.de>
138 +---
139 + src/runtime/kwalletd/migrationagent.cpp | 20 +++++++++-----------
140 + 1 file changed, 9 insertions(+), 11 deletions(-)
141 +
142 +diff --git a/src/runtime/kwalletd/migrationagent.cpp b/src/runtime/kwalletd/migrationagent.cpp
143 +index 110a5e0..ec60812 100644
144 +--- a/src/runtime/kwalletd/migrationagent.cpp
145 ++++ b/src/runtime/kwalletd/migrationagent.cpp
146 +@@ -59,21 +59,19 @@ void MigrationAgent::migrateWallets()
147 + // if the migration wizard returns without error
148 + // create "alreadyMigrated=true" setting
149 + qDebug() << "Migration agent starting...";
150 +- {
151 +- if (connectOldDaemon()) {
152 +- if (!isEmptyOldWallet()) {
153 +- if (isMigrationWizardOk()) {
154 +- setAlreadyMigrated();
155 +- } else {
156 +- qDebug() << "Migration wizard returned an error or has been canceled. The migration agent will resume upon next daemon start";
157 +- }
158 +- } else {
159 +- qDebug() << "Old wallet is empty. No need to migrate.";
160 ++ if (connectOldDaemon()) {
161 ++ if (!isEmptyOldWallet()) {
162 ++ if (isMigrationWizardOk()) {
163 + setAlreadyMigrated();
164 ++ } else {
165 ++ qDebug() << "Migration wizard returned an error or has been canceled. The migration agent will resume upon next daemon start";
166 + }
167 + } else {
168 +- qDebug() << "KDE4 kwalletd not present, stopping migration agent";
169 ++ qDebug() << "Old wallet is empty. No need to migrate.";
170 ++ setAlreadyMigrated();
171 + }
172 ++ } else {
173 ++ qDebug() << "KDE4 kwalletd not present, stopping migration agent";
174 + }
175 + qDebug() << "Migration agent stop.";
176 + }
177 +--
178 +2.12.0
179 +
180
181 diff --git a/kde-frameworks/kwallet/files/kwallet-5.34.0-kwalletd4-4.patch b/kde-frameworks/kwallet/files/kwallet-5.34.0-kwalletd4-4.patch
182 new file mode 100644
183 index 00000000000..a0cc6d73f51
184 --- /dev/null
185 +++ b/kde-frameworks/kwallet/files/kwallet-5.34.0-kwalletd4-4.patch
186 @@ -0,0 +1,60 @@
187 +From 8d5636d8185cf3a572a9b81a9b9246eb6371685b Mon Sep 17 00:00:00 2001
188 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@×××××××××××.de>
189 +Date: Sun, 31 May 2015 06:49:46 +0200
190 +Subject: [PATCH 4/5] Signal completion of migration agent
191 +MIME-Version: 1.0
192 +Content-Type: text/plain; charset=UTF-8
193 +Content-Transfer-Encoding: 8bit
194 +
195 +Signed-off-by: Stefan Brüns <stefan.bruens@×××××××××××.de>
196 +---
197 + src/runtime/kwalletd/migrationagent.cpp | 4 ++++
198 + src/runtime/kwalletd/migrationagent.h | 1 +
199 + 2 files changed, 5 insertions(+)
200 +
201 +diff --git a/src/runtime/kwalletd/migrationagent.cpp b/src/runtime/kwalletd/migrationagent.cpp
202 +index ec60812..6eb6013 100644
203 +--- a/src/runtime/kwalletd/migrationagent.cpp
204 ++++ b/src/runtime/kwalletd/migrationagent.cpp
205 +@@ -43,6 +43,7 @@ MigrationAgent::MigrationAgent(KWalletD* kd, const char *hash) :
206 + {
207 + if (isAlreadyMigrated()) {
208 + qDebug() << "old wallets were already migrated";
209 ++ emit migrationFinished();
210 + } else {
211 + QTimer::singleShot(100, this, SLOT(migrateWallets()));
212 + }
213 +@@ -63,15 +64,18 @@ void MigrationAgent::migrateWallets()
214 + if (!isEmptyOldWallet()) {
215 + if (isMigrationWizardOk()) {
216 + setAlreadyMigrated();
217 ++ emit migrationFinished();
218 + } else {
219 + qDebug() << "Migration wizard returned an error or has been canceled. The migration agent will resume upon next daemon start";
220 + }
221 + } else {
222 + qDebug() << "Old wallet is empty. No need to migrate.";
223 + setAlreadyMigrated();
224 ++ emit migrationFinished();
225 + }
226 + } else {
227 + qDebug() << "KDE4 kwalletd not present, stopping migration agent";
228 ++ emit migrationFinished();
229 + }
230 + qDebug() << "Migration agent stop.";
231 + }
232 +diff --git a/src/runtime/kwalletd/migrationagent.h b/src/runtime/kwalletd/migrationagent.h
233 +index 0f6467c..9c974a0 100644
234 +--- a/src/runtime/kwalletd/migrationagent.h
235 ++++ b/src/runtime/kwalletd/migrationagent.h
236 +@@ -48,6 +48,7 @@ public Q_SLOTS:
237 +
238 + Q_SIGNALS:
239 + void progressMessage(const QString &);
240 ++ void migrationFinished();
241 +
242 + private:
243 + KWalletD *_kf5_daemon;
244 +--
245 +2.12.0
246 +
247
248 diff --git a/kde-frameworks/kwallet/files/kwallet-5.34.0-kwalletd4-5.patch b/kde-frameworks/kwallet/files/kwallet-5.34.0-kwalletd4-5.patch
249 new file mode 100644
250 index 00000000000..21f4a3509a9
251 --- /dev/null
252 +++ b/kde-frameworks/kwallet/files/kwallet-5.34.0-kwalletd4-5.patch
253 @@ -0,0 +1,68 @@
254 +From e9d8932d04a7882471f722800b7b4603074d560d Mon Sep 17 00:00:00 2001
255 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@×××××××××××.de>
256 +Date: Sun, 31 May 2015 07:03:31 +0200
257 +Subject: [PATCH 5/5] Replace kwalletd4 after migration has finished
258 +MIME-Version: 1.0
259 +Content-Type: text/plain; charset=UTF-8
260 +Content-Transfer-Encoding: 8bit
261 +
262 +kwalletd5 can service both org.kde.kwalletd5 and org.kde.kwalletd
263 +
264 +Signed-off-by: Stefan Brüns <stefan.bruens@×××××××××××.de>
265 +---
266 + src/runtime/kwalletd/kwalletd.cpp | 13 +++++++++++++
267 + src/runtime/kwalletd/kwalletd.h | 1 +
268 + src/runtime/kwalletd/migrationagent.cpp | 1 +
269 + 3 files changed, 15 insertions(+)
270 +
271 +diff --git a/src/runtime/kwalletd/kwalletd.cpp b/src/runtime/kwalletd/kwalletd.cpp
272 +index 18ef9fa..da851da 100644
273 +--- a/src/runtime/kwalletd/kwalletd.cpp
274 ++++ b/src/runtime/kwalletd/kwalletd.cpp
275 +@@ -151,6 +151,19 @@ KWalletD::KWalletD()
276 + SLOT(slotServiceOwnerChanged(QString, QString, QString)));
277 + }
278 +
279 ++void KWalletD::registerKWalletd4Service()
280 ++{
281 ++ auto bus = QDBusConnection::sessionBus().interface();
282 ++ auto reply = bus->registerService(QLatin1String("org.kde.kwalletd"), QDBusConnectionInterface::QueueService);
283 ++ if (reply.isValid() && (reply.value() == QDBusConnectionInterface::ServiceQueued)) {
284 ++ QDBusInterface _kde_kwalletd4("org.kde.kwalletd", "/MainApplication", "org.kde.KApplication");
285 ++ if (_kde_kwalletd4.isValid()) {
286 ++ auto qreply = _kde_kwalletd4.call("quit");
287 ++ }
288 ++ }
289 ++ QDBusConnection::sessionBus().registerObject(QLatin1String("/modules/kwalletd"), this);
290 ++}
291 ++
292 + KWalletD::~KWalletD()
293 + {
294 + #ifdef Q_WS_X11
295 +diff --git a/src/runtime/kwalletd/kwalletd.h b/src/runtime/kwalletd/kwalletd.h
296 +index 3571535..a862faf 100644
297 +--- a/src/runtime/kwalletd/kwalletd.h
298 ++++ b/src/runtime/kwalletd/kwalletd.h
299 +@@ -182,6 +182,7 @@ private Q_SLOTS:
300 + void notifyFailures();
301 + void processTransactions();
302 + void activatePasswordDialog();
303 ++ void registerKWalletd4Service();
304 + #ifdef Q_WS_X11
305 + void connectToScreenSaver();
306 + #endif
307 +diff --git a/src/runtime/kwalletd/migrationagent.cpp b/src/runtime/kwalletd/migrationagent.cpp
308 +index 6eb6013..639ee8d 100644
309 +--- a/src/runtime/kwalletd/migrationagent.cpp
310 ++++ b/src/runtime/kwalletd/migrationagent.cpp
311 +@@ -41,6 +41,7 @@ MigrationAgent::MigrationAgent(KWalletD* kd, const char *hash) :
312 + , _kde4_daemon(nullptr)
313 + , _pam_hash(hash)
314 + {
315 ++ connect(this, &MigrationAgent::migrationFinished, _kf5_daemon, &KWalletD::registerKWalletd4Service);
316 + if (isAlreadyMigrated()) {
317 + qDebug() << "old wallets were already migrated";
318 + emit migrationFinished();
319 +--
320 +2.12.0
321 +
322
323 diff --git a/kde-frameworks/kwallet/kwallet-5.34.0-r1.ebuild b/kde-frameworks/kwallet/kwallet-5.34.0-r1.ebuild
324 new file mode 100644
325 index 00000000000..e3a6046953b
326 --- /dev/null
327 +++ b/kde-frameworks/kwallet/kwallet-5.34.0-r1.ebuild
328 @@ -0,0 +1,57 @@
329 +# Copyright 1999-2017 Gentoo Foundation
330 +# Distributed under the terms of the GNU General Public License v2
331 +
332 +EAPI=6
333 +
334 +inherit kde5
335 +
336 +DESCRIPTION="Framework providing desktop-wide storage for passwords"
337 +LICENSE="LGPL-2+"
338 +KEYWORDS="~amd64 ~arm ~x86"
339 +IUSE="gpg +man"
340 +
341 +RDEPEND="
342 + $(add_frameworks_dep kconfig)
343 + $(add_frameworks_dep kconfigwidgets)
344 + $(add_frameworks_dep kcoreaddons)
345 + $(add_frameworks_dep kdbusaddons)
346 + $(add_frameworks_dep ki18n)
347 + $(add_frameworks_dep kiconthemes)
348 + $(add_frameworks_dep knotifications)
349 + $(add_frameworks_dep kservice)
350 + $(add_frameworks_dep kwidgetsaddons)
351 + $(add_frameworks_dep kwindowsystem)
352 + $(add_qt_dep qtdbus)
353 + $(add_qt_dep qtgui)
354 + $(add_qt_dep qtwidgets)
355 + dev-libs/libgcrypt:0=
356 + gpg? ( >=app-crypt/gpgme-1.7.1[cxx,qt5] )
357 +"
358 +DEPEND="${RDEPEND}
359 + man? ( $(add_frameworks_dep kdoctools) )
360 +"
361 +
362 +PATCHES=( "${FILESDIR}"/${PN}-5.34.0-kwalletd4-{1,2,3,4,5}.patch )
363 +
364 +src_configure() {
365 + local mycmakeargs=(
366 + $(cmake-utils_use_find_package gpg Gpgmepp)
367 + $(cmake-utils_use_find_package man KF5DocTools)
368 + )
369 +
370 + kde5_src_configure
371 +}
372 +
373 +pkg_postinst() {
374 + if ! has_version "kde-plasma/kwallet-pam" || ! has_version "kde-apps/kwalletmanager:5" ; then
375 + elog
376 + elog "Install kde-plasma/kwallet-pam for auto-unlocking after account login."
377 + elog "Install kde-apps/kwalletmanager:5 to manage your kwallet."
378 + elog
379 + fi
380 + if has_version "kde-apps/kwalletd"; then
381 + elog "Starting with 5.34.0-r1, ${PN} is able to serve applications"
382 + elog "that still require old kwalletd4. After migration has finished,"
383 + elog "kde-apps/kwalletd can be removed."
384 + fi
385 +}