Skip to content

Commit

Permalink
Merge pull request #17 from felixbuenemann/ruby-1.8.7-p371
Browse files Browse the repository at this point in the history
Ruby 1.8.7-p371 Support
  • Loading branch information
Stefan Kaes committed May 25, 2013
2 parents 058053c + ac5ef34 commit 0ccd19d
Show file tree
Hide file tree
Showing 21 changed files with 3,420 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ there's no guarantee. The following versions are currently supported:
1.8.7-p352 # not recommended, use at least p358
1.8.7-p357 # fixes a DOS vulnerability in 1.8.7
1.8.7-p358 #
1.8.7-p370 # current rvm default for MRI-ruby 1.8.7
1.8.7-p370 #
1.8.7-p371 # current rvm default for MRI-ruby 1.8.7
1.9.2-p180 #
1.9.2-p290 #
1.9.2-p318 #
Expand Down
101 changes: 101 additions & 0 deletions patches/ruby/1.8.7/p371/railsexpress/01-ignore-generated-files.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..00c347a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,95 @@
+.ext
+.installed.list
+.rbconfig.time
+Makefile
+autom4te.cache/
+config.h
+config.status
+configure
+ext/Win32API/Makefile
+ext/bigdecimal/Makefile
+ext/curses/Makefile
+ext/dbm/Makefile
+ext/digest/Makefile
+ext/digest/bubblebabble/Makefile
+ext/digest/md5/Makefile
+ext/digest/rmd160/Makefile
+ext/digest/sha1/Makefile
+ext/digest/sha2/Makefile
+ext/dl/Makefile
+ext/dl/call.func
+ext/dl/callback.func
+ext/dl/cbtable.func
+ext/dl/dlconfig.h
+ext/dl/dlconfig.rb
+ext/enumerator/Makefile
+ext/etc/Makefile
+ext/fcntl/Makefile
+ext/gdbm/Makefile
+ext/iconv/Makefile
+ext/io/wait/Makefile
+ext/nkf/Makefile
+ext/openssl/Makefile
+ext/openssl/extconf.h
+ext/pty/Makefile
+ext/racc/cparse/Makefile
+ext/readline/Makefile
+ext/sdbm/Makefile
+ext/socket/Makefile
+ext/stringio/Makefile
+ext/strscan/Makefile
+ext/syck/Makefile
+ext/syslog/Makefile
+ext/thread/Makefile
+ext/tk/Makefile
+ext/tk/tkutil/Makefile
+ext/win32ole/Makefile
+ext/win32ole/.document
+ext/zlib/Makefile
+largefile.h
+miniruby
+parse.c
+rbconfig.rb
+ruby
+enc.mk
+ext/bigdecimal/extconf.h
+ext/continuation/
+ext/coverage/
+ext/curses/extconf.h
+ext/dbm/extconf.h
+ext/digest/bubblebabble/extconf.h
+ext/digest/extconf.h
+ext/digest/md5/extconf.h
+ext/digest/rmd160/extconf.h
+ext/digest/sha1/extconf.h
+ext/digest/sha2/extconf.h
+ext/dl/callback.h
+ext/dl/extconf.h
+ext/etc/extconf.h
+ext/fcntl/extconf.h
+ext/fiber/
+ext/iconv/extconf.h
+ext/io/wait/extconf.h
+ext/json/
+ext/nkf/extconf.h
+ext/pty/extconf.h
+ext/racc/cparse/extconf.h
+ext/readline/extconf.h
+ext/ripper/
+ext/sdbm/extconf.h
+ext/socket/constants.h
+ext/socket/extconf.h
+ext/stringio/extconf.h
+ext/strscan/extconf.h
+ext/syck/extconf.h
+ext/syslog/extconf.h
+ext/tk/extconf.h
+ext/tk/tkutil/extconf.h
+ext/zlib/extconf.h
+miniprelude.c
+prelude.c
+revision.h
+*.dylib
+*.log
+*.dSYM
+patches-ruby*
139 changes: 139 additions & 0 deletions patches/ruby/1.8.7/p371/railsexpress/02-fix-tests-for-osx.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
diff --git a/test/drb/drbtest.rb b/test/drb/drbtest.rb
index bc16ab1..c12b168 100644
--- a/test/drb/drbtest.rb
+++ b/test/drb/drbtest.rb
@@ -22,7 +22,7 @@ class DRbService
%w(ut_drb.rb ut_array.rb ut_port.rb ut_large.rb ut_safe1.rb ut_eval.rb).each do |nm|
add_service_command(nm)
end
- @server = @@server = DRb::DRbServer.new('druby://localhost:0', @@manager, {})
+ @server = @@server = DRb::DRbServer.new('druby://127.0.0.1:0', @@manager, {})
@@manager.uri = @@server.uri
def self.manager
@@manager
@@ -79,16 +79,16 @@ module DRbCore
end

def test_00_DRbObject
- ro = DRbObject.new(nil, 'druby://localhost:12345')
- assert_equal('druby://localhost:12345', ro.__drburi)
+ ro = DRbObject.new(nil, 'druby://127.0.0.1:12345')
+ assert_equal('druby://127.0.0.1:12345', ro.__drburi)
assert_equal(nil, ro.__drbref)

- ro = DRbObject.new_with_uri('druby://localhost:12345')
- assert_equal('druby://localhost:12345', ro.__drburi)
+ ro = DRbObject.new_with_uri('druby://127.0.0.1:12345')
+ assert_equal('druby://127.0.0.1:12345', ro.__drburi)
assert_equal(nil, ro.__drbref)

- ro = DRbObject.new_with_uri('druby://localhost:12345?foobar')
- assert_equal('druby://localhost:12345', ro.__drburi)
+ ro = DRbObject.new_with_uri('druby://127.0.0.1:12345?foobar')
+ assert_equal('druby://127.0.0.1:12345', ro.__drburi)
assert_equal(DRb::DRbURIOption.new('foobar'), ro.__drbref)
end

diff --git a/test/drb/ut_drb.rb b/test/drb/ut_drb.rb
index f5720cf..265713d 100644
--- a/test/drb/ut_drb.rb
+++ b/test/drb/ut_drb.rb
@@ -154,7 +154,7 @@ if __FILE__ == $0

DRb::DRbServer.default_argc_limit(8)
DRb::DRbServer.default_load_limit(4096)
- DRb.start_service('druby://localhost:0', DRbEx.new)
+ DRb.start_service('druby://127.0.0.1:0', DRbEx.new)
es = DRb::ExtServ.new(ARGV.shift, ARGV.shift)
DRb.thread.join
end
diff --git a/test/drb/ut_drb_drbssl.rb b/test/drb/ut_drb_drbssl.rb
index 0a2191e..bca3012 100644
--- a/test/drb/ut_drb_drbssl.rb
+++ b/test/drb/ut_drb_drbssl.rb
@@ -18,7 +18,7 @@ if __FILE__ == $0

DRb::DRbServer.default_argc_limit(8)
DRb::DRbServer.default_load_limit(4096)
- DRb.start_service('drbssl://localhost:0', DRbEx.new, config)
+ DRb.start_service('drbssl://127.0.0.1:0', DRbEx.new, config)
es = DRb::ExtServ.new(ARGV.shift, ARGV.shift)
DRb.thread.join
end
diff --git a/test/drb/ut_eval.rb b/test/drb/ut_eval.rb
index 4df963e..9127939 100644
--- a/test/drb/ut_eval.rb
+++ b/test/drb/ut_eval.rb
@@ -3,7 +3,7 @@ require 'drb/extserv'

class EvalAttack
def initialize
- @four = DRb::DRbServer.new('druby://localhost:0', self, {:safe_level => 4})
+ @four = DRb::DRbServer.new('druby://127.0.0.1:0', self, {:safe_level => 4})
end

def four
@@ -25,7 +25,7 @@ if __FILE__ == $0

$SAFE = 1

- DRb.start_service('druby://localhost:0', EvalAttack.new, {:safe_level => 2})
+ DRb.start_service('druby://127.0.0.1:0', EvalAttack.new, {:safe_level => 2})
es = DRb::ExtServ.new(ARGV.shift, ARGV.shift)
DRb.thread.join
end
diff --git a/test/drb/ut_large.rb b/test/drb/ut_large.rb
index d6717c5..0aefd1b 100644
--- a/test/drb/ut_large.rb
+++ b/test/drb/ut_large.rb
@@ -31,7 +31,7 @@ if __FILE__ == $0

DRb::DRbServer.default_argc_limit(3)
DRb::DRbServer.default_load_limit(100000)
- DRb.start_service('druby://localhost:0', DRbLarge.new)
+ DRb.start_service('druby://127.0.0.1:0', DRbLarge.new)
es = DRb::ExtServ.new(ARGV.shift, ARGV.shift)
DRb.thread.join
end
diff --git a/test/drb/ut_safe1.rb b/test/drb/ut_safe1.rb
index 4df8e1e..5e7fe82 100644
--- a/test/drb/ut_safe1.rb
+++ b/test/drb/ut_safe1.rb
@@ -8,7 +8,7 @@ if __FILE__ == $0
it
end

- DRb.start_service('druby://localhost:0', [1, 2, 'III', 4, "five", 6],
+ DRb.start_service('druby://127.0.0.1:0', [1, 2, 'III', 4, "five", 6],
{:safe_level => 1})
es = DRb::ExtServ.new(ARGV.shift, ARGV.shift)
DRb.thread.join
diff --git a/test/net/pop/test_pop.rb b/test/net/pop/test_pop.rb
index c8aa9a8..129ca08 100644
--- a/test/net/pop/test_pop.rb
+++ b/test/net/pop/test_pop.rb
@@ -3,10 +3,14 @@ require 'test/unit'
require 'digest/md5'

class TestPOP < Test::Unit::TestCase
+ def localhost
+ '127.0.0.1'
+ end
+
def setup
@users = {'user' => 'pass' }
@ok_user = 'user'
- @stamp_base = "#{$$}.#{Time.now.to_i}@localhost"
+ @stamp_base = "#{$$}.#{Time.now.to_i}@#{localhost}"
end

def test_pop_auth_ok
@@ -64,7 +68,7 @@ class TestPOP < Test::Unit::TestCase
end

def pop_test(apop=false)
- host = 'localhost'
+ host = localhost
server = TCPServer.new(host, 0)
port = server.addr[1]
thread = Thread.start do
27 changes: 27 additions & 0 deletions patches/ruby/1.8.7/p371/railsexpress/03-sigvtalrm-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
diff --git a/eval.c b/eval.c
index c2049c7..f49044a 100644
--- a/eval.c
+++ b/eval.c
@@ -12483,6 +12483,11 @@ rb_thread_start_0(fn, arg, th)
curr_thread->next = th;
th->priority = curr_thread->priority;
th->thgroup = curr_thread->thgroup;
+#if defined(HAVE_SETITIMER) || defined(_THREAD_SAFE)
+ if (!thread_init) {
+ rb_thread_start_timer();
+ }
+#endif
}
START_TIMER();

@@ -13211,7 +13216,9 @@ rb_thread_atfork()
main_thread = curr_thread;
curr_thread->next = curr_thread;
curr_thread->prev = curr_thread;
- STOP_TIMER();
+#if defined(HAVE_SETITIMER) || defined(_THREAD_SAFE)
+ rb_thread_stop_timer();
+#endif
}


Loading

0 comments on commit 0ccd19d

Please sign in to comment.