Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/keepassxc/, app-admin/keepassxc/files/
Date: Mon, 03 Jun 2019 12:22:14
Message-Id: 1559564522.a4f4108bd01a1ae114efd10ef0d97bd5948347b5.polynomial-c@gentoo
1 commit: a4f4108bd01a1ae114efd10ef0d97bd5948347b5
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jun 3 12:22:02 2019 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Mon Jun 3 12:22:02 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a4f4108b
7
8 app-admin/keepassxc: Removed old.
9
10 Package-Manager: Portage-2.3.67, Repoman-2.3.13
11 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
12
13 app-admin/keepassxc/Manifest | 1 -
14 .../files/keepassxc-2.4.0-build_fix.patch | 38 --
15 .../keepassxc-2.4.0-update_checker_toggle.patch | 445 ---------------------
16 app-admin/keepassxc/keepassxc-2.4.0-r1.ebuild | 102 -----
17 4 files changed, 586 deletions(-)
18
19 diff --git a/app-admin/keepassxc/Manifest b/app-admin/keepassxc/Manifest
20 index b5e380200e8..665ab5adedb 100644
21 --- a/app-admin/keepassxc/Manifest
22 +++ b/app-admin/keepassxc/Manifest
23 @@ -1,4 +1,3 @@
24 DIST keepassxc-2.3.4-src.tar.xz 4137176 BLAKE2B bbf8dbef5fb365f3c0d9332454b2b3bce7d4e411f43939ae683428ca669a459f1662bb8b1a1da228bc9447ee15349a5cd558e4fdfcc5194f22401f56003fd0f0 SHA512 edca22ef9d7c553d21d8ea6115a5635265176acc56fdf055f1961a3e65046de49ed5b67eb68ecf4f925226fb5bca140d5d473a5082301168f6a8bb7979f562a8
25 -DIST keepassxc-2.4.0-src.tar.xz 3252104 BLAKE2B 7c82822f6fb0eaf6b5d086aebdf4927af215339f92e7f52104e05d5ff301461a1ad816d8a39b377c717e975001c9295ec6d8b2f2003a2215c05931eb9acb5c73 SHA512 b7295f5983237606efd236955dc73d477992d944e547eeb2c3a267d846e70ce6f83e489f58e3bd9b5bb21decabd9052a4ea7b98bd98e8283abbb678ae19e5559
26 DIST keepassxc-2.4.1-src.tar.xz 3277856 BLAKE2B 64ed15987f26fd884db8fec9dc8e5d9ecd1ab9c298c2c35ee41f5aacd51bf3cd512c8ca0370ccc294d4f1ac6214678d2a3a4d8c47441c01ae8e858252018ec97 SHA512 4369043700d3de4fece0a1dd0f8aab3f621df379bc9d0214b4c70ab72d081f978104aa09fd39c4b4bf8b8df8f78266835dc206c31e7174bdf872a977c0d79502
27 DIST keepassxc-2.4.2-src.tar.xz 3290468 BLAKE2B bcb4974729c771073b6ccf4f5af5ac94a237c349dacc10be5db698630e4fc8fc226a6911957c1ea4723dfce9aa348c11588aa1e5927487cdd36d9c8bae0d7758 SHA512 4ad7e559a36831ad715672d3cddcd3becd4f39847b7ad4451d920c76671e607f8ec9d65ed6f5450dd95e037d129cafe8faff8c1ecd9d20a22fed2c72b2dde9f2
28
29 diff --git a/app-admin/keepassxc/files/keepassxc-2.4.0-build_fix.patch b/app-admin/keepassxc/files/keepassxc-2.4.0-build_fix.patch
30 deleted file mode 100644
31 index 486c8e2dd9a..00000000000
32 --- a/app-admin/keepassxc/files/keepassxc-2.4.0-build_fix.patch
33 +++ /dev/null
34 @@ -1,38 +0,0 @@
35 -From ff43f3ff8a8a1630d10e7117c45048623d215616 Mon Sep 17 00:00:00 2001
36 -From: Lars Wendler <polynomial-c@g.o>
37 -Date: Wed, 20 Mar 2019 11:53:21 +0100
38 -Subject: [PATCH] src/gui/DatabaseWidget.cpp: Build fails without
39 - WITH_XC_KEESHARE
40 -MIME-Version: 1.0
41 -Content-Type: text/plain; charset=UTF-8
42 -Content-Transfer-Encoding: 8bit
43 -
44 -/var/tmp/portage/app-admin/keepassxc-2.4.0/work/keepassxc-2.4.0/src/gui/DatabaseWidget.cpp: In member function ‘void DatabaseWidget::search(const QString&)’:
45 -/var/tmp/portage/app-admin/keepassxc-2.4.0/work/keepassxc-2.4.0/src/gui/DatabaseWidget.cpp:1115:5: error: ‘m_shareLabel’ was not declared in this scope
46 - m_shareLabel->setVisible(false);
47 - ^~~~~~~~~~~~
48 -/var/tmp/portage/app-admin/keepassxc-2.4.0/work/keepassxc-2.4.0/src/gui/DatabaseWidget.cpp:1115:5: note: suggested alternative: ‘m_searchingLabel’
49 - m_shareLabel->setVisible(false);
50 - ^~~~~~~~~~~~
51 - m_searchingLabel
52 ----
53 - src/gui/DatabaseWidget.cpp | 2 ++
54 - 1 file changed, 2 insertions(+)
55 -
56 -diff --git a/src/gui/DatabaseWidget.cpp b/src/gui/DatabaseWidget.cpp
57 -index 8728c331..e4196734 100644
58 ---- a/src/gui/DatabaseWidget.cpp
59 -+++ b/src/gui/DatabaseWidget.cpp
60 -@@ -1112,7 +1112,9 @@ void DatabaseWidget::search(const QString& searchtext)
61 - }
62 -
63 - m_searchingLabel->setVisible(true);
64 -+#ifdef WITH_XC_KEESHARE
65 - m_shareLabel->setVisible(false);
66 -+#endif
67 -
68 - emit searchModeActivated();
69 - }
70 ---
71 -2.21.0
72 -
73
74 diff --git a/app-admin/keepassxc/files/keepassxc-2.4.0-update_checker_toggle.patch b/app-admin/keepassxc/files/keepassxc-2.4.0-update_checker_toggle.patch
75 deleted file mode 100644
76 index 64e02066916..00000000000
77 --- a/app-admin/keepassxc/files/keepassxc-2.4.0-update_checker_toggle.patch
78 +++ /dev/null
79 @@ -1,445 +0,0 @@
80 -From 28994fef0d2c04690490f34b5da87c42e60a6b5e Mon Sep 17 00:00:00 2001
81 -From: Jonathan White <support@××××××.us>
82 -Date: Tue, 9 Apr 2019 21:06:13 -0400
83 -Subject: [PATCH] Enhance update checker
84 -
85 -* Reduce initial update check notification to 500 ms to prevent inappropriately stealing focus from user
86 -* Add build flag WITH_XC_UPDATECHECK which defaults to ON
87 -* Update checks are resolved every 7 days instead of every time the application is started
88 -* Better checks for beta builds; ignore snapshots
89 -* Increase test cases
90 ----
91 - CMakeLists.txt | 5 ++
92 - src/CMakeLists.txt | 1 +
93 - src/config-keepassx.h.cmake | 1 +
94 - src/core/Clock.cpp | 1 +
95 - src/gui/ApplicationSettingsWidget.cpp | 25 ++++++-
96 - src/gui/ApplicationSettingsWidget.h | 2 +
97 - src/gui/ApplicationSettingsWidgetGeneral.ui | 39 +++++++---
98 - src/gui/MainWindow.cpp | 12 ++--
99 - src/updatecheck/UpdateChecker.cpp | 79 +++++++++++++--------
100 - src/updatecheck/UpdateChecker.h | 2 +-
101 - tests/TestUpdateCheck.cpp | 35 ++++++---
102 - 11 files changed, 147 insertions(+), 55 deletions(-)
103 -
104 -diff --git a/CMakeLists.txt b/CMakeLists.txt
105 -index 658548f7..4f8a419c 100644
106 ---- a/CMakeLists.txt
107 -+++ b/CMakeLists.txt
108 -@@ -49,6 +49,7 @@ option(WITH_XC_YUBIKEY "Include YubiKey support." OFF)
109 - option(WITH_XC_SSHAGENT "Include SSH agent support." OFF)
110 - option(WITH_XC_KEESHARE "Sharing integration with KeeShare" OFF)
111 - option(WITH_XC_KEESHARE_SECURE "Sharing integration with secured KeeShare containers" OFF)
112 -+option(WITH_XC_UPDATECHECK "Include automatic update checks; disable for controlled distributions" ON)
113 - if(APPLE)
114 - option(WITH_XC_TOUCHID "Include TouchID support for macOS." OFF)
115 - endif()
116 -@@ -76,6 +77,10 @@ else()
117 - set(WITH_XC_CRYPTO_SSH OFF)
118 - endif()
119 -
120 -+if(WITH_XC_UPDATECHECK)
121 -+ set(WITH_XC_NETWORKING ON)
122 -+endif()
123 -+
124 - set(KEEPASSXC_VERSION_MAJOR "2")
125 - set(KEEPASSXC_VERSION_MINOR "4")
126 - set(KEEPASSXC_VERSION_PATCH "0")
127 -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
128 -index 110dc606..31f29033 100644
129 ---- a/src/CMakeLists.txt
130 -+++ b/src/CMakeLists.txt
131 -@@ -195,6 +195,7 @@ add_feature_info(SSHAgent WITH_XC_SSHAGENT "SSH agent integration compatible wit
132 - add_feature_info(KeeShare WITH_XC_KEESHARE "Sharing integration with KeeShare")
133 - add_feature_info(KeeShare-Secure WITH_XC_KEESHARE_SECURE "Sharing integration with KeeShare with secure sources")
134 - add_feature_info(YubiKey WITH_XC_YUBIKEY "YubiKey HMAC-SHA1 challenge-response")
135 -+add_feature_info(UpdateCheck WITH_XC_UPDATECHECK "Automatic update checking")
136 - if(APPLE)
137 - add_feature_info(TouchID WITH_XC_TOUCHID "TouchID integration")
138 - endif()
139 -diff --git a/src/config-keepassx.h.cmake b/src/config-keepassx.h.cmake
140 -index 7d701886..2acff446 100644
141 ---- a/src/config-keepassx.h.cmake
142 -+++ b/src/config-keepassx.h.cmake
143 -@@ -20,6 +20,7 @@
144 - #cmakedefine WITH_XC_KEESHARE
145 - #cmakedefine WITH_XC_KEESHARE_INSECURE
146 - #cmakedefine WITH_XC_KEESHARE_SECURE
147 -+#cmakedefine WITH_XC_UPDATECHECK
148 - #cmakedefine WITH_XC_TOUCHID
149 -
150 - #cmakedefine KEEPASSXC_BUILD_TYPE "@KEEPASSXC_BUILD_TYPE@"
151 -diff --git a/src/core/Clock.cpp b/src/core/Clock.cpp
152 -index 88ac4fb7..be9e91dc 100644
153 ---- a/src/core/Clock.cpp
154 -+++ b/src/core/Clock.cpp
155 -@@ -30,6 +30,7 @@ QDateTime Clock::currentDateTime()
156 -
157 - uint Clock::currentSecondsSinceEpoch()
158 - {
159 -+ // TODO: change to toSecsSinceEpoch() when min Qt >= 5.8
160 - return instance().currentDateTimeImpl().toTime_t();
161 - }
162 -
163 -diff --git a/src/gui/ApplicationSettingsWidget.cpp b/src/gui/ApplicationSettingsWidget.cpp
164 -index 90b851bd..e6a7068d 100644
165 ---- a/src/gui/ApplicationSettingsWidget.cpp
166 -+++ b/src/gui/ApplicationSettingsWidget.cpp
167 -@@ -91,8 +91,15 @@ ApplicationSettingsWidget::ApplicationSettingsWidget(QWidget* parent)
168 - m_secUi->touchIDResetSpinBox, SLOT(setEnabled(bool)));
169 - // clang-format on
170 -
171 --#ifndef WITH_XC_NETWORKING
172 -+#ifdef WITH_XC_UPDATECHECK
173 -+ connect(m_generalUi->checkForUpdatesOnStartupCheckBox, SIGNAL(toggled(bool)), SLOT(checkUpdatesToggled(bool)));
174 -+#else
175 - m_generalUi->checkForUpdatesOnStartupCheckBox->setVisible(false);
176 -+ m_generalUi->checkForUpdatesIncludeBetasCheckBox->setVisible(false);
177 -+ m_generalUi->checkUpdatesSpacer->changeSize(0,0, QSizePolicy::Fixed, QSizePolicy::Fixed);
178 -+#endif
179 -+
180 -+#ifndef WITH_XC_NETWORKING
181 - m_secUi->privacy->setVisible(false);
182 - #endif
183 -
184 -@@ -336,3 +343,19 @@ void ApplicationSettingsWidget::enableToolbarSettings(bool checked)
185 - m_generalUi->toolButtonStyleComboBox->setEnabled(!checked);
186 - m_generalUi->toolButtonStyleLabel->setEnabled(!checked);
187 - }
188 -+
189 -+void ApplicationSettingsWidget::rememberDatabasesToggled(bool checked)
190 -+{
191 -+ if (!checked) {
192 -+ m_generalUi->rememberLastKeyFilesCheckBox->setChecked(false);
193 -+ m_generalUi->openPreviousDatabasesOnStartupCheckBox->setChecked(false);
194 -+ }
195 -+
196 -+ m_generalUi->rememberLastKeyFilesCheckBox->setEnabled(checked);
197 -+ m_generalUi->openPreviousDatabasesOnStartupCheckBox->setEnabled(checked);
198 -+}
199 -+
200 -+void ApplicationSettingsWidget::checkUpdatesToggled(bool checked)
201 -+{
202 -+ m_generalUi->checkForUpdatesIncludeBetasCheckBox->setEnabled(checked);
203 -+}
204 -diff --git a/src/gui/ApplicationSettingsWidget.h b/src/gui/ApplicationSettingsWidget.h
205 -index ffcfea2b..86688b70 100644
206 ---- a/src/gui/ApplicationSettingsWidget.h
207 -+++ b/src/gui/ApplicationSettingsWidget.h
208 -@@ -56,6 +56,8 @@ private slots:
209 - void autoSaveToggled(bool checked);
210 - void systrayToggled(bool checked);
211 - void enableToolbarSettings(bool checked);
212 -+ void rememberDatabasesToggled(bool checked);
213 -+ void checkUpdatesToggled(bool checked);
214 -
215 - private:
216 - QWidget* const m_secWidget;
217 -diff --git a/src/gui/ApplicationSettingsWidgetGeneral.ui b/src/gui/ApplicationSettingsWidgetGeneral.ui
218 -index 798971bf..678b55fa 100644
219 ---- a/src/gui/ApplicationSettingsWidgetGeneral.ui
220 -+++ b/src/gui/ApplicationSettingsWidgetGeneral.ui
221 -@@ -86,10 +86,40 @@
222 - <item>
223 - <widget class="QCheckBox" name="checkForUpdatesOnStartupCheckBox">
224 - <property name="text">
225 -- <string>Check for updates at application startup</string>
226 -+ <string>Check for updates at application startup once per week</string>
227 - </property>
228 - </widget>
229 - </item>
230 -+ <item>
231 -+ <layout class="QHBoxLayout" name="checkUpdatesSubLayout">
232 -+ <property name="spacing">
233 -+ <number>0</number>
234 -+ </property>
235 -+ <item>
236 -+ <spacer name="checkUpdatesSpacer">
237 -+ <property name="orientation">
238 -+ <enum>Qt::Horizontal</enum>
239 -+ </property>
240 -+ <property name="sizeType">
241 -+ <enum>QSizePolicy::Fixed</enum>
242 -+ </property>
243 -+ <property name="sizeHint" stdset="0">
244 -+ <size>
245 -+ <width>20</width>
246 -+ <height>20</height>
247 -+ </size>
248 -+ </property>
249 -+ </spacer>
250 -+ </item>
251 -+ <item>
252 -+ <widget class="QCheckBox" name="checkForUpdatesIncludeBetasCheckBox">
253 -+ <property name="text">
254 -+ <string>Include beta releases when checking for updates</string>
255 -+ </property>
256 -+ </widget>
257 -+ </item>
258 -+ </layout>
259 -+ </item>
260 - </layout>
261 - </widget>
262 - </item>
263 -@@ -186,13 +216,6 @@
264 - <string>General</string>
265 - </property>
266 - <layout class="QVBoxLayout" name="verticalLayout_7">
267 -- <item>
268 -- <widget class="QCheckBox" name="checkForUpdatesIncludeBetasCheckBox">
269 -- <property name="text">
270 -- <string>Include pre-releases when checking for updates</string>
271 -- </property>
272 -- </widget>
273 -- </item>
274 - <item>
275 - <widget class="QCheckBox" name="toolbarHideCheckBox">
276 - <property name="text">
277 -diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp
278 -index 6e3c96af..6776a59d 100644
279 ---- a/src/gui/MainWindow.cpp
280 -+++ b/src/gui/MainWindow.cpp
281 -@@ -41,7 +41,7 @@
282 - #include "keys/FileKey.h"
283 - #include "keys/PasswordKey.h"
284 -
285 --#ifdef WITH_XC_NETWORKING
286 -+#ifdef WITH_XC_UPDATECHECK
287 - #include "gui/MessageBox.h"
288 - #include "gui/UpdateCheckDialog.h"
289 - #include "updatecheck/UpdateChecker.h"
290 -@@ -372,12 +372,12 @@ MainWindow::MainWindow()
291 - setUnifiedTitleAndToolBarOnMac(true);
292 - #endif
293 -
294 --#ifdef WITH_XC_NETWORKING
295 -+#ifdef WITH_XC_UPDATECHECK
296 - connect(m_ui->actionCheckForUpdates, SIGNAL(triggered()), SLOT(showUpdateCheckDialog()));
297 - connect(UpdateChecker::instance(),
298 - SIGNAL(updateCheckFinished(bool, QString, bool)),
299 - SLOT(hasUpdateAvailable(bool, QString, bool)));
300 -- QTimer::singleShot(3000, this, SLOT(showUpdateCheckStartup()));
301 -+ QTimer::singleShot(500, this, SLOT(showUpdateCheckStartup()));
302 - #else
303 - m_ui->actionCheckForUpdates->setVisible(false);
304 - #endif
305 -@@ -687,7 +687,7 @@ void MainWindow::showAboutDialog()
306 -
307 - void MainWindow::showUpdateCheckStartup()
308 - {
309 --#ifdef WITH_XC_NETWORKING
310 -+#ifdef WITH_XC_UPDATECHECK
311 - if (!config()->get("UpdateCheckMessageShown", false).toBool()) {
312 - auto result =
313 - MessageBox::question(this,
314 -@@ -710,7 +710,7 @@ void MainWindow::showUpdateCheckStartup()
315 -
316 - void MainWindow::hasUpdateAvailable(bool hasUpdate, const QString& version, bool isManuallyRequested)
317 - {
318 --#ifdef WITH_XC_NETWORKING
319 -+#ifdef WITH_XC_UPDATECHECK
320 - if (hasUpdate && !isManuallyRequested) {
321 - auto* updateCheckDialog = new UpdateCheckDialog(this);
322 - updateCheckDialog->showUpdateCheckResponse(hasUpdate, version);
323 -@@ -725,7 +725,7 @@ void MainWindow::hasUpdateAvailable(bool hasUpdate, const QString& version, bool
324 -
325 - void MainWindow::showUpdateCheckDialog()
326 - {
327 --#ifdef WITH_XC_NETWORKING
328 -+#ifdef WITH_XC_UPDATECHECK
329 - updateCheck()->checkForUpdates(true);
330 - auto* updateCheckDialog = new UpdateCheckDialog(this);
331 - updateCheckDialog->show();
332 -diff --git a/src/updatecheck/UpdateChecker.cpp b/src/updatecheck/UpdateChecker.cpp
333 -index 4272410b..14531290 100644
334 ---- a/src/updatecheck/UpdateChecker.cpp
335 -+++ b/src/updatecheck/UpdateChecker.cpp
336 -@@ -17,6 +17,7 @@
337 -
338 - #include "UpdateChecker.h"
339 - #include "config-keepassx.h"
340 -+#include "core/Clock.h"
341 - #include "core/Config.h"
342 - #include <QJsonObject>
343 - #include <QNetworkAccessManager>
344 -@@ -38,24 +39,28 @@ UpdateChecker::~UpdateChecker()
345 -
346 - void UpdateChecker::checkForUpdates(bool manuallyRequested)
347 - {
348 -+ auto nextCheck = config()->get("GUI/CheckForUpdatesNextCheck", 0).toULongLong();
349 - m_isManuallyRequested = manuallyRequested;
350 -- m_bytesReceived.clear();
351 -
352 -- QString apiUrlStr = QString("https://api.github.com/repos/keepassxreboot/keepassxc/releases");
353 -+ if (m_isManuallyRequested || Clock::currentSecondsSinceEpoch() >= nextCheck) {
354 -+ m_bytesReceived.clear();
355 -
356 -- if (!config()->get("GUI/CheckForUpdatesIncludeBetas", false).toBool()) {
357 -- apiUrlStr += "/latest";
358 -- }
359 -+ QString apiUrlStr = QString("https://api.github.com/repos/keepassxreboot/keepassxc/releases");
360 -+
361 -+ if (!config()->get("GUI/CheckForUpdatesIncludeBetas", false).toBool()) {
362 -+ apiUrlStr += "/latest";
363 -+ }
364 -
365 -- QUrl apiUrl = QUrl(apiUrlStr);
366 -+ QUrl apiUrl = QUrl(apiUrlStr);
367 -
368 -- QNetworkRequest request(apiUrl);
369 -- request.setRawHeader("Accept", "application/json");
370 -+ QNetworkRequest request(apiUrl);
371 -+ request.setRawHeader("Accept", "application/json");
372 -
373 -- m_reply = m_netMgr->get(request);
374 -+ m_reply = m_netMgr->get(request);
375 -
376 -- connect(m_reply, &QNetworkReply::finished, this, &UpdateChecker::fetchFinished);
377 -- connect(m_reply, &QIODevice::readyRead, this, &UpdateChecker::fetchReadyRead);
378 -+ connect(m_reply, &QNetworkReply::finished, this, &UpdateChecker::fetchFinished);
379 -+ connect(m_reply, &QIODevice::readyRead, this, &UpdateChecker::fetchReadyRead);
380 -+ }
381 - }
382 -
383 - void UpdateChecker::fetchReadyRead()
384 -@@ -84,8 +89,12 @@ void UpdateChecker::fetchFinished()
385 -
386 - if (!jsonObject.value("tag_name").isUndefined()) {
387 - version = jsonObject.value("tag_name").toString();
388 -- hasNewVersion = compareVersions(version, QString(KEEPASSXC_VERSION));
389 -+ hasNewVersion = compareVersions(QString(KEEPASSXC_VERSION), version);
390 - }
391 -+
392 -+ // Check again in 7 days
393 -+ // TODO: change to toSecsSinceEpoch() when min Qt >= 5.8
394 -+ config()->set("GUI/CheckForUpdatesNextCheck", Clock::currentDateTime().addDays(7).toTime_t());
395 - } else {
396 - version = "error";
397 - }
398 -@@ -93,38 +102,46 @@ void UpdateChecker::fetchFinished()
399 - emit updateCheckFinished(hasNewVersion, version, m_isManuallyRequested);
400 - }
401 -
402 --bool UpdateChecker::compareVersions(const QString& remoteVersion, const QString& localVersion)
403 -+bool UpdateChecker::compareVersions(const QString& localVersion, const QString& remoteVersion)
404 - {
405 -+ // Quick full-string equivalence check
406 - if (localVersion == remoteVersion) {
407 -- return false; // Currently using updated version
408 -+ return false;
409 - }
410 -
411 -- QRegularExpression verRegex("^(\\d+(\\.\\d+){0,2})(-\\w+)?$", QRegularExpression::CaseInsensitiveOption);
412 -+ QRegularExpression verRegex(R"(^((?:\d+\.){2}\d+)(?:-(\w+?)(\d+)?)?$)");
413 -
414 -- QRegularExpressionMatch lmatch = verRegex.match(localVersion);
415 -- QRegularExpressionMatch rmatch = verRegex.match(remoteVersion);
416 -+ auto lmatch = verRegex.match(localVersion);
417 -+ auto rmatch = verRegex.match(remoteVersion);
418 -
419 -- if (!lmatch.captured(1).isNull() && !rmatch.captured(1).isNull()) {
420 -- if (lmatch.captured(1) == rmatch.captured(1) && !lmatch.captured(3).isNull()) {
421 -- // Same version, but installed version has snapshot/beta suffix and should be updated to stable
422 -- return true;
423 -- }
424 -+ auto lVersion = lmatch.captured(1).split(".");
425 -+ auto lSuffix = lmatch.captured(2);
426 -+ auto lBetaNum = lmatch.captured(3);
427 -
428 -- QStringList lparts = lmatch.captured(1).split(".");
429 -- QStringList rparts = rmatch.captured(1).split(".");
430 -+ auto rVersion = rmatch.captured(1).split(".");
431 -+ auto rSuffix = rmatch.captured(2);
432 -+ auto rBetaNum = rmatch.captured(3);
433 -
434 -- if (lparts.length() < 3)
435 -- lparts << "0";
436 -+ if (!lVersion.isEmpty() && !rVersion.isEmpty()) {
437 -+ if (lSuffix.compare("snapshot", Qt::CaseInsensitive) == 0) {
438 -+ // Snapshots are not checked for version updates
439 -+ return false;
440 -+ }
441 -
442 -- if (rparts.length() < 3)
443 -- rparts << "0";
444 -+ // Check "-beta[X]" versions
445 -+ if (lVersion == rVersion && !lSuffix.isEmpty()) {
446 -+ // Check if stable version has been released or new beta is available
447 -+ // otherwise the version numbers are equal
448 -+ return rSuffix.isEmpty() || lBetaNum.toInt() < rBetaNum.toInt();
449 -+ }
450 -
451 - for (int i = 0; i < 3; i++) {
452 -- int l = lparts[i].toInt();
453 -- int r = rparts[i].toInt();
454 -+ int l = lVersion[i].toInt();
455 -+ int r = rVersion[i].toInt();
456 -
457 -- if (l == r)
458 -+ if (l == r) {
459 - continue;
460 -+ }
461 -
462 - if (l > r) {
463 - return false; // Installed version is newer than release
464 -diff --git a/src/updatecheck/UpdateChecker.h b/src/updatecheck/UpdateChecker.h
465 -index ac6471d6..64430bda 100644
466 ---- a/src/updatecheck/UpdateChecker.h
467 -+++ b/src/updatecheck/UpdateChecker.h
468 -@@ -31,7 +31,7 @@ public:
469 - ~UpdateChecker() override;
470 -
471 - void checkForUpdates(bool manuallyRequested);
472 -- static bool compareVersions(const QString& remoteVersion, const QString& localVersion);
473 -+ static bool compareVersions(const QString& localVersion, const QString& remoteVersion);
474 - static UpdateChecker* instance();
475 -
476 - signals:
477 -diff --git a/tests/TestUpdateCheck.cpp b/tests/TestUpdateCheck.cpp
478 -index 8cba43b1..ff709cd5 100644
479 ---- a/tests/TestUpdateCheck.cpp
480 -+++ b/tests/TestUpdateCheck.cpp
481 -@@ -29,13 +29,32 @@ void TestUpdateCheck::initTestCase()
482 -
483 - void TestUpdateCheck::testCompareVersion()
484 - {
485 -- // Remote Version , Installed Version
486 -- QCOMPARE(UpdateChecker::compareVersions(QString("2.4.0"), QString("2.3.4")), true);
487 -- QCOMPARE(UpdateChecker::compareVersions(QString("2.3.0"), QString("2.4.0")), false);
488 -+ // No upgrade
489 - QCOMPARE(UpdateChecker::compareVersions(QString("2.3.0"), QString("2.3.0")), false);
490 -- QCOMPARE(UpdateChecker::compareVersions(QString("2.3.0"), QString("2.3.0-beta1")), true);
491 -- QCOMPARE(UpdateChecker::compareVersions(QString("2.3.0-beta2"), QString("2.3.0-beta1")), true);
492 -- QCOMPARE(UpdateChecker::compareVersions(QString("2.3.4"), QString("2.4.0-snapshot")), false);
493 -- QCOMPARE(UpdateChecker::compareVersions(QString("invalid"), QString("2.4.0")), false);
494 -- QCOMPARE(UpdateChecker::compareVersions(QString(""), QString("2.4.0")), false);
495 -+
496 -+ // First digit upgrade
497 -+ QCOMPARE(UpdateChecker::compareVersions(QString("2.4.0"), QString("3.0.0")), true);
498 -+ QCOMPARE(UpdateChecker::compareVersions(QString("3.0.0"), QString("2.4.0")), false);
499 -+
500 -+ // Second digit upgrade
501 -+ QCOMPARE(UpdateChecker::compareVersions(QString("2.3.4"), QString("2.4.0")), true);
502 -+ QCOMPARE(UpdateChecker::compareVersions(QString("2.4.0"), QString("2.3.4")), false);
503 -+
504 -+ // Third digit upgrade
505 -+ QCOMPARE(UpdateChecker::compareVersions(QString("2.3.0"), QString("2.3.1")), true);
506 -+ QCOMPARE(UpdateChecker::compareVersions(QString("2.3.1"), QString("2.3.0")), false);
507 -+
508 -+ // Beta builds
509 -+ QCOMPARE(UpdateChecker::compareVersions(QString("2.3.0"), QString("2.3.0-beta1")), false);
510 -+ QCOMPARE(UpdateChecker::compareVersions(QString("2.3.0"), QString("2.3.1-beta1")), true);
511 -+ QCOMPARE(UpdateChecker::compareVersions(QString("2.3.0-beta1"), QString("2.3.0")), true);
512 -+ QCOMPARE(UpdateChecker::compareVersions(QString("2.3.0-beta"), QString("2.3.0-beta1")), true);
513 -+ QCOMPARE(UpdateChecker::compareVersions(QString("2.3.0-beta1"), QString("2.3.0-beta")), false);
514 -+ QCOMPARE(UpdateChecker::compareVersions(QString("2.3.0-beta1"), QString("2.3.0-beta2")), true);
515 -+ QCOMPARE(UpdateChecker::compareVersions(QString("2.3.0-beta2"), QString("2.3.0-beta1")), false);
516 -+
517 -+ // Snapshot and invalid data
518 -+ QCOMPARE(UpdateChecker::compareVersions(QString("2.3.4-snapshot"), QString("2.4.0")), false);
519 -+ QCOMPARE(UpdateChecker::compareVersions(QString("2.4.0"), QString("invalid")), false);
520 -+ QCOMPARE(UpdateChecker::compareVersions(QString("2.4.0"), QString("")), false);
521 - }
522 ---
523 -2.21.0
524 -
525
526 diff --git a/app-admin/keepassxc/keepassxc-2.4.0-r1.ebuild b/app-admin/keepassxc/keepassxc-2.4.0-r1.ebuild
527 deleted file mode 100644
528 index 1b2e8923803..00000000000
529 --- a/app-admin/keepassxc/keepassxc-2.4.0-r1.ebuild
530 +++ /dev/null
531 @@ -1,102 +0,0 @@
532 -# Copyright 1999-2019 Gentoo Authors
533 -# Distributed under the terms of the GNU General Public License v2
534 -
535 -EAPI=7
536 -
537 -inherit cmake-utils xdg
538 -
539 -DESCRIPTION="KeePassXC - KeePass Cross-platform Community Edition"
540 -HOMEPAGE="https://keepassxc.org"
541 -
542 -if [[ "${PV}" != 9999 ]] ; then
543 - if [[ "${PV}" == *_beta* ]] ; then
544 - SRC_URI="https://github.com/keepassxreboot/keepassxc/archive/${PV/_/-}.tar.gz -> ${P}.tar.gz"
545 - S="${WORKDIR}/${P/_/-}"
546 - else
547 - #SRC_URI="https://github.com/keepassxreboot/keepassxc/archive/${PV}.tar.gz -> ${P}.tar.gz"
548 - SRC_URI="https://github.com/keepassxreboot/keepassxc/releases/download/${PV}/${P}-src.tar.xz"
549 - KEYWORDS="~amd64 ~x86"
550 - fi
551 -else
552 - inherit git-r3
553 - EGIT_REPO_URI="https://github.com/keepassxreboot/${PN}"
554 -fi
555 -
556 -LICENSE="LGPL-2.1 GPL-2 GPL-3"
557 -SLOT="0"
558 -IUSE="autotype browser debug network test yubikey"
559 -
560 -RDEPEND="
561 - app-crypt/argon2:=
562 - dev-libs/libgcrypt:=
563 - dev-qt/qtcore:5
564 - dev-qt/qtdbus:5
565 - dev-qt/qtgui:5
566 - dev-qt/qtnetwork:5
567 - dev-qt/qtsvg:5
568 - dev-qt/qtwidgets:5
569 - media-gfx/qrencode:=
570 - sys-libs/zlib
571 - autotype? (
572 - dev-qt/qtx11extras:5
573 - x11-libs/libX11
574 - x11-libs/libXi
575 - x11-libs/libXtst
576 - )
577 - browser? ( >=dev-libs/libsodium-1.0.12 )
578 - yubikey? ( sys-auth/ykpers )
579 -"
580 -
581 -DEPEND="
582 - ${RDEPEND}
583 - dev-qt/linguist-tools:5
584 - dev-qt/qttest:5
585 - dev-qt/qtconcurrent:5
586 -"
587 -
588 -# Not a runtime dependency but still needed (see bug #667092)
589 -PDEPEND="
590 - x11-misc/xsel
591 -"
592 -
593 -PATCHES=(
594 - "${FILESDIR}/${PN}-dont_call_mandb.patch"
595 - "${FILESDIR}/${P}-build_fix.patch"
596 - "${FILESDIR}/${P}-update_checker_toggle.patch"
597 -)
598 -
599 -src_prepare() {
600 - use test || \
601 - sed -e "/^find_package(Qt5Test/d" -i CMakeLists.txt || die
602 -
603 - cmake-utils_src_prepare
604 -}
605 -
606 -src_configure() {
607 - local mycmakeargs=(
608 - -DWITH_GUI_TESTS=OFF
609 - -DWITH_TESTS="$(usex test)"
610 - -DWITH_XC_AUTOTYPE="$(usex autotype)"
611 - -DWITH_XC_BROWSER="$(usex browser)"
612 - -DWITH_XC_NETWORKING="$(usex network)"
613 - -DWITH_XC_SSHAGENT=ON
614 - -DWITH_XC_UPDATECHECK=OFF
615 - -DWITH_XC_YUBIKEY="$(usex yubikey)"
616 - )
617 - if [[ "${PV}" == *_beta* ]] ; then
618 - mycmakeargs+=( -DOVERRIDE_VERSION="${PV/_/-}" )
619 - fi
620 - cmake-utils_src_configure
621 -}
622 -
623 -pkg_preinst() {
624 - xdg_pkg_preinst
625 -}
626 -
627 -pkg_postinst() {
628 - xdg_pkg_postinst
629 -}
630 -
631 -pkg_postrm() {
632 - xdg_pkg_postrm
633 -}