public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rubygem-mechanize] f45: Backport upstream patch to net-http 0.10 in ruby4.1
@ 2026-10-27 8:23 Mamoru TASAKA
0 siblings, 0 replies; only message in thread
From: Mamoru TASAKA @ 2026-10-27 8:23 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/rubygem-mechanize
Branch : f45
Commit : 56931d9f7c5ce7c7d62b39d905dd5b266417321f
Author : Mamoru TASAKA <mtasaka@fedoraproject.org>
Date : 2026-10-26T15:36:18+09:00
Stats : +64/-2 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/rubygem-mechanize/c/56931d9f7c5ce7c7d62b39d905dd5b266417321f?branch=f45
Log:
Backport upstream patch to net-http 0.10 in ruby4.1
---
diff --git a/rubygem-mechanize-pr677-support-net_http_0_10.patch b/rubygem-mechanize-pr677-support-net_http_0_10.patch
new file mode 100644
index 0000000..c38292b
--- /dev/null
+++ b/rubygem-mechanize-pr677-support-net_http_0_10.patch
@@ -0,0 +1,56 @@
+From fffbf2e2ae3504dc7a4a4e49b5c4e8fbf56820bb Mon Sep 17 00:00:00 2001
+From: Mike Dalessio <mike.dalessio@gmail.com>
+Date: Wed, 21 Oct 2026 17:02:10 -0400
+Subject: [PATCH 1/2] ci: run Ruby < 3.2 on ubuntu-24.04
+
+GitHub moved `ubuntu-latest` to `ubuntu-26.04`, where `setup-ruby` has
+no Ruby older than 3.2, so the 2.6 through 3.1 jobs failed before
+running any test. The job name keeps the `test (<version>)` form that
+the branch protection rules require.
+---
+ .github/workflows/ci.yml | 13 +++++++++++--
+ 1 file changed, 11 insertions(+), 2 deletions(-)
+
+From 2a7080d0e210ad4701aba2bef22ffd1f9498d701 Mon Sep 17 00:00:00 2001
+From: Mike Dalessio <mike.dalessio@gmail.com>
+Date: Wed, 21 Oct 2026 17:02:10 -0400
+Subject: [PATCH 2/2] fix: get ruby-head CI green
+
+When ruby updated net-http to 0.10.0, the behavior introduced to read
+response lines with `readuntil` instead of `readline` broke `TestCase`
+where it uses a `StringIO` as a fake socket.
+
+Wrap the `StringIO` in a `Net::BufferedIO`, like `Net::HTTP` wraps a
+real socket.
+
+For downstream tests that use `Mechanize::TestCase`, the fake now reads
+like a real socket: `read_body` yields fragments of at most 16 KiB, and
+a body shorter than its `Content-Length` raises `EOFError` when
+`ignore_eof` is false.
+---
+ CHANGELOG.md | 1 +
+ lib/mechanize/test_case.rb | 11 ++---------
+ 2 files changed, 3 insertions(+), 9 deletions(-)
+
+diff --git a/lib/mechanize/test_case.rb b/lib/mechanize/test_case.rb
+index 926a63bf..d1166d03 100644
+--- a/lib/mechanize/test_case.rb
++++ b/lib/mechanize/test_case.rb
+@@ -262,15 +262,8 @@ def request(req, *data, &block)
+ response['Content-Type'] ||= 'text/html'
+ response['Content-Length'] = res['Content-Length'] || res.body.length.to_s
+
+- io = StringIO.new(res.body)
+- response.instance_variable_set :@socket, io
+- def io.read clen, dest = nil, _ = nil
+- if dest then
+- dest << super(clen)
+- else
+- super clen
+- end
+- end
++ socket = Net::BufferedIO.new(StringIO.new(res.body))
++ response.instance_variable_set :@socket, socket
+
+ body_exist = req.response_body_permitted? &&
+ response_klass.body_permitted?
diff --git a/rubygem-mechanize.spec b/rubygem-mechanize.spec
index fb52d02..57307f1 100644
--- a/rubygem-mechanize.spec
+++ b/rubygem-mechanize.spec
@@ -5,7 +5,7 @@
%global rpmminorver .%(echo %preminorver | sed -e 's|^\\.\\.*||')
%global fullver %{majorver}%{?preminorver}
-%global baserelease 1
+%global baserelease 2
%global gem_name mechanize
@@ -23,7 +23,9 @@ Source0: https://rubygems.org/gems/%{gem_name}-%{fullver}.gem
# https://github.com/sparklemotion/mechanize/issues/282
Patch0: rubygem-mechanize-2.8.0-disable-ntlm-http.patch
Patch1: rubygem-mechanize-2.6.0-disable-ntlm-http-test.patch
-
+# https://github.com/sparklemotion/mechanize/pull/677
+# handle net-http-0.10.0 change
+Patch2: rubygem-mechanize-pr677-support-net_http_0_10.patch
BuildRequires: ruby(release)
BuildRequires: ruby-devel
@@ -81,6 +83,7 @@ find . -name \*.rb -print0 | xargs --null chmod 0644
# Patches
%patch -P0 -p1 -b .ntlm
%patch -P1 -p1 -b .ntlmtest
+%patch -P2 -p1 -b .net_http
sed -i -e '\@ntlm-http@d' %{gem_name}-%{version}.gemspec
# Kill also this for now
@@ -157,6 +160,9 @@ popd
%{gem_instdir}/examples/
%changelog
+* Mon Oct 26 2026 Mamoru TASAKA <mtasaka@fedoraproject.org> - 2.14.1-2
+- Backport upstream patch to net-http 0.10 in ruby4.1
+
* Sun Aug 23 2026 Mamoru TASAKA <mtasaka@fedoraproject.org> - 2.14.1-1
- 2.14.1
- Fixes GHSA-2mwr-xjcg-37j7 (CVE-2026-107715)
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-27 8:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-27 8:23 [rpms/rubygem-mechanize] f45: Backport upstream patch to net-http 0.10 in ruby4.1 Mamoru TASAKA
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox