aboutsummaryrefslogtreecommitdiff
path: root/databases/rubygem-dbd-pg
diff options
context:
space:
mode:
authorDirk Meyer <dinoex@FreeBSD.org>2018-03-17 06:09:25 +0000
committerDirk Meyer <dinoex@FreeBSD.org>2018-03-17 06:09:25 +0000
commitbb4d26ca0e1683a9f85175c356bcc7900ccfb103 (patch)
treeb7f0e4bcd1799f16e4dd9e3d86e6673960b9216d /databases/rubygem-dbd-pg
parent83b38c21aa7f5acd826665157100c8dadc8476d8 (diff)
downloadports-bb4d26ca0e1683a9f85175c356bcc7900ccfb103.tar.gz
ports-bb4d26ca0e1683a9f85175c356bcc7900ccfb103.zip
- fix API for pg-1.0.0
Notes
Notes: svn path=/head/; revision=464757
Diffstat (limited to 'databases/rubygem-dbd-pg')
-rw-r--r--databases/rubygem-dbd-pg/Makefile1
-rw-r--r--databases/rubygem-dbd-pg/files/patch-database.rb74
-rw-r--r--databases/rubygem-dbd-pg/files/patch-statement.rb20
3 files changed, 95 insertions, 0 deletions
diff --git a/databases/rubygem-dbd-pg/Makefile b/databases/rubygem-dbd-pg/Makefile
index cf1ae1900bff..19605c4f3ff3 100644
--- a/databases/rubygem-dbd-pg/Makefile
+++ b/databases/rubygem-dbd-pg/Makefile
@@ -2,6 +2,7 @@
PORTNAME= dbd-pg
PORTVERSION= 0.3.9
+PORTREVISION= 1
CATEGORIES= databases rubygems
MASTER_SITES= RG
diff --git a/databases/rubygem-dbd-pg/files/patch-database.rb b/databases/rubygem-dbd-pg/files/patch-database.rb
new file mode 100644
index 000000000000..00ff711b0d55
--- /dev/null
+++ b/databases/rubygem-dbd-pg/files/patch-database.rb
@@ -0,0 +1,74 @@
+--- lib/dbd/pg/database.rb.orig 2018-03-17 05:55:55 UTC
++++ lib/dbd/pg/database.rb
+@@ -48,7 +48,7 @@ class DBI::DBD::Pg::Database < DBI::Base
+ hash['tty'] ||= ''
+ hash['port'] = hash['port'].to_i unless hash['port'].nil?
+
+- @connection = PGconn.new(hash['host'], hash['port'], hash['options'], hash['tty'],
++ @connection = PG::Connection.new(hash['host'], hash['port'], hash['options'], hash['tty'],
+ hash['dbname'] || hash['database'], user, auth)
+
+ @exec_method = :exec
+@@ -78,7 +78,7 @@ class DBI::DBD::Pg::Database < DBI::Base
+
+ self['AutoCommit'] = true # Postgres starts in unchained mode (AutoCommit=on) by default
+
+- rescue PGError => err
++ rescue PG::Error => err
+ raise DBI::OperationalError.new(err.message)
+ end
+
+@@ -443,7 +443,7 @@ class DBI::DBD::Pg::Database < DBI::Base
+ #
+ # Create a BLOB.
+ #
+- def __blob_create(mode=PGconn::INV_READ)
++ def __blob_create(mode=PG::Connection::INV_READ)
+ start_transaction unless @in_transaction
+ @connection.lo_creat(mode)
+ rescue PGError => err
+@@ -453,7 +453,7 @@ class DBI::DBD::Pg::Database < DBI::Base
+ #
+ # Open a BLOB.
+ #
+- def __blob_open(oid, mode=PGconn::INV_READ)
++ def __blob_open(oid, mode=PG::Connection::INV_READ)
+ start_transaction unless @in_transaction
+ @connection.lo_open(oid.to_i, mode)
+ rescue PGError => err
+@@ -474,7 +474,7 @@ class DBI::DBD::Pg::Database < DBI::Base
+ # Read a BLOB and return the data.
+ #
+ def __blob_read(oid, length)
+- blob = @connection.lo_open(oid.to_i, PGconn::INV_READ)
++ blob = @connection.lo_open(oid.to_i, PG::Connection::INV_READ)
+
+ if length.nil?
+ data = @connection.lo_read(blob)
+@@ -485,7 +485,7 @@ class DBI::DBD::Pg::Database < DBI::Base
+ # FIXME it doesn't like to close here either.
+ # @connection.lo_close(blob)
+ data
+- rescue PGError => err
++ rescue PG::Error => err
+ raise DBI::DatabaseError.new(err.message)
+ end
+
+@@ -494,7 +494,7 @@ class DBI::DBD::Pg::Database < DBI::Base
+ #
+ def __blob_write(oid, value)
+ start_transaction unless @in_transaction
+- blob = @connection.lo_open(oid.to_i, PGconn::INV_WRITE)
++ blob = @connection.lo_open(oid.to_i, PG::Connection::INV_WRITE)
+ res = @connection.lo_write(blob, value)
+ # FIXME not sure why PG doesn't like to close here -- seems to be
+ # working but we should make sure it's not eating file descriptors
+@@ -510,7 +510,7 @@ class DBI::DBD::Pg::Database < DBI::Base
+ #
+ def __set_notice_processor(proc)
+ @connection.set_notice_processor proc
+- rescue PGError => err
++ rescue PG::Error => err
+ raise DBI::DatabaseError.new(err.message)
+ end
+ end # Database
diff --git a/databases/rubygem-dbd-pg/files/patch-statement.rb b/databases/rubygem-dbd-pg/files/patch-statement.rb
new file mode 100644
index 000000000000..4f8f3915f97b
--- /dev/null
+++ b/databases/rubygem-dbd-pg/files/patch-statement.rb
@@ -0,0 +1,20 @@
+--- lib/dbd/pg/statement.rb.orig 2018-03-17 05:55:55 UTC
++++ lib/dbd/pg/statement.rb
+@@ -18,7 +18,7 @@ class DBI::DBD::Pg::Statement < DBI::Bas
+ @result = nil
+ @bindvars = []
+ @prepared = false
+- rescue PGError => err
++ rescue PG::Error => err
+ raise DBI::ProgrammingError.new(err.message)
+ end
+
+@@ -58,7 +58,7 @@ class DBI::DBD::Pg::Statement < DBI::Bas
+ end
+
+ @result = DBI::DBD::Pg::Tuples.new(@db, pg_result)
+- rescue PGError, RuntimeError => err
++ rescue PG::Error, RuntimeError => err
+ raise DBI::ProgrammingError.new(err.message)
+ end
+