From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 2ED59158091 for ; Sat, 4 Jun 2022 05:47:41 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 175A6E079E; Sat, 4 Jun 2022 05:47:40 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id F20D8E07AE for ; Sat, 4 Jun 2022 05:47:39 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C835634246E for ; Sat, 4 Jun 2022 05:47:38 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B606B4EC for ; Sat, 4 Jun 2022 05:47:36 +0000 (UTC) From: "Hans de Graaff" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Hans de Graaff" Message-ID: <1654321649.2962b2a65d469473dbcba9afffaab21c5bcb29bb.graaff@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-ruby/rack/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-ruby/rack/files/rack-2.2.3.1-ruby30.patch X-VCS-Directories: dev-ruby/rack/files/ X-VCS-Committer: graaff X-VCS-Committer-Name: Hans de Graaff X-VCS-Revision: 2962b2a65d469473dbcba9afffaab21c5bcb29bb X-VCS-Branch: master Date: Sat, 4 Jun 2022 05:47:36 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 822f91f7-9a90-4ba2-99fa-fb2e9c637c7c X-Archives-Hash: bdb9d3225d9c01974299f47fa999998b commit: 2962b2a65d469473dbcba9afffaab21c5bcb29bb Author: Hans de Graaff gentoo org> AuthorDate: Sat Jun 4 05:45:08 2022 +0000 Commit: Hans de Graaff gentoo org> CommitDate: Sat Jun 4 05:47:29 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2962b2a6 dev-ruby/rack: add missing patch Closes: https://bugs.gentoo.org/849473 Signed-off-by: Hans de Graaff gentoo.org> dev-ruby/rack/files/rack-2.2.3.1-ruby30.patch | 210 ++++++++++++++++++++++++++ 1 file changed, 210 insertions(+) diff --git a/dev-ruby/rack/files/rack-2.2.3.1-ruby30.patch b/dev-ruby/rack/files/rack-2.2.3.1-ruby30.patch new file mode 100644 index 000000000000..467fb3487d67 --- /dev/null +++ b/dev-ruby/rack/files/rack-2.2.3.1-ruby30.patch @@ -0,0 +1,210 @@ +From 43b5565a73817d66b6d96de2e28d525a2a56f852 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Josef=20=C5=A0im=C3=A1nek?= +Date: Mon, 4 Apr 2022 23:17:19 +0200 +Subject: [PATCH] Newer rubies spec compatibility. + +--- + Gemfile | 5 +++++ + lib/rack/utils.rb | 7 +++++-- + test/spec_mock.rb | 34 +++++++++++++++++----------------- + test/testrequest.rb | 4 ++-- + 4 files changed, 29 insertions(+), 21 deletions(-) + +diff --git a/Gemfile b/Gemfile +index dc075a4ca..5768eedf7 100644 +--- a/Gemfile ++++ b/Gemfile +@@ -14,6 +14,11 @@ end + + gem "rubocop", require: false + ++group :test do ++ gem "webrick" # gemified in Ruby 3.1+ ++ gem "psych", "~> 4.0" # using YAML#unsafe_load in tests which is 4.0+ only ++end ++ + # Alternative solution that might work, but it has bad interactions with + # Gemfile.lock if that gets committed/reused: + # c_platforms = [:mri] if Gem.platforms.last.os == "java" +diff --git a/lib/rack/utils.rb b/lib/rack/utils.rb +index d3b3b1d42..34849ded1 100644 +--- a/lib/rack/utils.rb ++++ b/lib/rack/utils.rb +@@ -22,6 +22,9 @@ module Utils + COMMON_SEP = QueryParser::COMMON_SEP + KeySpaceConstrainedParams = QueryParser::Params + ++ RFC2822_DAY_NAME = [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ] ++ RFC2822_MONTH_NAME = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ] ++ + class << self + attr_accessor :default_query_parser + end +@@ -327,8 +330,8 @@ def rfc2822(time) + # weekday and month. + # + def rfc2109(time) +- wday = Time::RFC2822_DAY_NAME[time.wday] +- mon = Time::RFC2822_MONTH_NAME[time.mon - 1] ++ wday = RFC2822_DAY_NAME[time.wday] ++ mon = RFC2822_MONTH_NAME[time.mon - 1] + time.strftime("#{wday}, %d-#{mon}-%Y %H:%M:%S GMT") + end + +diff --git a/test/spec_mock.rb b/test/spec_mock.rb +index d2311f5a2..73fb7b235 100644 +--- a/test/spec_mock.rb ++++ b/test/spec_mock.rb +@@ -47,7 +47,7 @@ + it "provide sensible defaults" do + res = Rack::MockRequest.new(app).request + +- env = YAML.load(res.body) ++ env = YAML.unsafe_load(res.body) + env["REQUEST_METHOD"].must_equal "GET" + env["SERVER_NAME"].must_equal "example.org" + env["SERVER_PORT"].must_equal "80" +@@ -60,23 +60,23 @@ + + it "allow GET/POST/PUT/DELETE/HEAD" do + res = Rack::MockRequest.new(app).get("", input: "foo") +- env = YAML.load(res.body) ++ env = YAML.unsafe_load(res.body) + env["REQUEST_METHOD"].must_equal "GET" + + res = Rack::MockRequest.new(app).post("", input: "foo") +- env = YAML.load(res.body) ++ env = YAML.unsafe_load(res.body) + env["REQUEST_METHOD"].must_equal "POST" + + res = Rack::MockRequest.new(app).put("", input: "foo") +- env = YAML.load(res.body) ++ env = YAML.unsafe_load(res.body) + env["REQUEST_METHOD"].must_equal "PUT" + + res = Rack::MockRequest.new(app).patch("", input: "foo") +- env = YAML.load(res.body) ++ env = YAML.unsafe_load(res.body) + env["REQUEST_METHOD"].must_equal "PATCH" + + res = Rack::MockRequest.new(app).delete("", input: "foo") +- env = YAML.load(res.body) ++ env = YAML.unsafe_load(res.body) + env["REQUEST_METHOD"].must_equal "DELETE" + + Rack::MockRequest.env_for("/", method: "HEAD")["REQUEST_METHOD"] +@@ -102,11 +102,11 @@ + + it "allow posting" do + res = Rack::MockRequest.new(app).get("", input: "foo") +- env = YAML.load(res.body) ++ env = YAML.unsafe_load(res.body) + env["mock.postdata"].must_equal "foo" + + res = Rack::MockRequest.new(app).post("", input: StringIO.new("foo")) +- env = YAML.load(res.body) ++ env = YAML.unsafe_load(res.body) + env["mock.postdata"].must_equal "foo" + end + +@@ -115,7 +115,7 @@ + get("https://bla.example.org:9292/meh/foo?bar") + res.must_be_kind_of Rack::MockResponse + +- env = YAML.load(res.body) ++ env = YAML.unsafe_load(res.body) + env["REQUEST_METHOD"].must_equal "GET" + env["SERVER_NAME"].must_equal "bla.example.org" + env["SERVER_PORT"].must_equal "9292" +@@ -129,7 +129,7 @@ + get("https://example.org/foo") + res.must_be_kind_of Rack::MockResponse + +- env = YAML.load(res.body) ++ env = YAML.unsafe_load(res.body) + env["REQUEST_METHOD"].must_equal "GET" + env["SERVER_NAME"].must_equal "example.org" + env["SERVER_PORT"].must_equal "443" +@@ -144,7 +144,7 @@ + get("foo") + res.must_be_kind_of Rack::MockResponse + +- env = YAML.load(res.body) ++ env = YAML.unsafe_load(res.body) + env["REQUEST_METHOD"].must_equal "GET" + env["SERVER_NAME"].must_equal "example.org" + env["SERVER_PORT"].must_equal "80" +@@ -155,13 +155,13 @@ + + it "properly convert method name to an uppercase string" do + res = Rack::MockRequest.new(app).request(:get) +- env = YAML.load(res.body) ++ env = YAML.unsafe_load(res.body) + env["REQUEST_METHOD"].must_equal "GET" + end + + it "accept params and build query string for GET requests" do + res = Rack::MockRequest.new(app).get("/foo?baz=2", params: { foo: { bar: "1" } }) +- env = YAML.load(res.body) ++ env = YAML.unsafe_load(res.body) + env["REQUEST_METHOD"].must_equal "GET" + env["QUERY_STRING"].must_include "baz=2" + env["QUERY_STRING"].must_include "foo[bar]=1" +@@ -171,7 +171,7 @@ + + it "accept raw input in params for GET requests" do + res = Rack::MockRequest.new(app).get("/foo?baz=2", params: "foo[bar]=1") +- env = YAML.load(res.body) ++ env = YAML.unsafe_load(res.body) + env["REQUEST_METHOD"].must_equal "GET" + env["QUERY_STRING"].must_include "baz=2" + env["QUERY_STRING"].must_include "foo[bar]=1" +@@ -181,7 +181,7 @@ + + it "accept params and build url encoded params for POST requests" do + res = Rack::MockRequest.new(app).post("/foo", params: { foo: { bar: "1" } }) +- env = YAML.load(res.body) ++ env = YAML.unsafe_load(res.body) + env["REQUEST_METHOD"].must_equal "POST" + env["QUERY_STRING"].must_equal "" + env["PATH_INFO"].must_equal "/foo" +@@ -191,7 +191,7 @@ + + it "accept raw input in params for POST requests" do + res = Rack::MockRequest.new(app).post("/foo", params: "foo[bar]=1") +- env = YAML.load(res.body) ++ env = YAML.unsafe_load(res.body) + env["REQUEST_METHOD"].must_equal "POST" + env["QUERY_STRING"].must_equal "" + env["PATH_INFO"].must_equal "/foo" +@@ -202,7 +202,7 @@ + it "accept params and build multipart encoded params for POST requests" do + files = Rack::Multipart::UploadedFile.new(File.join(File.dirname(__FILE__), "multipart", "file1.txt")) + res = Rack::MockRequest.new(app).post("/foo", params: { "submit-name" => "Larry", "files" => files }) +- env = YAML.load(res.body) ++ env = YAML.unsafe_load(res.body) + env["REQUEST_METHOD"].must_equal "POST" + env["QUERY_STRING"].must_equal "" + env["PATH_INFO"].must_equal "/foo" +diff --git a/test/testrequest.rb b/test/testrequest.rb +index aabe7fa6b..481a4e54d 100644 +--- a/test/testrequest.rb ++++ b/test/testrequest.rb +@@ -42,7 +42,7 @@ def GET(path, header = {}) + http.request(get) { |response| + @status = response.code.to_i + begin +- @response = YAML.load(response.body) ++ @response = YAML.unsafe_load(response.body) + rescue TypeError, ArgumentError + @response = nil + end +@@ -60,7 +60,7 @@ def POST(path, formdata = {}, header = {}) + post.basic_auth user, passwd if user && passwd + http.request(post) { |response| + @status = response.code.to_i +- @response = YAML.load(response.body) ++ @response = YAML.unsafe_load(response.body) + } + } + end