diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2019-04-28 09:54:45 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2019-04-28 09:54:45 +0100 |
commit | b7ebc951da8800f711142f69d9d958bde67a112d (patch) | |
tree | e318514216845acb8f2e49fff7a5cba4027e9d91 /app-admin/keepassxc | |
parent | dc7cbdfa65fd814b3b9aa3c56257da201109e807 (diff) |
gentoo resync : 28.04.2019
Diffstat (limited to 'app-admin/keepassxc')
-rw-r--r-- | app-admin/keepassxc/Manifest | 9 | ||||
-rw-r--r-- | app-admin/keepassxc/files/keepassxc-2.4.0-update_checker_toggle.patch | 445 | ||||
-rw-r--r-- | app-admin/keepassxc/keepassxc-2.4.0-r1.ebuild (renamed from app-admin/keepassxc/keepassxc-2.4.0.ebuild) | 2 | ||||
-rw-r--r-- | app-admin/keepassxc/keepassxc-2.4.1.ebuild | 96 | ||||
-rw-r--r-- | app-admin/keepassxc/keepassxc-9999.ebuild | 7 | ||||
-rw-r--r-- | app-admin/keepassxc/metadata.xml | 1 |
6 files changed, 555 insertions, 5 deletions
diff --git a/app-admin/keepassxc/Manifest b/app-admin/keepassxc/Manifest index 03bf85d0bf9c..bd335664dcd7 100644 --- a/app-admin/keepassxc/Manifest +++ b/app-admin/keepassxc/Manifest @@ -1,9 +1,12 @@ AUX keepassxc-2.3.3-qt-5.11-edit-entry-widget-includes.patch 249 BLAKE2B 52875492ce10a1ee9c33d213a4c72ac72ffbe9fb9ba46cfb57d7de9d97011643ad9bcf4b106a7cc909c81e55542740c5ad3626789f3d0de12ba48493b43cb955 SHA512 8734ddcbe9f5432939d6d0c1a9c16ef9a192b00efab20bb5f50a1dab12b475090d4028625194978872dd801a0b7ceb6bac4102401b054eeca15054667b9aa9b9 AUX keepassxc-2.4.0-build_fix.patch 1419 BLAKE2B b5661c75008c9031598ee704b21e0581a6e3859addb9b4e642cca415b06f26cb7e6a984fb942f648f7d4082c17e198644230ddf711696971df6754cf4c6eb119 SHA512 3e659b5048089528c2055f9481119e66f655b2531a4347d4ca6e439bcc82566f2e658bdf4442e6c678d19811ca494533e7ce08e14dab3148c841084f2f5ab898 +AUX keepassxc-2.4.0-update_checker_toggle.patch 18616 BLAKE2B 5b13c5ab493b955dc31e7f928c471ec11095f26a2d2f76a5145318e0e35dc751187eae11f9467a78c0455ae8ab0a6a0045c6b4670a701f13e56910ac1b484808 SHA512 138f0de9bd862423a4764fcc61c133ef98d800ce6ab3cde0fe304352866266bbd8d8acd8dabd131e8189e8cbc551f92464f03c199f9f02861534c17b30a94ea2 AUX keepassxc-dont_call_mandb.patch 792 BLAKE2B 3154b6624a2e5923a3b3ad9edfbaedd5c0bba77f47108913d8eece63cbc4df571f516a41d72db0287a7a4d8741ab309cc7e09c8fcddaec0bf39ed09479607329 SHA512 21bd27e713357f5aa522a2263a1d03b8a595fb0d51ea10c034358169cb2f72c70585b04dde8f0d8e9af30c9ecf055b528b975a9701372d4f726a8f50b347d8f4 DIST keepassxc-2.3.4-src.tar.xz 4137176 BLAKE2B bbf8dbef5fb365f3c0d9332454b2b3bce7d4e411f43939ae683428ca669a459f1662bb8b1a1da228bc9447ee15349a5cd558e4fdfcc5194f22401f56003fd0f0 SHA512 edca22ef9d7c553d21d8ea6115a5635265176acc56fdf055f1961a3e65046de49ed5b67eb68ecf4f925226fb5bca140d5d473a5082301168f6a8bb7979f562a8 DIST keepassxc-2.4.0-src.tar.xz 3252104 BLAKE2B 7c82822f6fb0eaf6b5d086aebdf4927af215339f92e7f52104e05d5ff301461a1ad816d8a39b377c717e975001c9295ec6d8b2f2003a2215c05931eb9acb5c73 SHA512 b7295f5983237606efd236955dc73d477992d944e547eeb2c3a267d846e70ce6f83e489f58e3bd9b5bb21decabd9052a4ea7b98bd98e8283abbb678ae19e5559 +DIST keepassxc-2.4.1-src.tar.xz 3277856 BLAKE2B 64ed15987f26fd884db8fec9dc8e5d9ecd1ab9c298c2c35ee41f5aacd51bf3cd512c8ca0370ccc294d4f1ac6214678d2a3a4d8c47441c01ae8e858252018ec97 SHA512 4369043700d3de4fece0a1dd0f8aab3f621df379bc9d0214b4c70ab72d081f978104aa09fd39c4b4bf8b8df8f78266835dc206c31e7174bdf872a977c0d79502 EBUILD keepassxc-2.3.4-r1.ebuild 1847 BLAKE2B 4de124b498c9d101b56a9c966170d6bfef024ac8853b166c82e42244a209956f062ebe3f1cfa99d6b62fc2ce3569b884ede3cda338bfd6d92ca5575f18a30f33 SHA512 bbcaea1ebd466a585375cb29688761202bdff37fa4ec18f40134e933d8fa7036d8be422b822b3dbc307ca16fbc8a509f04d6f29c2e7b442143fcedd7b662eb6f -EBUILD keepassxc-2.4.0.ebuild 2087 BLAKE2B 95aa54e8b74d315affb3300c0384faeea4861b79fdf52037c15b1c2beb3da15a9de9bd58f70debdd21f3bd5417ccadb5b8d001787a253f482c6e0edae58afd68 SHA512 9e97dbc7d7182a3d1ad53de47403baf7b0026271241e936d60039238869faf0b6b48fe1d463f2effb45498d822067352e2bc238efaad4260e1996ec9ac9750fd -EBUILD keepassxc-9999.ebuild 1995 BLAKE2B 6b883c1cc942e330d437707367e9e6e416432ac5c932360fb561eac3ff4af72e70b50ea58084aad0082255d0f1528168e96ac8e9faff96fcea8814760f4893c8 SHA512 75d6f738836de30ace55d71c8d69b0bb4837542be721fb4663bfaef595f1b0d7c8d15bf1211549c2219f98ec45c49e2ddec772956d0347a470dd3ef55b8b5bd1 -MISC metadata.xml 891 BLAKE2B 0c279d26b8f00d816d92a8fdd428629cf92a0ee7c0789ac60c9b5ea9b491dbd495a09815785fa99427ae8f5701dff0da8a06065059b1a6f05f1cdadbdde88192 SHA512 ec6fe12b1b508784947b55bb562a9e99632481ce06289b4dd7325f0834789fa4df99a15792ab7e91bab169c89a0a5a4c99ccd3372f1a2ff84cece49c4acd1779 +EBUILD keepassxc-2.4.0-r1.ebuild 2163 BLAKE2B 5dd1a135a8c3eb1dbebbf9424f85955449196bd86bfbf9c6fe00a07fc5d166158d9c75c1dab87c611fe4f3420133976d5e5f25517677f74148ac09571906d9c5 SHA512 e77ea5b046d744c59d3d1cb6fa9328697eae8c9a6a0a0acdc13990f6871b74484fe9f69c9b3a62b575d170b0df756c7db631c4804228e29d9445308291817129 +EBUILD keepassxc-2.4.1.ebuild 2024 BLAKE2B f7289b70d43a0ad73f7b63ceed0a9d8317f377ec5a66122150ca8b63dec566d2763454673ed7b76621f18d160096724658b5da55c3296397d51a78cb55d96e97 SHA512 9893aad20535bfd881d0e0fad6b8898edd7f64e0e74ae14388c272a72e27bcfc70c539e4bf0c3938e659c81840e082a3f8dd55efff18a564564e1366af0b5433 +EBUILD keepassxc-9999.ebuild 2113 BLAKE2B 1fab5247efdda6aae6d6e77c27eef8b6ef665c756b57cab71a7ce7d84c0d1cb7df0aa5b68543962b6d3ac965c03724a4be1948702cca255b2718f24c7ebb59ec SHA512 af6da2389520f883fea99ecafa37920371cd461b15e2162c5869d4f726a13713ccebec926faeecae3a0e7d036f1f7b2e3e32559349983935db0cbaee3d2b771e +MISC metadata.xml 960 BLAKE2B 63a61f81e372efa1d1a4118f8353818eb28f4d9b0e7c87c5cb6e7a4ee8c9856ae3c7ee981e2777d3263725338581834f294022d052397dffbe98db2b5ba36895 SHA512 85ad2302913936ce51a455ae15e2d9ca7a68d26fc16819f46ab494b6aaafecdf32f74596b47c1b5a3cea56bfc49bf7021dbb4b770efb8f362386a67c88ea2404 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 new file mode 100644 index 000000000000..64e02066916b --- /dev/null +++ b/app-admin/keepassxc/files/keepassxc-2.4.0-update_checker_toggle.patch @@ -0,0 +1,445 @@ +From 28994fef0d2c04690490f34b5da87c42e60a6b5e Mon Sep 17 00:00:00 2001 +From: Jonathan White <support@dmapps.us> +Date: Tue, 9 Apr 2019 21:06:13 -0400 +Subject: [PATCH] Enhance update checker + +* Reduce initial update check notification to 500 ms to prevent inappropriately stealing focus from user +* Add build flag WITH_XC_UPDATECHECK which defaults to ON +* Update checks are resolved every 7 days instead of every time the application is started +* Better checks for beta builds; ignore snapshots +* Increase test cases +--- + CMakeLists.txt | 5 ++ + src/CMakeLists.txt | 1 + + src/config-keepassx.h.cmake | 1 + + src/core/Clock.cpp | 1 + + src/gui/ApplicationSettingsWidget.cpp | 25 ++++++- + src/gui/ApplicationSettingsWidget.h | 2 + + src/gui/ApplicationSettingsWidgetGeneral.ui | 39 +++++++--- + src/gui/MainWindow.cpp | 12 ++-- + src/updatecheck/UpdateChecker.cpp | 79 +++++++++++++-------- + src/updatecheck/UpdateChecker.h | 2 +- + tests/TestUpdateCheck.cpp | 35 ++++++--- + 11 files changed, 147 insertions(+), 55 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 658548f7..4f8a419c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -49,6 +49,7 @@ option(WITH_XC_YUBIKEY "Include YubiKey support." OFF) + option(WITH_XC_SSHAGENT "Include SSH agent support." OFF) + option(WITH_XC_KEESHARE "Sharing integration with KeeShare" OFF) + option(WITH_XC_KEESHARE_SECURE "Sharing integration with secured KeeShare containers" OFF) ++option(WITH_XC_UPDATECHECK "Include automatic update checks; disable for controlled distributions" ON) + if(APPLE) + option(WITH_XC_TOUCHID "Include TouchID support for macOS." OFF) + endif() +@@ -76,6 +77,10 @@ else() + set(WITH_XC_CRYPTO_SSH OFF) + endif() + ++if(WITH_XC_UPDATECHECK) ++ set(WITH_XC_NETWORKING ON) ++endif() ++ + set(KEEPASSXC_VERSION_MAJOR "2") + set(KEEPASSXC_VERSION_MINOR "4") + set(KEEPASSXC_VERSION_PATCH "0") +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 110dc606..31f29033 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -195,6 +195,7 @@ add_feature_info(SSHAgent WITH_XC_SSHAGENT "SSH agent integration compatible wit + add_feature_info(KeeShare WITH_XC_KEESHARE "Sharing integration with KeeShare") + add_feature_info(KeeShare-Secure WITH_XC_KEESHARE_SECURE "Sharing integration with KeeShare with secure sources") + add_feature_info(YubiKey WITH_XC_YUBIKEY "YubiKey HMAC-SHA1 challenge-response") ++add_feature_info(UpdateCheck WITH_XC_UPDATECHECK "Automatic update checking") + if(APPLE) + add_feature_info(TouchID WITH_XC_TOUCHID "TouchID integration") + endif() +diff --git a/src/config-keepassx.h.cmake b/src/config-keepassx.h.cmake +index 7d701886..2acff446 100644 +--- a/src/config-keepassx.h.cmake ++++ b/src/config-keepassx.h.cmake +@@ -20,6 +20,7 @@ + #cmakedefine WITH_XC_KEESHARE + #cmakedefine WITH_XC_KEESHARE_INSECURE + #cmakedefine WITH_XC_KEESHARE_SECURE ++#cmakedefine WITH_XC_UPDATECHECK + #cmakedefine WITH_XC_TOUCHID + + #cmakedefine KEEPASSXC_BUILD_TYPE "@KEEPASSXC_BUILD_TYPE@" +diff --git a/src/core/Clock.cpp b/src/core/Clock.cpp +index 88ac4fb7..be9e91dc 100644 +--- a/src/core/Clock.cpp ++++ b/src/core/Clock.cpp +@@ -30,6 +30,7 @@ QDateTime Clock::currentDateTime() + + uint Clock::currentSecondsSinceEpoch() + { ++ // TODO: change to toSecsSinceEpoch() when min Qt >= 5.8 + return instance().currentDateTimeImpl().toTime_t(); + } + +diff --git a/src/gui/ApplicationSettingsWidget.cpp b/src/gui/ApplicationSettingsWidget.cpp +index 90b851bd..e6a7068d 100644 +--- a/src/gui/ApplicationSettingsWidget.cpp ++++ b/src/gui/ApplicationSettingsWidget.cpp +@@ -91,8 +91,15 @@ ApplicationSettingsWidget::ApplicationSettingsWidget(QWidget* parent) + m_secUi->touchIDResetSpinBox, SLOT(setEnabled(bool))); + // clang-format on + +-#ifndef WITH_XC_NETWORKING ++#ifdef WITH_XC_UPDATECHECK ++ connect(m_generalUi->checkForUpdatesOnStartupCheckBox, SIGNAL(toggled(bool)), SLOT(checkUpdatesToggled(bool))); ++#else + m_generalUi->checkForUpdatesOnStartupCheckBox->setVisible(false); ++ m_generalUi->checkForUpdatesIncludeBetasCheckBox->setVisible(false); ++ m_generalUi->checkUpdatesSpacer->changeSize(0,0, QSizePolicy::Fixed, QSizePolicy::Fixed); ++#endif ++ ++#ifndef WITH_XC_NETWORKING + m_secUi->privacy->setVisible(false); + #endif + +@@ -336,3 +343,19 @@ void ApplicationSettingsWidget::enableToolbarSettings(bool checked) + m_generalUi->toolButtonStyleComboBox->setEnabled(!checked); + m_generalUi->toolButtonStyleLabel->setEnabled(!checked); + } ++ ++void ApplicationSettingsWidget::rememberDatabasesToggled(bool checked) ++{ ++ if (!checked) { ++ m_generalUi->rememberLastKeyFilesCheckBox->setChecked(false); ++ m_generalUi->openPreviousDatabasesOnStartupCheckBox->setChecked(false); ++ } ++ ++ m_generalUi->rememberLastKeyFilesCheckBox->setEnabled(checked); ++ m_generalUi->openPreviousDatabasesOnStartupCheckBox->setEnabled(checked); ++} ++ ++void ApplicationSettingsWidget::checkUpdatesToggled(bool checked) ++{ ++ m_generalUi->checkForUpdatesIncludeBetasCheckBox->setEnabled(checked); ++} +diff --git a/src/gui/ApplicationSettingsWidget.h b/src/gui/ApplicationSettingsWidget.h +index ffcfea2b..86688b70 100644 +--- a/src/gui/ApplicationSettingsWidget.h ++++ b/src/gui/ApplicationSettingsWidget.h +@@ -56,6 +56,8 @@ private slots: + void autoSaveToggled(bool checked); + void systrayToggled(bool checked); + void enableToolbarSettings(bool checked); ++ void rememberDatabasesToggled(bool checked); ++ void checkUpdatesToggled(bool checked); + + private: + QWidget* const m_secWidget; +diff --git a/src/gui/ApplicationSettingsWidgetGeneral.ui b/src/gui/ApplicationSettingsWidgetGeneral.ui +index 798971bf..678b55fa 100644 +--- a/src/gui/ApplicationSettingsWidgetGeneral.ui ++++ b/src/gui/ApplicationSettingsWidgetGeneral.ui +@@ -86,10 +86,40 @@ + <item> + <widget class="QCheckBox" name="checkForUpdatesOnStartupCheckBox"> + <property name="text"> +- <string>Check for updates at application startup</string> ++ <string>Check for updates at application startup once per week</string> + </property> + </widget> + </item> ++ <item> ++ <layout class="QHBoxLayout" name="checkUpdatesSubLayout"> ++ <property name="spacing"> ++ <number>0</number> ++ </property> ++ <item> ++ <spacer name="checkUpdatesSpacer"> ++ <property name="orientation"> ++ <enum>Qt::Horizontal</enum> ++ </property> ++ <property name="sizeType"> ++ <enum>QSizePolicy::Fixed</enum> ++ </property> ++ <property name="sizeHint" stdset="0"> ++ <size> ++ <width>20</width> ++ <height>20</height> ++ </size> ++ </property> ++ </spacer> ++ </item> ++ <item> ++ <widget class="QCheckBox" name="checkForUpdatesIncludeBetasCheckBox"> ++ <property name="text"> ++ <string>Include beta releases when checking for updates</string> ++ </property> ++ </widget> ++ </item> ++ </layout> ++ </item> + </layout> + </widget> + </item> +@@ -186,13 +216,6 @@ + <string>General</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_7"> +- <item> +- <widget class="QCheckBox" name="checkForUpdatesIncludeBetasCheckBox"> +- <property name="text"> +- <string>Include pre-releases when checking for updates</string> +- </property> +- </widget> +- </item> + <item> + <widget class="QCheckBox" name="toolbarHideCheckBox"> + <property name="text"> +diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp +index 6e3c96af..6776a59d 100644 +--- a/src/gui/MainWindow.cpp ++++ b/src/gui/MainWindow.cpp +@@ -41,7 +41,7 @@ + #include "keys/FileKey.h" + #include "keys/PasswordKey.h" + +-#ifdef WITH_XC_NETWORKING ++#ifdef WITH_XC_UPDATECHECK + #include "gui/MessageBox.h" + #include "gui/UpdateCheckDialog.h" + #include "updatecheck/UpdateChecker.h" +@@ -372,12 +372,12 @@ MainWindow::MainWindow() + setUnifiedTitleAndToolBarOnMac(true); + #endif + +-#ifdef WITH_XC_NETWORKING ++#ifdef WITH_XC_UPDATECHECK + connect(m_ui->actionCheckForUpdates, SIGNAL(triggered()), SLOT(showUpdateCheckDialog())); + connect(UpdateChecker::instance(), + SIGNAL(updateCheckFinished(bool, QString, bool)), + SLOT(hasUpdateAvailable(bool, QString, bool))); +- QTimer::singleShot(3000, this, SLOT(showUpdateCheckStartup())); ++ QTimer::singleShot(500, this, SLOT(showUpdateCheckStartup())); + #else + m_ui->actionCheckForUpdates->setVisible(false); + #endif +@@ -687,7 +687,7 @@ void MainWindow::showAboutDialog() + + void MainWindow::showUpdateCheckStartup() + { +-#ifdef WITH_XC_NETWORKING ++#ifdef WITH_XC_UPDATECHECK + if (!config()->get("UpdateCheckMessageShown", false).toBool()) { + auto result = + MessageBox::question(this, +@@ -710,7 +710,7 @@ void MainWindow::showUpdateCheckStartup() + + void MainWindow::hasUpdateAvailable(bool hasUpdate, const QString& version, bool isManuallyRequested) + { +-#ifdef WITH_XC_NETWORKING ++#ifdef WITH_XC_UPDATECHECK + if (hasUpdate && !isManuallyRequested) { + auto* updateCheckDialog = new UpdateCheckDialog(this); + updateCheckDialog->showUpdateCheckResponse(hasUpdate, version); +@@ -725,7 +725,7 @@ void MainWindow::hasUpdateAvailable(bool hasUpdate, const QString& version, bool + + void MainWindow::showUpdateCheckDialog() + { +-#ifdef WITH_XC_NETWORKING ++#ifdef WITH_XC_UPDATECHECK + updateCheck()->checkForUpdates(true); + auto* updateCheckDialog = new UpdateCheckDialog(this); + updateCheckDialog->show(); +diff --git a/src/updatecheck/UpdateChecker.cpp b/src/updatecheck/UpdateChecker.cpp +index 4272410b..14531290 100644 +--- a/src/updatecheck/UpdateChecker.cpp ++++ b/src/updatecheck/UpdateChecker.cpp +@@ -17,6 +17,7 @@ + + #include "UpdateChecker.h" + #include "config-keepassx.h" ++#include "core/Clock.h" + #include "core/Config.h" + #include <QJsonObject> + #include <QNetworkAccessManager> +@@ -38,24 +39,28 @@ UpdateChecker::~UpdateChecker() + + void UpdateChecker::checkForUpdates(bool manuallyRequested) + { ++ auto nextCheck = config()->get("GUI/CheckForUpdatesNextCheck", 0).toULongLong(); + m_isManuallyRequested = manuallyRequested; +- m_bytesReceived.clear(); + +- QString apiUrlStr = QString("https://api.github.com/repos/keepassxreboot/keepassxc/releases"); ++ if (m_isManuallyRequested || Clock::currentSecondsSinceEpoch() >= nextCheck) { ++ m_bytesReceived.clear(); + +- if (!config()->get("GUI/CheckForUpdatesIncludeBetas", false).toBool()) { +- apiUrlStr += "/latest"; +- } ++ QString apiUrlStr = QString("https://api.github.com/repos/keepassxreboot/keepassxc/releases"); ++ ++ if (!config()->get("GUI/CheckForUpdatesIncludeBetas", false).toBool()) { ++ apiUrlStr += "/latest"; ++ } + +- QUrl apiUrl = QUrl(apiUrlStr); ++ QUrl apiUrl = QUrl(apiUrlStr); + +- QNetworkRequest request(apiUrl); +- request.setRawHeader("Accept", "application/json"); ++ QNetworkRequest request(apiUrl); ++ request.setRawHeader("Accept", "application/json"); + +- m_reply = m_netMgr->get(request); ++ m_reply = m_netMgr->get(request); + +- connect(m_reply, &QNetworkReply::finished, this, &UpdateChecker::fetchFinished); +- connect(m_reply, &QIODevice::readyRead, this, &UpdateChecker::fetchReadyRead); ++ connect(m_reply, &QNetworkReply::finished, this, &UpdateChecker::fetchFinished); ++ connect(m_reply, &QIODevice::readyRead, this, &UpdateChecker::fetchReadyRead); ++ } + } + + void UpdateChecker::fetchReadyRead() +@@ -84,8 +89,12 @@ void UpdateChecker::fetchFinished() + + if (!jsonObject.value("tag_name").isUndefined()) { + version = jsonObject.value("tag_name").toString(); +- hasNewVersion = compareVersions(version, QString(KEEPASSXC_VERSION)); ++ hasNewVersion = compareVersions(QString(KEEPASSXC_VERSION), version); + } ++ ++ // Check again in 7 days ++ // TODO: change to toSecsSinceEpoch() when min Qt >= 5.8 ++ config()->set("GUI/CheckForUpdatesNextCheck", Clock::currentDateTime().addDays(7).toTime_t()); + } else { + version = "error"; + } +@@ -93,38 +102,46 @@ void UpdateChecker::fetchFinished() + emit updateCheckFinished(hasNewVersion, version, m_isManuallyRequested); + } + +-bool UpdateChecker::compareVersions(const QString& remoteVersion, const QString& localVersion) ++bool UpdateChecker::compareVersions(const QString& localVersion, const QString& remoteVersion) + { ++ // Quick full-string equivalence check + if (localVersion == remoteVersion) { +- return false; // Currently using updated version ++ return false; + } + +- QRegularExpression verRegex("^(\\d+(\\.\\d+){0,2})(-\\w+)?$", QRegularExpression::CaseInsensitiveOption); ++ QRegularExpression verRegex(R"(^((?:\d+\.){2}\d+)(?:-(\w+?)(\d+)?)?$)"); + +- QRegularExpressionMatch lmatch = verRegex.match(localVersion); +- QRegularExpressionMatch rmatch = verRegex.match(remoteVersion); ++ auto lmatch = verRegex.match(localVersion); ++ auto rmatch = verRegex.match(remoteVersion); + +- if (!lmatch.captured(1).isNull() && !rmatch.captured(1).isNull()) { +- if (lmatch.captured(1) == rmatch.captured(1) && !lmatch.captured(3).isNull()) { +- // Same version, but installed version has snapshot/beta suffix and should be updated to stable +- return true; +- } ++ auto lVersion = lmatch.captured(1).split("."); ++ auto lSuffix = lmatch.captured(2); ++ auto lBetaNum = lmatch.captured(3); + +- QStringList lparts = lmatch.captured(1).split("."); +- QStringList rparts = rmatch.captured(1).split("."); ++ auto rVersion = rmatch.captured(1).split("."); ++ auto rSuffix = rmatch.captured(2); ++ auto rBetaNum = rmatch.captured(3); + +- if (lparts.length() < 3) +- lparts << "0"; ++ if (!lVersion.isEmpty() && !rVersion.isEmpty()) { ++ if (lSuffix.compare("snapshot", Qt::CaseInsensitive) == 0) { ++ // Snapshots are not checked for version updates ++ return false; ++ } + +- if (rparts.length() < 3) +- rparts << "0"; ++ // Check "-beta[X]" versions ++ if (lVersion == rVersion && !lSuffix.isEmpty()) { ++ // Check if stable version has been released or new beta is available ++ // otherwise the version numbers are equal ++ return rSuffix.isEmpty() || lBetaNum.toInt() < rBetaNum.toInt(); ++ } + + for (int i = 0; i < 3; i++) { +- int l = lparts[i].toInt(); +- int r = rparts[i].toInt(); ++ int l = lVersion[i].toInt(); ++ int r = rVersion[i].toInt(); + +- if (l == r) ++ if (l == r) { + continue; ++ } + + if (l > r) { + return false; // Installed version is newer than release +diff --git a/src/updatecheck/UpdateChecker.h b/src/updatecheck/UpdateChecker.h +index ac6471d6..64430bda 100644 +--- a/src/updatecheck/UpdateChecker.h ++++ b/src/updatecheck/UpdateChecker.h +@@ -31,7 +31,7 @@ public: + ~UpdateChecker() override; + + void checkForUpdates(bool manuallyRequested); +- static bool compareVersions(const QString& remoteVersion, const QString& localVersion); ++ static bool compareVersions(const QString& localVersion, const QString& remoteVersion); + static UpdateChecker* instance(); + + signals: +diff --git a/tests/TestUpdateCheck.cpp b/tests/TestUpdateCheck.cpp +index 8cba43b1..ff709cd5 100644 +--- a/tests/TestUpdateCheck.cpp ++++ b/tests/TestUpdateCheck.cpp +@@ -29,13 +29,32 @@ void TestUpdateCheck::initTestCase() + + void TestUpdateCheck::testCompareVersion() + { +- // Remote Version , Installed Version +- QCOMPARE(UpdateChecker::compareVersions(QString("2.4.0"), QString("2.3.4")), true); +- QCOMPARE(UpdateChecker::compareVersions(QString("2.3.0"), QString("2.4.0")), false); ++ // No upgrade + QCOMPARE(UpdateChecker::compareVersions(QString("2.3.0"), QString("2.3.0")), false); +- QCOMPARE(UpdateChecker::compareVersions(QString("2.3.0"), QString("2.3.0-beta1")), true); +- QCOMPARE(UpdateChecker::compareVersions(QString("2.3.0-beta2"), QString("2.3.0-beta1")), true); +- QCOMPARE(UpdateChecker::compareVersions(QString("2.3.4"), QString("2.4.0-snapshot")), false); +- QCOMPARE(UpdateChecker::compareVersions(QString("invalid"), QString("2.4.0")), false); +- QCOMPARE(UpdateChecker::compareVersions(QString(""), QString("2.4.0")), false); ++ ++ // First digit upgrade ++ QCOMPARE(UpdateChecker::compareVersions(QString("2.4.0"), QString("3.0.0")), true); ++ QCOMPARE(UpdateChecker::compareVersions(QString("3.0.0"), QString("2.4.0")), false); ++ ++ // Second digit upgrade ++ QCOMPARE(UpdateChecker::compareVersions(QString("2.3.4"), QString("2.4.0")), true); ++ QCOMPARE(UpdateChecker::compareVersions(QString("2.4.0"), QString("2.3.4")), false); ++ ++ // Third digit upgrade ++ QCOMPARE(UpdateChecker::compareVersions(QString("2.3.0"), QString("2.3.1")), true); ++ QCOMPARE(UpdateChecker::compareVersions(QString("2.3.1"), QString("2.3.0")), false); ++ ++ // Beta builds ++ QCOMPARE(UpdateChecker::compareVersions(QString("2.3.0"), QString("2.3.0-beta1")), false); ++ QCOMPARE(UpdateChecker::compareVersions(QString("2.3.0"), QString("2.3.1-beta1")), true); ++ QCOMPARE(UpdateChecker::compareVersions(QString("2.3.0-beta1"), QString("2.3.0")), true); ++ QCOMPARE(UpdateChecker::compareVersions(QString("2.3.0-beta"), QString("2.3.0-beta1")), true); ++ QCOMPARE(UpdateChecker::compareVersions(QString("2.3.0-beta1"), QString("2.3.0-beta")), false); ++ QCOMPARE(UpdateChecker::compareVersions(QString("2.3.0-beta1"), QString("2.3.0-beta2")), true); ++ QCOMPARE(UpdateChecker::compareVersions(QString("2.3.0-beta2"), QString("2.3.0-beta1")), false); ++ ++ // Snapshot and invalid data ++ QCOMPARE(UpdateChecker::compareVersions(QString("2.3.4-snapshot"), QString("2.4.0")), false); ++ QCOMPARE(UpdateChecker::compareVersions(QString("2.4.0"), QString("invalid")), false); ++ QCOMPARE(UpdateChecker::compareVersions(QString("2.4.0"), QString("")), false); + } +-- +2.21.0 + diff --git a/app-admin/keepassxc/keepassxc-2.4.0.ebuild b/app-admin/keepassxc/keepassxc-2.4.0-r1.ebuild index fc5f6889a735..1b2e89238032 100644 --- a/app-admin/keepassxc/keepassxc-2.4.0.ebuild +++ b/app-admin/keepassxc/keepassxc-2.4.0-r1.ebuild @@ -62,6 +62,7 @@ PDEPEND=" PATCHES=( "${FILESDIR}/${PN}-dont_call_mandb.patch" "${FILESDIR}/${P}-build_fix.patch" + "${FILESDIR}/${P}-update_checker_toggle.patch" ) src_prepare() { @@ -79,6 +80,7 @@ src_configure() { -DWITH_XC_BROWSER="$(usex browser)" -DWITH_XC_NETWORKING="$(usex network)" -DWITH_XC_SSHAGENT=ON + -DWITH_XC_UPDATECHECK=OFF -DWITH_XC_YUBIKEY="$(usex yubikey)" ) if [[ "${PV}" == *_beta* ]] ; then diff --git a/app-admin/keepassxc/keepassxc-2.4.1.ebuild b/app-admin/keepassxc/keepassxc-2.4.1.ebuild new file mode 100644 index 000000000000..5b33ef6ebd16 --- /dev/null +++ b/app-admin/keepassxc/keepassxc-2.4.1.ebuild @@ -0,0 +1,96 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake-utils xdg + +DESCRIPTION="KeePassXC - KeePass Cross-platform Community Edition" +HOMEPAGE="https://keepassxc.org" + +if [[ "${PV}" != 9999 ]] ; then + if [[ "${PV}" == *_beta* ]] ; then + SRC_URI="https://github.com/keepassxreboot/keepassxc/archive/${PV/_/-}.tar.gz -> ${P}.tar.gz" + S="${WORKDIR}/${P/_/-}" + else + #SRC_URI="https://github.com/keepassxreboot/keepassxc/archive/${PV}.tar.gz -> ${P}.tar.gz" + SRC_URI="https://github.com/keepassxreboot/keepassxc/releases/download/${PV}/${P}-src.tar.xz" + KEYWORDS="~amd64 ~x86" + fi +else + inherit git-r3 + EGIT_REPO_URI="https://github.com/keepassxreboot/${PN}" +fi + +LICENSE="LGPL-2.1 GPL-2 GPL-3" +SLOT="0" +IUSE="autotype browser debug +network test yubikey" + +RDEPEND=" + app-crypt/argon2:= + dev-libs/libgcrypt:= + dev-qt/qtcore:5 + dev-qt/qtdbus:5 + dev-qt/qtgui:5 + dev-qt/qtnetwork:5 + dev-qt/qtsvg:5 + dev-qt/qtwidgets:5 + media-gfx/qrencode:= + sys-libs/zlib + autotype? ( + dev-qt/qtx11extras:5 + x11-libs/libX11 + x11-libs/libXi + x11-libs/libXtst + ) + browser? ( >=dev-libs/libsodium-1.0.12 ) + yubikey? ( sys-auth/ykpers ) +" + +DEPEND=" + ${RDEPEND} + dev-qt/linguist-tools:5 + dev-qt/qttest:5 + dev-qt/qtconcurrent:5 +" + +# Not a runtime dependency but still needed (see bug #667092) +PDEPEND=" + x11-misc/xsel +" + +src_prepare() { + use test || \ + sed -e "/^find_package(Qt5Test/d" -i CMakeLists.txt || die + + cmake-utils_src_prepare +} + +src_configure() { + local mycmakeargs=( + -DWITH_GUI_TESTS=OFF + -DWITH_TESTS="$(usex test)" + -DWITH_XC_AUTOTYPE="$(usex autotype)" + -DWITH_XC_BROWSER="$(usex browser)" + -DWITH_XC_NETWORKING="$(usex network)" + -DWITH_XC_SSHAGENT=ON + -DWITH_XC_UPDATECHECK=OFF + -DWITH_XC_YUBIKEY="$(usex yubikey)" + ) + if [[ "${PV}" == *_beta* ]] ; then + mycmakeargs+=( -DOVERRIDE_VERSION="${PV/_/-}" ) + fi + cmake-utils_src_configure +} + +pkg_preinst() { + xdg_pkg_preinst +} + +pkg_postinst() { + xdg_pkg_postinst +} + +pkg_postrm() { + xdg_pkg_postrm +} diff --git a/app-admin/keepassxc/keepassxc-9999.ebuild b/app-admin/keepassxc/keepassxc-9999.ebuild index 4aa8f179e8b7..933ad9b9a58f 100644 --- a/app-admin/keepassxc/keepassxc-9999.ebuild +++ b/app-admin/keepassxc/keepassxc-9999.ebuild @@ -24,7 +24,7 @@ fi LICENSE="LGPL-2.1 GPL-2 GPL-3" SLOT="0" -IUSE="autotype browser debug network test yubikey" +IUSE="autotype browser debug keeshare +network test yubikey" RDEPEND=" app-crypt/argon2:= @@ -36,7 +36,7 @@ RDEPEND=" dev-qt/qtsvg:5 dev-qt/qtwidgets:5 media-gfx/qrencode:= - sys-libs/zlib + sys-libs/zlib:= autotype? ( dev-qt/qtx11extras:5 x11-libs/libX11 @@ -44,6 +44,7 @@ RDEPEND=" x11-libs/libXtst ) browser? ( >=dev-libs/libsodium-1.0.12 ) + keeshare? ( dev-libs/quazip ) yubikey? ( sys-auth/ykpers ) " @@ -72,8 +73,10 @@ src_configure() { -DWITH_TESTS="$(usex test)" -DWITH_XC_AUTOTYPE="$(usex autotype)" -DWITH_XC_BROWSER="$(usex browser)" + -DWITH_XC_KEESHARE_SECURE="$(usex keeshare)" -DWITH_XC_NETWORKING="$(usex network)" -DWITH_XC_SSHAGENT=ON + -DWITH_XC_UPDATECHECK=OFF -DWITH_XC_YUBIKEY="$(usex yubikey)" ) if [[ "${PV}" == *_beta* ]] ; then diff --git a/app-admin/keepassxc/metadata.xml b/app-admin/keepassxc/metadata.xml index 56243a3c8c07..d9b95402e41b 100644 --- a/app-admin/keepassxc/metadata.xml +++ b/app-admin/keepassxc/metadata.xml @@ -8,6 +8,7 @@ <use> <flag name="autotype">Add support to autotype the passwords into other applications</flag> <flag name="browser">Enables browser plugin support</flag> + <flag name="keeshare">Enable KeeShare sharing integration</flag> <flag name="network">Enable network support</flag> <flag name="yubikey">Enable database unlocking via YubiKey.</flag> </use> |