commit:     33664e632a1b3f22a7374bf8e6c24e6a5e390a66
Author:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
AuthorDate: Sun May  4 06:42:09 2025 +0000
Commit:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
CommitDate: Sun May  4 06:59:41 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=33664e63

dev-ruby/pg: enable ruby34

Signed-off-by: Hans de Graaff <graaff <AT> gentoo.org>

 dev-ruby/pg/files/pg-1.5.9-test-encoding.patch | 31 ++++++++++++++++++++++++++
 dev-ruby/pg/pg-1.5.9.ebuild                    |  6 +++--
 2 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/dev-ruby/pg/files/pg-1.5.9-test-encoding.patch 
b/dev-ruby/pg/files/pg-1.5.9-test-encoding.patch
new file mode 100644
index 000000000000..9d13eabeb2a2
--- /dev/null
+++ b/dev-ruby/pg/files/pg-1.5.9-test-encoding.patch
@@ -0,0 +1,31 @@
+From dd138ecf313274cc6a5481071bf301dc8c5139d8 Mon Sep 17 00:00:00 2001
+From: Lars Kanis <[email protected]>
+Date: Fri, 28 Feb 2025 10:39:07 +0100
+Subject: [PATCH] =?UTF-8?q?Use=20a=20connection=20encoding=20compatible=20?=
+ =?UTF-8?q?to=20"M=C3=B6hre"?=
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The function PQescapeString was changed in PostgreSQL 17.4, 16.8, 15.12, 
14.17, and 13.20.
+It now returns a predefined invalid character as a replacement in the 
connection encoding, if the input text is not valid according to the current 
connection encoding.
+Using a compatible connection encoding avoids this, so that we get the 
original text out of the singleton escape function.
+
+Fixes #628
+---
+ spec/pg/connection_spec.rb | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/spec/pg/connection_spec.rb b/spec/pg/connection_spec.rb
+index 63d3585ad..b64604467 100644
+--- a/spec/pg/connection_spec.rb
++++ b/spec/pg/connection_spec.rb
+@@ -2325,7 +2325,7 @@ def wait_check_socket(conn)
+ 
+                       it "uses the previous string encoding for escaped 
string" do
+                               original = "Möhre to 'scape".encode( 
"iso-8859-1" )
+-                              @conn.set_client_encoding( "euc_jp" )
++                              @conn.set_client_encoding( "iso-8859-2" )
+                               escaped  = described_class.escape( original )
+                               expect( escaped.encoding ).to eq( 
Encoding::ISO8859_1 )
+                               expect( escaped ).to eq( "Möhre to 
''scape".encode(Encoding::ISO8859_1) )

diff --git a/dev-ruby/pg/pg-1.5.9.ebuild b/dev-ruby/pg/pg-1.5.9.ebuild
index d9f63c712110..101563d5e6b1 100644
--- a/dev-ruby/pg/pg-1.5.9.ebuild
+++ b/dev-ruby/pg/pg-1.5.9.ebuild
@@ -1,8 +1,8 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
-USE_RUBY="ruby31 ruby32 ruby33"
+USE_RUBY="ruby31 ruby32 ruby33 ruby34"
 
 RUBY_FAKEGEM_GEMSPEC="pg.gemspec"
 RUBY_FAKEGEM_RECIPE_TEST="rspec3"
@@ -27,6 +27,8 @@ RDEPEND="dev-db/postgresql:*"
 DEPEND="dev-db/postgresql
        test? ( >=dev-db/postgresql-9.4[server(+),threads(+)] )"
 
+PATCHES=( "${FILESDIR}/${P}-test-encoding.patch" )
+
 all_ruby_prepare() {
        # hack the Rakefile to make it sure that it doesn't load
        # rake-compiler (so that we don't have to depend on it and it

Reply via email to