[DRE-commits] [ruby-mysql2] 03/06: Refresh patches
Antonio Terceiro
terceiro at moszumanska.debian.org
Tue Jul 21 01:28:21 UTC 2015
This is an automated email from the git hooks/post-receive script.
terceiro pushed a commit to branch master
in repository ruby-mysql2.
commit 50b239a35a49e7e95913a3a8a2d29f262e48a9a6
Author: Antonio Terceiro <terceiro at debian.org>
Date: Mon Jul 20 21:43:34 2015 -0300
Refresh patches
---
debian/changelog | 3 ++
debian/patches/avoid_openssl_loop.patch | 49 ------------------
debian/patches/cleanup_fork.patch | 6 +--
debian/patches/correct_mysql_init.patch | 38 --------------
debian/patches/remove_rpath_compilation_flag.patch | 60 +++++++++++-----------
debian/patches/series | 2 -
6 files changed, 36 insertions(+), 122 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 15387ab..3694b82 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,9 @@ ruby-mysql2 (0.3.18-1) UNRELEASED; urgency=medium
* Team upload
* New upstream release
+ * Refresh patches
+ - avoid_openssl_loop.patch dropped, applied upstream
+ - correct_mysql_init.patch dropped, applied upstream
-- Antonio Terceiro <terceiro at debian.org> Mon, 20 Jul 2015 21:31:34 -0300
diff --git a/debian/patches/avoid_openssl_loop.patch b/debian/patches/avoid_openssl_loop.patch
deleted file mode 100644
index ed72d67..0000000
--- a/debian/patches/avoid_openssl_loop.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-Description: Use /dev/null in invalidate_fd to avoid infinite loop in OpenSSL
- Thanks to Andy Bakun / @thwarted for identifying the issue and
- suggesting the /dev/null workaround.
-Author: Aaron Stone <aaron at serendipity.cx>
-Origin: upstream,https://github.com/brianmario/mysql2/commit/fc30a7c056e63517f5f66702016941b3902ec0b6.patch
-Reviewed-by: Cédric Boutillier <boutil at debian.org>
-Last-Update: 2014-08-24
-
---- a/ext/mysql2/client.c
-+++ b/ext/mysql2/client.c
-@@ -167,26 +167,30 @@
-
- #ifndef _WIN32
- /*
-- * Redirect clientfd to a dummy socket for mysql_close to
-- * write, shutdown, and close on as a no-op.
-- * We do this hack because we want to call mysql_close to release
-- * memory, but do not want mysql_close to drop connections in the
-- * parent if the socket got shared in fork.
-+ * Redirect clientfd to /dev/null for mysql_close and SSL_close to write,
-+ * shutdown, and close. The hack is needed to prevent shutdown() from breaking
-+ * a socket that may be in use by the parent or other processes after fork.
-+ *
-+ * /dev/null is used to absorb writes; previously a dummy socket was used, but
-+ * it could not abosrb writes and caused openssl to go into an infinite loop.
-+ *
- * Returns Qtrue or Qfalse (success or failure)
-+ *
-+ * Note: if this function is needed on Windows, use "nul" instead of "/dev/null"
- */
- static VALUE invalidate_fd(int clientfd)
- {
- #ifdef SOCK_CLOEXEC
- /* Atomically set CLOEXEC on the new FD in case another thread forks */
-- int sockfd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
-+ int sockfd = open("/dev/null", O_RDWR | O_CLOEXEC);
- if (sockfd < 0) {
- /* Maybe SOCK_CLOEXEC is defined but not available on this kernel */
-- int sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
-+ int sockfd = open("/dev/null", O_RDWR);
- fcntl(sockfd, F_SETFD, FD_CLOEXEC);
- }
- #else
- /* Well we don't have SOCK_CLOEXEC, so just set FD_CLOEXEC quickly */
-- int sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
-+ int sockfd = open("/dev/null", O_RDWR);
- fcntl(sockfd, F_SETFD, FD_CLOEXEC);
- #endif
-
diff --git a/debian/patches/cleanup_fork.patch b/debian/patches/cleanup_fork.patch
index 1132e51..87261ad 100644
--- a/debian/patches/cleanup_fork.patch
+++ b/debian/patches/cleanup_fork.patch
@@ -4,11 +4,9 @@ Origin: vendor
Forwarded: yes
Bug: https://github.com/brianmario/mysql2/issues/611
-diff --git a/spec/mysql2/client_spec.rb b/spec/mysql2/client_spec.rb
-index 533f239..97d1974 100644
--- a/spec/mysql2/client_spec.rb
+++ b/spec/mysql2/client_spec.rb
-@@ -412,6 +412,7 @@ describe Mysql2::Client do
+@@ -426,6 +426,7 @@ describe Mysql2::Client do
it "should run signal handlers while waiting for a response" do
mark = {}
trap(:USR1) { mark[:USR1] = Time.now }
@@ -16,7 +14,7 @@ index 533f239..97d1974 100644
begin
mark[:START] = Time.now
pid = fork do
-@@ -427,10 +428,12 @@ describe Mysql2::Client do
+@@ -441,10 +442,12 @@ describe Mysql2::Client do
(mark[:END] - mark[:USR1]).should > 0.9
(mark[:END] - mark[:START]).should >= 2
(mark[:END] - mark[:START]).should < 2.3
diff --git a/debian/patches/correct_mysql_init.patch b/debian/patches/correct_mysql_init.patch
deleted file mode 100644
index fba113d..0000000
--- a/debian/patches/correct_mysql_init.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-Description: Added call to mysql_library_init during initialization of the gem
- This call must be performed before trying to call mysql_init from
- multiple threads
- Reference: http://dev.mysql.com/doc/refman/5.1/en/mysql-init.html
- Minimal reproduction of the problem if mysql_library_init is not called
-
- require 'mysql2'
-
- def connect
- Mysql2::Client.new()
- end
-
- threads = [0,1].map {
- Thread.new { connect }
- }
- threads.map(&:join)
- puts "OK!"
-Author: Michael Kruglos <michael at kruglos.com>
-Reviewed-by: Cédric Boutillier <boutil at debian.org>
-Origin: upstream,https://github.com/brianmario/mysql2/commit/de48627ee89b9dfd7d966f3ea747e95a48085792.patch
-Last-Update: 2014-07-30
-
---- a/ext/mysql2/client.c
-+++ b/ext/mysql2/client.c
-@@ -1237,6 +1237,13 @@
- }
- }
-
-+ /* Initializing mysql library, so different threads could call Client.new */
-+ /* without race condition in the library */
-+ if (mysql_library_init(0, NULL, NULL) != 0) {
-+ rb_raise(rb_eRuntimeError, "Could not initialize MySQL client library");
-+ return;
-+ }
-+
- #if 0
- mMysql2 = rb_define_module("Mysql2"); Teach RDoc about Mysql2 constant.
- #endif
diff --git a/debian/patches/remove_rpath_compilation_flag.patch b/debian/patches/remove_rpath_compilation_flag.patch
index a29036c..cec1b5f 100644
--- a/debian/patches/remove_rpath_compilation_flag.patch
+++ b/debian/patches/remove_rpath_compilation_flag.patch
@@ -7,37 +7,39 @@ Last-Update: 2013-11-26
--- a/ext/mysql2/extconf.rb
+++ b/ext/mysql2/extconf.rb
-@@ -98,33 +98,4 @@
- $CFLAGS << gcc_flags
- end
-
--case explicit_rpath = with_config('mysql-rpath')
--when true
-- abort "-----\nOption --with-mysql-rpath must have an argument\n-----"
--when false
-- warn "-----\nOption --with-mysql-rpath has been disabled at your request\n-----"
--when String
-- # The user gave us a value so use it
-- rpath_flags = " -Wl,-rpath,#{explicit_rpath}"
-- warn "-----\nSetting mysql rpath to #{explicit_rpath}\n-----"
-- $LDFLAGS << rpath_flags
+@@ -143,35 +143,6 @@ if RUBY_PLATFORM =~ /mswin|mingw/
+ # Let's do it!
+ Rake::Task[vendordll].invoke
+ end
-else
-- if libdir = rpath_dir[%r{(-L)?(/[^ ]+)}, 2]
-- rpath_flags = " -Wl,-rpath,#{libdir}"
-- if RbConfig::CONFIG["RPATHFLAG"].to_s.empty? && try_link('int main() {return 0;}', rpath_flags)
-- # Usually Ruby sets RPATHFLAG the right way for each system, but not on OS X.
-- warn "-----\nSetting rpath to #{libdir}\n-----"
-- $LDFLAGS << rpath_flags
-- else
-- if RbConfig::CONFIG["RPATHFLAG"].to_s.empty?
-- # If we got here because try_link failed, warn the user
-- warn "-----\nDon't know how to set rpath on your system, if MySQL libraries are not in path mysql2 may not load\n-----"
+- case explicit_rpath = with_config('mysql-rpath')
+- when true
+- abort "-----\nOption --with-mysql-rpath must have an argument\n-----"
+- when false
+- warn "-----\nOption --with-mysql-rpath has been disabled at your request\n-----"
+- when String
+- # The user gave us a value so use it
+- rpath_flags = " -Wl,-rpath,#{explicit_rpath}"
+- warn "-----\nSetting mysql rpath to #{explicit_rpath}\n-----"
+- $LDFLAGS << rpath_flags
+- else
+- if libdir = rpath_dir[%r{(-L)?(/[^ ]+)}, 2]
+- rpath_flags = " -Wl,-rpath,#{libdir}"
+- if RbConfig::CONFIG["RPATHFLAG"].to_s.empty? && try_link('int main() {return 0;}', rpath_flags)
+- # Usually Ruby sets RPATHFLAG the right way for each system, but not on OS X.
+- warn "-----\nSetting rpath to #{libdir}\n-----"
+- $LDFLAGS << rpath_flags
+- else
+- if RbConfig::CONFIG["RPATHFLAG"].to_s.empty?
+- # If we got here because try_link failed, warn the user
+- warn "-----\nDon't know how to set rpath on your system, if MySQL libraries are not in path mysql2 may not load\n-----"
+- end
+- # Make sure that LIBPATH gets set if we didn't explicitly set the rpath.
+- warn "-----\nSetting libpath to #{libdir}\n-----"
+- $LIBPATH << libdir unless $LIBPATH.include?(libdir)
- end
-- # Make sure that LIBPATH gets set if we didn't explicitly set the rpath.
-- warn "-----\nSetting libpath to #{libdir}\n-----"
-- $LIBPATH << libdir unless $LIBPATH.include?(libdir)
- end
- end
--end
--
+ end
+
create_makefile('mysql2/mysql2')
diff --git a/debian/patches/series b/debian/patches/series
index b80aeef..6f274c8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,6 +1,4 @@
remove_rpath_compilation_flag.patch
remove_rubygems_from_examples.patch
#deactivate_failing_specs.patch
-avoid_openssl_loop.patch
-correct_mysql_init.patch
cleanup_fork.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-mysql2.git
More information about the Pkg-ruby-extras-commits
mailing list