From ad96d3838967007bbff64ddfb6eba8b4590bf912 Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Sat, 9 Mar 2024 22:21:12 +0100 Subject: [PATCH] refactor: Remove sync of updateinfo The update info is already automatically fetched from GitHub instead of using the distribution.json from the datastore --- .../share/shared/updateinfo/distribution.json | 25 ------------------- .../updateinfo/distribution.json.license | 3 --- scripts/datastore.py | 10 -------- src/blackcore/data/globalsetup.cpp | 8 +----- src/blackcore/data/globalsetup.h | 6 ----- 5 files changed, 1 insertion(+), 51 deletions(-) delete mode 100644 resources/share/shared/updateinfo/distribution.json delete mode 100644 resources/share/shared/updateinfo/distribution.json.license diff --git a/resources/share/shared/updateinfo/distribution.json b/resources/share/shared/updateinfo/distribution.json deleted file mode 100644 index c22942006..000000000 --- a/resources/share/shared/updateinfo/distribution.json +++ /dev/null @@ -1,25 +0,0 @@ -[ - { - "channel": "ALPHA", - "restricted": true, - "url0": "https:\/\/datastore.swift-project.org\/page\/alpha.html", - "url1": null, - "url2": null, - "url3": null, - "url4": null, - "platforms": { - "linux-64": [ - "swift-installer-0.7.1-linux-64_2017-01-08_22-17-19.run" - ], - "linux-64-vatsim": [ - "swift-installer-0.7.3-linux-64_2017-03-13_17-24-46.run" - ], - "win-64-vatsim": [ - "swift-installer-0.7.3-win-64_2017-03-13_17-25-52.exe" - ] - }, - "id": 1, - "tsLastUpdated": "2017-03-30 14:15:51", - "tsCreated": "2017-03-25 23:32:52" - } -] \ No newline at end of file diff --git a/resources/share/shared/updateinfo/distribution.json.license b/resources/share/shared/updateinfo/distribution.json.license deleted file mode 100644 index 4eaf3369b..000000000 --- a/resources/share/shared/updateinfo/distribution.json.license +++ /dev/null @@ -1,3 +0,0 @@ -Copyright (C) swift Project Community / Contributors - -SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 diff --git a/scripts/datastore.py b/scripts/datastore.py index 8f36c6fa6..459c5f0cc 100644 --- a/scripts/datastore.py +++ b/scripts/datastore.py @@ -231,17 +231,8 @@ class DbDataSync(BaseSync): write_json_to_file(file_path, j, timestamp) -class UpdateInfoSync(BaseSync): - def __init__(self, host, version, target_path): - BaseSync.__init__(self, host, version, target_path) - - def sync(self): - self.sync_file('updateinfo', 'distribution.json') - - def update_shared(host, version, target_path): DbDataSync(host, version, target_path).sync() - UpdateInfoSync(host, version, target_path).sync() def main(): @@ -250,7 +241,6 @@ def main(): target_path = os.path.abspath(os.curdir) DbDataSync(host, version, target_path).sync() - UpdateInfoSync(host, version, target_path).sync() if __name__ == '__main__': diff --git a/src/blackcore/data/globalsetup.cpp b/src/blackcore/data/globalsetup.cpp index 7455d79e5..5dc3241fc 100644 --- a/src/blackcore/data/globalsetup.cpp +++ b/src/blackcore/data/globalsetup.cpp @@ -55,11 +55,6 @@ namespace BlackCore::Data return m_sharedUrls; } - CUrlList CGlobalSetup::getSwiftUpdateInfoFileUrls() const - { - return getSwiftSharedUrls().withAppendedPath(CGlobalSetup::schemaVersionString() + "/updateinfo/updateinfo.json"); - } - CUrl CGlobalSetup::getDbHomePageUrl() const { return getDbRootDirectoryUrl().withAppendedPath("/page/index.php"); @@ -184,7 +179,7 @@ namespace BlackCore::Data QString s = u"Global setup loaded: " % separator % u"Mapping min.version: " % this->getMappingMinimumVersionString() % separator - % u"Distribution URLs: " % getSwiftUpdateInfoFileUrls().toQString(i18n) % separator % u"Help URLs: " % m_onlineHelpUrls.toQString(i18n) % separator; + % u"Help URLs: " % m_onlineHelpUrls.toQString(i18n) % separator; s += u"DB root directory: " % getDbRootDirectoryUrl().toQString(i18n) % separator % u"ICAO DB reader: " % getDbIcaoReaderUrl().toQString(i18n) % separator % u"Model DB reader: " % getDbModelReaderUrl().toQString(i18n) % separator % u"Airport DB reader: " % getDbAirportReaderUrl().toQString(i18n) % separator % u"DB home page: " % getDbHomePageUrl().toQString(i18n) % separator % u"DB login service: " % getDbLoginServiceUrl().toQString(i18n) % separator % u"DB client ping service: " % getDbClientPingServiceUrl().toQString(i18n); s += @@ -218,7 +213,6 @@ namespace BlackCore::Data case IndexVatsimServer: return QVariant::fromValue(m_vatsimServerFileUrl); case IndexVatsimHttpFsd: return QVariant::fromValue(m_vatsimFsdHttpUrl); case IndexVatsimMetars: return QVariant::fromValue(m_vatsimMetarsUrls); - case IndexUpdateInfoFileUrls: return QVariant::fromValue(this->getSwiftUpdateInfoFileUrls()); case IndexSharedUrls: return QVariant::fromValue(m_sharedUrls); case IndexOnlineHelpUrls: return QVariant::fromValue(m_onlineHelpUrls); case IndexCrashReportServerUrl: return QVariant::fromValue(m_crashReportServerUrl); diff --git a/src/blackcore/data/globalsetup.h b/src/blackcore/data/globalsetup.h index 1f4626d8f..0cd4d1590 100644 --- a/src/blackcore/data/globalsetup.h +++ b/src/blackcore/data/globalsetup.h @@ -44,8 +44,6 @@ namespace BlackCore::Data IndexVatsimData, IndexVatsimServer, IndexVatsimHttpFsd, - IndexSwiftDbFiles, - IndexUpdateInfoFileUrls, IndexOnlineHelpUrls, IndexCrashReportServerUrl, IndexSharedUrls, @@ -132,10 +130,6 @@ namespace BlackCore::Data //! Shared URLs const BlackMisc::Network::CUrlList &getSwiftSharedUrls() const; - //! Distribution URLs - //! \remark based on getSwiftSharedUrls - BlackMisc::Network::CUrlList getSwiftUpdateInfoFileUrls() const; - //! VATSIM METAR URL const BlackMisc::Network::CUrlList &getVatsimMetarsUrls() const { return m_vatsimMetarsUrls; }