From be5aaac754eabf8413ac813784e03fefc89bc36a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Tue, 13 Feb 2018 12:31:35 +0100 Subject: [PATCH] Update to pg 1.0.0. --- .gitignore | 1 + rubygem-pg-0.17.1-remove-rpath.patch | 2 +- ....21.0-adjust-tests-for-postgresql-10.patch | 57 ------------------- rubygem-pg.spec | 31 ++++------ sources | 2 +- 5 files changed, 15 insertions(+), 78 deletions(-) delete mode 100644 rubygem-pg-0.21.0-adjust-tests-for-postgresql-10.patch diff --git a/.gitignore b/.gitignore index 8f5a03d..4dd97a6 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /pg-0.18.4.gem /pg-0.20.0.gem /pg-0.21.0.gem +/pg-1.0.0.gem diff --git a/rubygem-pg-0.17.1-remove-rpath.patch b/rubygem-pg-0.17.1-remove-rpath.patch index b52e604..d947016 100644 --- a/rubygem-pg-0.17.1-remove-rpath.patch +++ b/rubygem-pg-0.17.1-remove-rpath.patch @@ -1,7 +1,7 @@ diff --git a/ext/extconf.rb b/ext/extconf.rb --- a/ext/extconf.rb +++ b/ext/extconf.rb -@@ -29,13 +29,6 @@ +@@ -33,13 +33,6 @@ incdir = `"#{pgconfig}" --includedir`.chomp libdir = `"#{pgconfig}" --libdir`.chomp dir_config 'pg', incdir, libdir diff --git a/rubygem-pg-0.21.0-adjust-tests-for-postgresql-10.patch b/rubygem-pg-0.21.0-adjust-tests-for-postgresql-10.patch deleted file mode 100644 index d9f488d..0000000 --- a/rubygem-pg-0.21.0-adjust-tests-for-postgresql-10.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 55ca6dd8c1e0925f617b8f9e9042cbea01cf0eb8 Mon Sep 17 00:00:00 2001 -From: Lars Kanis -Date: Mon, 23 Oct 2017 13:02:45 +0200 -Subject: [PATCH] Adjust tests for PostgreSQL-10 - ---- - spec/helpers.rb | 2 +- - spec/pg/connection_spec.rb | 13 +++++++++---- - 2 files changed, 10 insertions(+), 5 deletions(-) - -diff --git a/spec/helpers.rb b/spec/helpers.rb -index d13df5e..e9856de 100755 ---- a/spec/helpers.rb -+++ b/spec/helpers.rb -@@ -251,7 +251,7 @@ module PG::TestingHelpers - - def check_for_lingering_connections( conn ) - conn.exec( "SELECT * FROM pg_stat_activity" ) do |res| -- conns = res.find_all {|row| row['pid'].to_i != conn.backend_pid } -+ conns = res.find_all {|row| row['pid'].to_i != conn.backend_pid && ["client backend", nil].include?(row["backend_type"]) } - unless conns.empty? - puts "Lingering connections remain:" - conns.each do |row| -diff --git a/spec/pg/connection_spec.rb b/spec/pg/connection_spec.rb -index d055673..0924ca4 100755 ---- a/spec/pg/connection_spec.rb -+++ b/spec/pg/connection_spec.rb -@@ -219,7 +219,7 @@ describe PG::Connection do - described_class.connect(@conninfo).finish - sleep 0.5 - res = @conn.exec(%[SELECT COUNT(*) AS n FROM pg_stat_activity -- WHERE usename IS NOT NULL]) -+ WHERE usename IS NOT NULL AND application_name != '']) - # there's still the global @conn, but should be no more - expect( res[0]['n'] ).to eq( '1' ) - end -@@ -1524,9 +1524,14 @@ describe PG::Connection do - end - - it "shouldn't type map params unless requested" do -- expect{ -- @conn.exec_params( "SELECT $1", [5] ) -- }.to raise_error(PG::IndeterminateDatatype) -+ if @conn.server_version < 100000 -+ expect{ -+ @conn.exec_params( "SELECT $1", [5] ) -+ }.to raise_error(PG::IndeterminateDatatype) -+ else -+ # PostgreSQL-10 maps to TEXT type (OID 25) -+ expect( @conn.exec_params( "SELECT $1", [5] ).ftype(0)).to eq(25) -+ end - end - - it "should raise an error on invalid encoder to put_copy_data" do --- -2.14.3 - diff --git a/rubygem-pg.spec b/rubygem-pg.spec index 53cda2a..bdd3fd3 100644 --- a/rubygem-pg.spec +++ b/rubygem-pg.spec @@ -2,8 +2,8 @@ %global gem_name pg Name: rubygem-%{gem_name} -Version: 0.21.0 -Release: 5%{?dist} +Version: 1.0.0 +Release: 1%{?dist} Summary: A Ruby interface to the PostgreSQL RDBMS # Upstream license clarification (https://bitbucket.org/ged/ruby-pg/issue/72/) # @@ -16,9 +16,6 @@ Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem # Disable RPATH. # https://bitbucket.org/ged/ruby-pg/issue/183 Patch0: rubygem-pg-0.17.1-remove-rpath.patch -# Fix tests for PostgreSQL-10. -# https://github.com/ged/ruby-pg/commit/fe24a71 -Patch1: rubygem-pg-0.21.0-adjust-tests-for-postgresql-10.patch BuildRequires: ruby(release) BuildRequires: rubygems-devel BuildRequires: ruby-devel @@ -43,17 +40,13 @@ BuildArch: noarch Documentation for %{name}. %prep -gem unpack %{SOURCE0} - -%setup -q -D -T -n %{gem_name}-%{version} - -gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec +%setup -q -n %{gem_name}-%{version} %patch0 -p1 %build # Create the gem as gem install only works on a gem file -gem build %{gem_name}.gemspec +gem build ../%{gem_name}-%{version}.gemspec # %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir # by default, so that we can move it into the buildroot in %%install @@ -91,12 +84,9 @@ done %check pushd .%{gem_instdir} -cat "%{PATCH1}" | patch -p1 -# Set LANG to prevent encoding warnings. See spec/pg/connection_spec.rb -# test case: "receives properly encoded messages in the notice callbacks". # Set --verbose to show detail log by $VERBOSE. # See https://github.com/ged/ruby-pg/blob/master/spec/helpers.rb $VERBOSE -LANG=en_US.UTF-8 ruby -S --verbose \ +ruby -S --verbose \ rspec -I$(dirs +1)%{gem_extdir_mri} -f d spec popd @@ -125,6 +115,9 @@ popd %{gem_instdir}/spec %changelog +* Tue Feb 13 2018 Vít Ondruch - 1.0.0-1 +- Update to pg 1.0.0. + * Fri Feb 09 2018 Fedora Release Engineering - 0.21.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild @@ -138,7 +131,7 @@ popd - Fix failed tests for PostgreSQL-10. * Thu Aug 17 2017 Vít Ondruch - 0.21.0-1 -- Update to pg 1.21.0. +- Update to pg 0.21.0. * Thu Aug 03 2017 Fedora Release Engineering - 0.20.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild @@ -147,7 +140,7 @@ popd - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Mon May 29 2017 Vít Ondruch - 0.20.0-1 -- Update to pg 1.20.0. +- Update to pg 0.20.0. * Sat Feb 11 2017 Fedora Release Engineering - 0.18.4-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild @@ -161,10 +154,10 @@ popd * Wed Jan 06 2016 Vít Ondruch - 0.18.4-1 - Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.3 -- Update to pg 1.18.4. +- Update to pg 0.18.4. * Wed Aug 26 2015 Vít Ondruch - 0.18.2-1 -- Update to pg 1.18.2. +- Update to pg 0.18.2. * Thu Jun 18 2015 Fedora Release Engineering - 0.18.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild diff --git a/sources b/sources index 5ef6319..ac7b776 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pg-0.21.0.gem) = 590a8c34487d2cf030082cfff87b2cc83b636df06a931e394acfb098ecb5728e793d777f125b036ee9953bbd21ec5facf91c932930acccb507d3394f2fc4cc5b +SHA512 (pg-1.0.0.gem) = 1cac025ab8a95b4429534b98377eedeb1e3f8b2c4a859363c4174d477577caf39557b002cde4e745189fa9a29e9181ff9d564d822f15ff5c4f03f7389b0d0398