From 1fbc6a46655c3bd88bf0bce49b21a1f676ddf310 Mon Sep 17 00:00:00 2001 From: Jarek Prokop Date: Tue, 13 Jun 2023 09:53:03 +0200 Subject: [PATCH] Fix FTBFS with PostgreSQL 10.6 and above. --- .rubygem-pg.metadata | 1 + ...pg-1.1.3-Fix-specs-for-PostgreSQL-11.patch | 32 +++++++++++++++++++ rubygem-pg.spec | 9 +++++- 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 .rubygem-pg.metadata create mode 100644 rubygem-pg-1.1.3-Fix-specs-for-PostgreSQL-11.patch diff --git a/.rubygem-pg.metadata b/.rubygem-pg.metadata new file mode 100644 index 0000000..c13bac2 --- /dev/null +++ b/.rubygem-pg.metadata @@ -0,0 +1 @@ +ef2bbde400a47744aea9b32948331d0ad318c3d2 pg-1.0.0.gem diff --git a/rubygem-pg-1.1.3-Fix-specs-for-PostgreSQL-11.patch b/rubygem-pg-1.1.3-Fix-specs-for-PostgreSQL-11.patch new file mode 100644 index 0000000..6287947 --- /dev/null +++ b/rubygem-pg-1.1.3-Fix-specs-for-PostgreSQL-11.patch @@ -0,0 +1,32 @@ +# HG changeset patch +# User Lars Kanis +# Date 1545850926 -3600 +# Node ID 74879444e437d42028a636425a4482467a65a711 +# Parent 626befee1debcc59472051e64f9ff067522fc3e1 +Fix specs for PostgreSQL-11 + +PG-11 changed the way how/when parameters are interpret. + +Fixes 287: https://bitbucket.org/ged/ruby-pg/issues/287/pg-connection-server-ping-returns-correct + +diff --git a/spec/pg/connection_spec.rb b/spec/pg/connection_spec.rb +--- a/spec/pg/connection_spec.rb ++++ b/spec/pg/connection_spec.rb +@@ -1099,8 +1099,16 @@ + expect( ping ).to eq( PG::PQPING_NO_RESPONSE ) + end + ++ it "returns error when ping connection arguments are wrong" do ++ ping = described_class.ping('localhost', 'localhost', nil, nil, :test, nil, nil) ++ expect( ping ).to_not eq( PG::PQPING_OK ) ++ end ++ + it "returns correct response when ping connection arguments are wrong" do +- ping = described_class.ping('localhost', 'localhost', nil, nil, :test, nil, nil) ++ ping = described_class.ping( ++ :host => 'localhost', ++ :invalid_option => 9999, ++ :dbname => :test) + expect( ping ).to eq( PG::PQPING_NO_ATTEMPT ) + end + diff --git a/rubygem-pg.spec b/rubygem-pg.spec index 2d8c3af..0b6d9ba 100644 --- a/rubygem-pg.spec +++ b/rubygem-pg.spec @@ -3,7 +3,7 @@ Name: rubygem-%{gem_name} Version: 1.0.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A Ruby interface to the PostgreSQL RDBMS # Upstream license clarification (https://bitbucket.org/ged/ruby-pg/issue/72/) # @@ -19,6 +19,9 @@ Patch0: rubygem-pg-0.17.1-remove-rpath.patch # Add feature to set testing port. # https://github.com/ged/ruby-pg/commit/104ec67 Patch1: rubygem-pg-1.1.4-add-feature-to-set-testing-port.patch +# Fix compatibility with PG 10.6 and above. +# https://github.com/ged/ruby-pg/issues/287 +Patch2: rubygem-pg-1.1.3-Fix-specs-for-PostgreSQL-11.patch BuildRequires: ruby(release) BuildRequires: rubygems-devel BuildRequires: ruby-devel @@ -47,6 +50,7 @@ Documentation for %{name}. %patch0 -p1 %patch1 -p1 +%patch2 -p1 %build # Create the gem as gem install only works on a gem file @@ -121,6 +125,9 @@ popd %{gem_instdir}/spec %changelog +* Tue Jun 13 2023 Jarek Prokop - 1.0.0-3 +- Fix FTBFS with PostgreSQL 10.6 and above. + * Thu May 23 2019 Jun Aruga - 1.0.0-2 - Assign a random testing port.