Date: Sun, 15 Apr 2018 06:41:42 +0000 (UTC) From: Dirk Meyer <dinoex@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r467367 - in head/databases/rubygem-dbd-pg: . files Message-ID: <201804150641.w3F6fgL3081914@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dinoex Date: Sun Apr 15 06:41:42 2018 New Revision: 467367 URL: https://svnweb.freebsd.org/changeset/ports/467367 Log: - fix API for pg-1.0.0 Added: head/databases/rubygem-dbd-pg/files/patch-type.rb (contents, props changed) Modified: head/databases/rubygem-dbd-pg/Makefile head/databases/rubygem-dbd-pg/files/patch-database.rb head/databases/rubygem-dbd-pg/files/patch-statement.rb Modified: head/databases/rubygem-dbd-pg/Makefile ============================================================================== --- head/databases/rubygem-dbd-pg/Makefile Sun Apr 15 05:35:42 2018 (r467366) +++ head/databases/rubygem-dbd-pg/Makefile Sun Apr 15 06:41:42 2018 (r467367) @@ -2,7 +2,7 @@ PORTNAME= dbd-pg PORTVERSION= 0.3.9 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= databases rubygems MASTER_SITES= RG Modified: head/databases/rubygem-dbd-pg/files/patch-database.rb ============================================================================== --- head/databases/rubygem-dbd-pg/files/patch-database.rb Sun Apr 15 05:35:42 2018 (r467366) +++ head/databases/rubygem-dbd-pg/files/patch-database.rb Sun Apr 15 06:41:42 2018 (r467367) @@ -1,4 +1,4 @@ ---- lib/dbd/pg/database.rb.orig 2018-03-17 05:55:55 UTC +--- lib/dbd/pg/database.rb.orig 2018-04-15 06:18:20 UTC +++ lib/dbd/pg/database.rb @@ -48,7 +48,7 @@ class DBI::DBD::Pg::Database < DBI::Base hash['tty'] ||= '' @@ -18,7 +18,33 @@ raise DBI::OperationalError.new(err.message) end -@@ -443,7 +443,7 @@ class DBI::DBD::Pg::Database < DBI::Base +@@ -96,7 +96,7 @@ class DBI::DBD::Pg::Database < DBI::Base + else + return false + end +- rescue PGError ++ rescue PG::Error + return false + ensure + answer.clear if answer +@@ -426,7 +426,7 @@ class DBI::DBD::Pg::Database < DBI::Base + def __blob_import(file) + start_transaction unless @in_transaction + @connection.lo_import(file) +- rescue PGError => err ++ rescue PG::Error => err + raise DBI::DatabaseError.new(err.message) + end + +@@ -436,27 +436,27 @@ class DBI::DBD::Pg::Database < DBI::Base + def __blob_export(oid, file) + start_transaction unless @in_transaction + @connection.lo_export(oid.to_i, file) +- rescue PGError => err ++ rescue PG::Error => err + raise DBI::DatabaseError.new(err.message) + end + # # Create a BLOB. # @@ -26,8 +52,11 @@ + 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 +- rescue PGError => err ++ rescue PG::Error => err + raise DBI::DatabaseError.new(err.message) + end + # # Open a BLOB. # @@ -35,7 +64,20 @@ + def __blob_open(oid, mode=PG::Connection::INV_READ) start_transaction unless @in_transaction @connection.lo_open(oid.to_i, mode) - rescue PGError => err +- rescue PGError => err ++ rescue PG::Error => err + raise DBI::DatabaseError.new(err.message) + end + +@@ -466,7 +466,7 @@ class DBI::DBD::Pg::Database < DBI::Base + def __blob_unlink(oid) + start_transaction unless @in_transaction + @connection.lo_unlink(oid.to_i) +- rescue PGError => err ++ rescue PG::Error => err + raise DBI::DatabaseError.new(err.message) + end + @@ -474,7 +474,7 @@ class DBI::DBD::Pg::Database < DBI::Base # Read a BLOB and return the data. # @@ -54,7 +96,7 @@ raise DBI::DatabaseError.new(err.message) end -@@ -494,7 +494,7 @@ class DBI::DBD::Pg::Database < DBI::Base +@@ -494,14 +494,14 @@ class DBI::DBD::Pg::Database < DBI::Base # def __blob_write(oid, value) start_transaction unless @in_transaction @@ -63,6 +105,14 @@ 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 + # up before release. + # @connection.lo_close(blob) + return res +- rescue PGError => err ++ rescue PG::Error => err + raise DBI::DatabaseError.new(err.message) + end + @@ -510,7 +510,7 @@ class DBI::DBD::Pg::Database < DBI::Base # def __set_notice_processor(proc) Modified: head/databases/rubygem-dbd-pg/files/patch-statement.rb ============================================================================== --- head/databases/rubygem-dbd-pg/files/patch-statement.rb Sun Apr 15 05:35:42 2018 (r467366) +++ head/databases/rubygem-dbd-pg/files/patch-statement.rb Sun Apr 15 06:41:42 2018 (r467367) @@ -1,4 +1,4 @@ ---- lib/dbd/pg/statement.rb.orig 2018-03-17 05:55:55 UTC +--- lib/dbd/pg/statement.rb.orig 2018-04-15 06:18:20 UTC +++ lib/dbd/pg/statement.rb @@ -18,7 +18,7 @@ class DBI::DBD::Pg::Statement < DBI::Bas @result = nil @@ -9,6 +9,15 @@ raise DBI::ProgrammingError.new(err.message) end +@@ -36,7 +36,7 @@ class DBI::DBD::Pg::Statement < DBI::Bas + # replace DBI::Binary object by oid returned by lo_import + @bindvars.collect! do |var| + if var.is_a? DBI::Binary then +- oid = @db.__blob_create(PGconn::INV_WRITE) ++ oid = @db.__blob_create(PG::Connection::INV_WRITE) + @db.__blob_write(oid, var.to_s) + oid + else @@ -58,7 +58,7 @@ class DBI::DBD::Pg::Statement < DBI::Bas end Added: head/databases/rubygem-dbd-pg/files/patch-type.rb ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/databases/rubygem-dbd-pg/files/patch-type.rb Sun Apr 15 06:41:42 2018 (r467367) @@ -0,0 +1,20 @@ +--- lib/dbd/pg/type.rb.orig 2018-04-15 06:18:20 UTC ++++ lib/dbd/pg/type.rb +@@ -32,7 +32,7 @@ module DBI::DBD::Pg::Type + # Escapes the supplied data. Has no effect on the object. + # + def escape_bytea(str) +- PGconn.escape_bytea(str) ++ PG::Connection.escape_bytea(str) + end + + # +@@ -62,7 +62,7 @@ module DBI::DBD::Pg::Type + # + # Fix this for now, but beware that we'll have to unfix this as + # soon as they fix their end. +- ret = PGconn.unescape_bytea(obj) ++ ret = PG::Connection.unescape_bytea(obj) + + # XXX + # String#split does not properly create a full array if the the
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804150641.w3F6fgL3081914>