public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Andreas Sturmlechner" <asturm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: kde-frameworks/knewstuff/files/, kde-frameworks/knewstuff/
Date: Sat,  2 Oct 2021 13:35:14 +0000 (UTC)	[thread overview]
Message-ID: <1633181706.686a75446fd2e7c96d88d939ca710adb6714ce42.asturm@gentoo> (raw)

commit:     686a75446fd2e7c96d88d939ca710adb6714ce42
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sat Oct  2 13:30:51 2021 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sat Oct  2 13:35:06 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=686a7544

kde-frameworks/knewstuff: Help upstream lower server utilization

See also:
https://mail.kde.org/pipermail/distributions/2021-October/001054.html
https://invent.kde.org/frameworks/knewstuff/-/merge_requests/142

Package-Manager: Portage-3.0.26, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 ...5.86.0-include-user-agent-on-KNS-requests.patch | 58 ++++++++++++++++++++++
 .../knewstuff/knewstuff-5.86.0-r2.ebuild           | 54 ++++++++++++++++++++
 2 files changed, 112 insertions(+)

diff --git a/kde-frameworks/knewstuff/files/knewstuff-5.86.0-include-user-agent-on-KNS-requests.patch b/kde-frameworks/knewstuff/files/knewstuff-5.86.0-include-user-agent-on-KNS-requests.patch
new file mode 100644
index 00000000000..6252d28f7b9
--- /dev/null
+++ b/kde-frameworks/knewstuff/files/knewstuff-5.86.0-include-user-agent-on-KNS-requests.patch
@@ -0,0 +1,58 @@
+From f687c5abd0c5e9bd5a6688b6d9d50f2536b7d33d Mon Sep 17 00:00:00 2001
+From: Aleix Pol <aleixpol@kde.org>
+Date: Fri, 24 Sep 2021 14:31:05 +0200
+Subject: [PATCH] Include a user agent on KNS requests
+
+---
+ src/core/jobs/httpworker.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/src/core/jobs/httpworker.cpp b/src/core/jobs/httpworker.cpp
+index 4c218b08..b81edd2d 100644
+--- a/src/core/jobs/httpworker.cpp
++++ b/src/core/jobs/httpworker.cpp
+@@ -7,7 +7,9 @@
+ #include "httpworker.h"
+ 
+ #include "knewstuffcore_debug.h"
++#include "knewstuffcore_version.h"
+ 
++#include <QCoreApplication>
+ #include <QFile>
+ #include <QMutex>
+ #include <QMutexLocker>
+@@ -93,6 +95,15 @@ void HTTPWorker::setUrl(const QUrl &url)
+     d->source = url;
+ }
+ 
++static void addUserAgent(QNetworkRequest &request)
++{
++    QString agentHeader = QStringLiteral("KNewStuff/%1").arg(QLatin1String(KNEWSTUFFCORE_VERSION_STRING));
++    if (QCoreApplication::instance()) {
++        agentHeader += QStringLiteral("-%1/%2").arg(QCoreApplication::instance()->applicationName(), QCoreApplication::instance()->applicationVersion());
++    }
++    request.setHeader(QNetworkRequest::UserAgentHeader, agentHeader);
++}
++
+ void HTTPWorker::startRequest()
+ {
+     if (d->reply) {
+@@ -101,6 +112,7 @@ void HTTPWorker::startRequest()
+     }
+ 
+     QNetworkRequest request(d->source);
++    addUserAgent(request);
+     d->reply = s_httpWorkerNAM->get(request);
+     connect(d->reply, &QNetworkReply::readyRead, this, &HTTPWorker::handleReadyRead);
+     connect(d->reply, &QNetworkReply::finished, this, &HTTPWorker::handleFinished);
+@@ -144,6 +156,7 @@ void HTTPWorker::handleFinished()
+                                    << d->reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
+             d->reply->deleteLater();
+             QNetworkRequest request(d->redirectUrl);
++            addUserAgent(request);
+             d->reply = s_httpWorkerNAM->get(request);
+             connect(d->reply, &QNetworkReply::readyRead, this, &HTTPWorker::handleReadyRead);
+             connect(d->reply, &QNetworkReply::finished, this, &HTTPWorker::handleFinished);
+-- 
+GitLab
+

diff --git a/kde-frameworks/knewstuff/knewstuff-5.86.0-r2.ebuild b/kde-frameworks/knewstuff/knewstuff-5.86.0-r2.ebuild
new file mode 100644
index 00000000000..06de5529585
--- /dev/null
+++ b/kde-frameworks/knewstuff/knewstuff-5.86.0-r2.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+ECM_TEST="false"
+PVCUT=$(ver_cut 1-2)
+QTMIN=5.15.2
+inherit ecm kde.org
+
+DESCRIPTION="Framework for downloading and sharing additional application data"
+
+LICENSE="LGPL-2+"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
+IUSE="opds"
+
+DEPEND="
+	>=dev-qt/qtdeclarative-${QTMIN}:5
+	>=dev-qt/qtgui-${QTMIN}:5
+	>=dev-qt/qtnetwork-${QTMIN}:5
+	>=dev-qt/qtwidgets-${QTMIN}:5
+	>=dev-qt/qtxml-${QTMIN}:5
+	=kde-frameworks/attica-${PVCUT}*:5
+	=kde-frameworks/karchive-${PVCUT}*:5
+	=kde-frameworks/kcompletion-${PVCUT}*:5
+	=kde-frameworks/kconfig-${PVCUT}*:5
+	=kde-frameworks/kcoreaddons-${PVCUT}*:5
+	=kde-frameworks/ki18n-${PVCUT}*:5
+	=kde-frameworks/kiconthemes-${PVCUT}*:5
+	=kde-frameworks/kio-${PVCUT}*:5
+	=kde-frameworks/kitemviews-${PVCUT}*:5
+	=kde-frameworks/kpackage-${PVCUT}*:5
+	=kde-frameworks/kservice-${PVCUT}*:5
+	=kde-frameworks/ktextwidgets-${PVCUT}*:5
+	=kde-frameworks/kwidgetsaddons-${PVCUT}*:5
+	=kde-frameworks/kxmlgui-${PVCUT}*:5
+	opds? ( =kde-frameworks/syndication-${PVCUT}*:5 )
+"
+RDEPEND="${DEPEND}
+	>=kde-frameworks/kirigami-${PVCUT}:5
+"
+
+PATCHES=(
+	"${FILESDIR}/${P}-fix-crash-in-DownloadWidget.patch" # KDE-bug 443025
+	"${FILESDIR}/${P}-include-user-agent-on-KNS-requests.patch"
+)
+
+src_configure() {
+	local mycmakeargs=(
+		$(cmake_use_find_package opds KF5Syndication)
+	)
+
+	ecm_src_configure
+}


             reply	other threads:[~2021-10-02 13:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-02 13:35 Andreas Sturmlechner [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-04-14 20:03 [gentoo-commits] repo/gentoo:master commit in: kde-frameworks/knewstuff/files/, kde-frameworks/knewstuff/ Andreas Sturmlechner
2024-03-11  9:05 Andreas Sturmlechner
2023-04-22 16:21 Andreas Sturmlechner
2022-05-04 20:50 Andreas Sturmlechner
2022-04-09 16:07 Andreas Sturmlechner
2022-03-26 16:40 Andreas Sturmlechner
2022-02-10 20:10 Andreas Sturmlechner
2021-04-11 14:23 Andreas Sturmlechner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1633181706.686a75446fd2e7c96d88d939ca710adb6714ce42.asturm@gentoo \
    --to=asturm@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox