Merge branch epel9-next into epel9

epel9
Troy Dawson 2 years ago
commit dd7632d314

4
.gitignore vendored

@ -42,3 +42,7 @@
/knewstuff-5.89.0.tar.xz /knewstuff-5.89.0.tar.xz
/knewstuff-5.90.0.tar.xz /knewstuff-5.90.0.tar.xz
/knewstuff-5.91.0.tar.xz /knewstuff-5.91.0.tar.xz
/knewstuff-5.92.0.tar.xz
./knewstuff-5.93.tar.xz
/knewstuff-5.94.0.tar.xz
/knewstuff-5.96.0.tar.xz

@ -0,0 +1,54 @@
From 693a2ea3926400b1482888a2df2c532852b8f971 Mon Sep 17 00:00:00 2001
From: Alexander Lohnau <alexander.lohnau@gmx.de>
Date: Sun, 20 Mar 2022 20:29:51 +0100
Subject: [PATCH 10/15] Do not set user-visible name as additional agent
information
Instead we want the filename, which is more useful as an identifier anyways, because
we would otherwise have to check which user-visible names originate from which knsrc file.
BUG: 451165
---
src/core/engine.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/core/engine.cpp b/src/core/engine.cpp
index e7abfde8..72af9c83 100644
--- a/src/core/engine.cpp
+++ b/src/core/engine.cpp
@@ -145,6 +145,7 @@ public:
QString busyMessage;
QString useLabel;
bool uploadEnabled = false;
+ QString configFileName;
};
Engine::Engine(QObject *parent)
@@ -224,6 +225,7 @@ bool Engine::init(const QString &configfile)
conf.reset(new KConfig(configfile));
qCWarning(KNEWSTUFFCORE) << "Using a deprecated location for the knsrc file" << configfile
<< " - please contact the author of the software which provides this file to get it updated to use the new location";
+ configFileName = QFileInfo(configfile).baseName();
} else if (isRelativeConfig && actualConfig.isEmpty()) {
configFileName = QFileInfo(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("knsrcfiles/%1").arg(configfile))).baseName();
conf.reset(new KConfig(QStringLiteral("knsrcfiles/%1").arg(configfile), KConfig::FullConfig, QStandardPaths::GenericDataLocation));
@@ -234,6 +236,7 @@ bool Engine::init(const QString &configfile)
configFileName = configFileInfo.baseName();
conf.reset(new KConfig(configfile));
}
+ d->configFileName = configFileName;
if (conf->accessMode() == KConfig::NoAccess) {
Q_EMIT signalErrorCode(KNSCore::ConfigFileError, i18n("Configuration file exists, but cannot be opened: \"%1\"", configfile), configfile);
@@ -425,7 +428,7 @@ void Engine::slotProviderFileLoaded(const QDomDocument &doc)
QSharedPointer<KNSCore::Provider> provider;
if (isAtticaProviderFile || n.attribute(QStringLiteral("type")).toLower() == QLatin1String("rest")) {
- provider.reset(new AtticaProvider(m_categories, d->name));
+ provider.reset(new AtticaProvider(m_categories, d->configFileName));
connect(provider.data(), &Provider::categoriesMetadataLoded, this, [this](const QList<Provider::CategoryMetadata> &categories) {
d->categoriesMetadata = categories;
Q_EMIT signalCategoriesMetadataLoded(categories);
--
2.35.1

@ -1,9 +1,8 @@
%undefine __cmake_in_source_build
%global framework knewstuff %global framework knewstuff
Name: kf5-%{framework} Name: kf5-%{framework}
Version: 5.90.0 Version: 5.96.0
Release: 2%{?dist} Release: 1%{?dist}
Summary: KDE Frameworks 5 Tier 3 module for downloading application assets Summary: KDE Frameworks 5 Tier 3 module for downloading application assets
License: LGPLv2+ License: LGPLv2+
@ -20,10 +19,6 @@ Source0: http://download.kde.org/%{stable}/frameworks/%{majmin}/%{framework}-%{v
## upstream patches ## upstream patches
## Backported patches
# https://bugzilla.redhat.com/show_bug.cgi?id=2065761
Patch300: knewstuff-5.88.0-providersurl-cache.patch
# filter qml provides # filter qml provides
%global __provides_exclude_from ^%{_kf5_qmldir}/.*\\.so$ %global __provides_exclude_from ^%{_kf5_qmldir}/.*\\.so$
@ -95,10 +90,8 @@ developing applications that use %{name}.
%{_kf5_qmldir}/org/kde/newstuff/ %{_kf5_qmldir}/org/kde/newstuff/
%files devel %files devel
%{_kf5_includedir}/knewstuff_version.h
%{_kf5_includedir}/knewstuffcore_version.h
%{_kf5_includedir}/knewstuffquick_version.h
%{_kf5_includedir}/KNewStuff3/ %{_kf5_includedir}/KNewStuff3/
%{_kf5_includedir}/KMoreTools/
%{_kf5_libdir}/libKF5NewStuff.so %{_kf5_libdir}/libKF5NewStuff.so
%{_kf5_libdir}/libKF5NewStuffCore.so %{_kf5_libdir}/libKF5NewStuffCore.so
%{_kf5_libdir}/libKF5NewStuffWidgets.so %{_kf5_libdir}/libKF5NewStuffWidgets.so
@ -110,8 +103,26 @@ developing applications that use %{name}.
%changelog %changelog
* Fri Mar 25 2022 Troy Dawson <tdawson@redhat.com> - 5.90.0-2 * Sun Jul 03 2022 Marc Deop <marcdeop@fedoraproject.org> - 5.96.0-1
- Add patch for providerFileUrl and caching (#2068568) - 5.96.0
* Fri May 13 2022 Rex Dieter <rdieter@fedoraproject.org> - 5.94.0-1
- 5.94.0
* Sun Apr 10 2022 Justin Zobel <justin@1707.io> - 5.93-1
- Update to 5.93
* Tue Mar 29 2022 Rex Dieter <rdieter@fedoraproject.org> - 5.92.0-2
- Do not set user-visible name as additional agent information (kde#451165)
* Thu Mar 10 2022 Rex Dieter <rdieter@fedoraproject.org> - 5.92.0-1
- 5.92.0
* Fri Feb 11 2022 Rex Dieter <rdieter@fedoraproject.org> - 5.91.0-1
- 5.91.0
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 5.90.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Tue Jan 04 2022 Marc Deop i Argemí (Private) <marc@marcdeop.com> - 5.90.0-1 * Tue Jan 04 2022 Marc Deop i Argemí (Private) <marc@marcdeop.com> - 5.90.0-1
- 5.90.0 - 5.90.0

@ -1,58 +0,0 @@
From 4e7a1a65d0872bc905bd1355670397f4993b86b1 Mon Sep 17 00:00:00 2001
From: Troy Dawson <tdawson@redhat.com>
Date: Fri, 18 Mar 2022 10:54:00 -0700
Subject: [PATCH] providersurl-cache
---
src/core/engine.cpp | 4 ++++
src/core/jobs/httpworker.cpp | 12 +++++++++++-
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/src/core/engine.cpp b/src/core/engine.cpp
index 428af1b..9c2990c 100644
--- a/src/core/engine.cpp
+++ b/src/core/engine.cpp
@@ -265,6 +265,10 @@ bool Engine::init(const QString &configfile)
Q_EMIT uploadEnabledChanged();
m_providerFileUrl = group.readEntry("ProvidersUrl");
+ if (m_providerFileUrl == QLatin1String("https://download.kde.org/ocs/providers.xml")) {
+ m_providerFileUrl = QStringLiteral("https://autoconfig.kde.org/ocs/providers.xml");
+ qCWarning(KNEWSTUFFCORE) << "Please make sure" << configfile << "has ProvidersUrl=https://autoconfig.kde.org/ocs/providers.xml";
+ }
if (group.readEntry("UseLocalProvidersFile", "false").toLower() == QLatin1String{"true"}) {
// The local providers file is called "appname.providers", to match "appname.knsrc"
m_providerFileUrl = QUrl::fromLocalFile(QLatin1String("%1.providers").arg(configFullPath.left(configFullPath.length() - 6))).toString();
diff --git a/src/core/jobs/httpworker.cpp b/src/core/jobs/httpworker.cpp
index b81edd2..d4dd8a2 100644
--- a/src/core/jobs/httpworker.cpp
+++ b/src/core/jobs/httpworker.cpp
@@ -41,7 +41,6 @@ public:
return nam.get(request);
}
-private:
QNetworkDiskCache cache;
};
@@ -102,6 +101,17 @@ static void addUserAgent(QNetworkRequest &request)
agentHeader += QStringLiteral("-%1/%2").arg(QCoreApplication::instance()->applicationName(), QCoreApplication::instance()->applicationVersion());
}
request.setHeader(QNetworkRequest::UserAgentHeader, agentHeader);
+
+ // Assume that no cache expiration time will be longer than a week, but otherwise prefer the cache
+ // This is mildly hacky, but if we don't do this, we end up with infinite cache expirations in some
+ // cases, which of course isn't really acceptable... See ed62ee20 for a situation where that happened.
+ QNetworkCacheMetaData cacheMeta{s_httpWorkerNAM->cache.metaData(request.url())};
+ if (cacheMeta.isValid()) {
+ const QDateTime nextWeek{QDateTime::currentDateTime().addDays(7)};
+ if (cacheMeta.expirationDate().isValid() && cacheMeta.expirationDate() < nextWeek) {
+ request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferCache);
+ }
+ }
}
void HTTPWorker::startRequest()
--
2.27.0

@ -1 +1 @@
SHA512 (knewstuff-5.90.0.tar.xz) = d80b743691eb9665e0df196a69db3cee2247bbfe6c34ea5e9511c94558d2e807c9aca867aef6cd4344eaae6f252d9fff6b3e7a31c152b8a8b69b8d54813ede28 SHA512 (knewstuff-5.96.0.tar.xz) = 5fffe90a25adbe5d0f9d69694beba5f9fe0418656d190bdb99c1495b7338cec5c0374e8f38d4fe3801cbea18a7596494d0e651fdb628c9d4e13932627fe60a26

@ -0,0 +1 @@
knewstuff
Loading…
Cancel
Save