[packages/ruby-redis] move localhost -> ipv4 change to a patch

glen glen at pld-linux.org
Thu Jun 16 19:46:17 CEST 2016


commit 672ecc69ecd3336da71be473e356c9548f34193c
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Thu Jun 16 20:45:57 2016 +0300

    move localhost -> ipv4 change to a patch

 ruby-redis.spec       | 12 ++++--------
 tests-localhost.patch | 31 +++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 8 deletions(-)
---
diff --git a/ruby-redis.spec b/ruby-redis.spec
index 249ce11..fa94b3c 100644
--- a/ruby-redis.spec
+++ b/ruby-redis.spec
@@ -12,7 +12,8 @@ Group:		Development/Languages
 Source0:	https://rubygems.org/gems/%{pkgname}-%{version}.gem
 # Source0-md5:	432fa72404066a33ed4189bbf05396c4
 Source1:	redis-test.conf
-Patch0:		rubygem-redis-3.2.2-minitest.patch
+Patch0:		tests-localhost.patch
+Patch1:		rubygem-redis-3.2.2-minitest.patch
 URL:		https://github.com/redis/redis-rb
 BuildRequires:	rpm-rubyprov
 BuildRequires:	rpmbuild(macros) >= 1.665
@@ -39,7 +40,8 @@ Documentation for %{name}.
 
 %prep
 %setup -q -n %{pkgname}-%{version}
-#%patch0 -p1
+%patch0 -p1
+#%patch1 -p1
 
 %build
 # write .gemspec
@@ -50,12 +52,6 @@ Documentation for %{name}.
 # To avoid using rake, we use a static file.
 cp -p %{SOURCE1} test/test.conf
 
-## Running Redis server, which does not support IPv6, nc cannot connect to it using localhost.
-## https://bugzilla.redhat.com/show_bug.cgi?id=978964
-## Use 127.0.0.1 instead or else it hangs while testing.
-## https://bugzilla.redhat.com/show_bug.cgi?id=978284#c2
-sed -i "s/localhost/127.0.0.1/" test/publish_subscribe_test.rb
-
 ## Start a testing redis server instance
 /usr/sbin/redis-server test/test.conf
 sleep 1
diff --git a/tests-localhost.patch b/tests-localhost.patch
new file mode 100644
index 0000000..b729baf
--- /dev/null
+++ b/tests-localhost.patch
@@ -0,0 +1,31 @@
+## Running Redis server, which does not support IPv6, nc cannot connect to it using localhost.
+## https://bugzilla.redhat.com/show_bug.cgi?id=978964
+## Use 127.0.0.1 instead or else it hangs while testing.
+## https://bugzilla.redhat.com/show_bug.cgi?id=978284#c2
+
+Error on PLD builders:
++ ruby -Ilib -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'
+/tmp/B.7HxRqm/BUILD/redis-3.3.0/test/internals_test.rb:379:in `initialize': Address family not supported by protocol - socket(2) (Errno::EAFNOSUPPORT)
+	from /tmp/B.7HxRqm/BUILD/redis-3.3.0/test/internals_test.rb:379:in `new'
+	from /tmp/B.7HxRqm/BUILD/redis-3.3.0/test/internals_test.rb:379:in `af_family_supported'
+	from /tmp/B.7HxRqm/BUILD/redis-3.3.0/test/internals_test.rb:422:in `block in <class:TestInternals>'
+	from /tmp/B.7HxRqm/BUILD/redis-3.3.0/test/helper.rb:60:in `class_eval'
+	from /tmp/B.7HxRqm/BUILD/redis-3.3.0/test/helper.rb:60:in `driver'
+	from /tmp/B.7HxRqm/BUILD/redis-3.3.0/test/internals_test.rb:421:in `<class:TestInternals>'
+	from /tmp/B.7HxRqm/BUILD/redis-3.3.0/test/internals_test.rb:5:in `<top (required)>'
+	from -e:1:in `require'
+	from -e:1:in `glob'
+	from -e:1:in `<main>'
+error: Bad exit status from /tmp/B.7HxRqm/BUILD/tmp/rpm-tmp.98838 (%build)
+
+--- redis-3.3.0/test/distributed_test.rb~	2016-06-16 20:41:49.000000000 +0300
++++ redis-3.3.0/test/distributed_test.rb	2016-06-16 20:44:25.266887277 +0300
+@@ -7,7 +7,7 @@
+   include Helper::Distributed
+ 
+   def test_handle_multiple_servers
+-    @r = Redis::Distributed.new ["redis://localhost:#{PORT}/15", *NODES]
++    @r = Redis::Distributed.new ["redis://127.0.0.1:#{PORT}/15", *NODES]
+ 
+     100.times do |idx|
+       @r.set(idx.to_s, "foo#{idx}")
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ruby-redis.git/commitdiff/672ecc69ecd3336da71be473e356c9548f34193c



More information about the pld-cvs-commit mailing list