[63128] trunk/dports/lang/ruby
kimuraw at macports.org
kimuraw at macports.org
Wed Jan 27 05:07:23 PST 2010
Revision: 63128
http://trac.macports.org/changeset/63128
Author: kimuraw at macports.org
Date: 2010-01-27 05:07:21 -0800 (Wed, 27 Jan 2010)
Log Message:
-----------
lang/ruby: upgrade to 1.8.7-p249
Modified Paths:
--------------
trunk/dports/lang/ruby/Portfile
Added Paths:
-----------
trunk/dports/lang/ruby/files/patch-ruby_bug2648.diff
Removed Paths:
-------------
trunk/dports/lang/ruby/files/patch-bug22361.diff
trunk/dports/lang/ruby/files/patch-ruby-core21033.diff
Modified: trunk/dports/lang/ruby/Portfile
===================================================================
--- trunk/dports/lang/ruby/Portfile 2010-01-27 09:21:55 UTC (rev 63127)
+++ trunk/dports/lang/ruby/Portfile 2010-01-27 13:07:21 UTC (rev 63128)
@@ -3,8 +3,8 @@
PortSystem 1.0
name ruby
-version 1.8.7-p174
-revision 2
+version 1.8.7-p249
+revision 0
categories lang ruby
maintainers kimuraw
@@ -19,9 +19,9 @@
master_sites ruby:1.8
dist_subdir ruby
-checksums md5 88c45aaf627b4404e5e4273cb03ba2ee \
- rmd160 f854d456003af1e31d50330c88c3cb152c434249 \
- sha1 9e84b49ad545ad54b8e7dc3c227eaaefeb1041aa
+checksums md5 37200cc956a16996bbfd25bb4068f242 \
+ rmd160 96b238bd7194652ec194a505c2e5911441c5c5ee \
+ sha1 2947f21f22e9345a3e94d84e6f88e7d0fc98a871
use_bzip2 yes
@@ -39,15 +39,14 @@
# #15528: on some Mac, TCPServer.open("localhost", 0) raises SocketError
# like "getaddrinfo: nodename nor servname provided, or not
# known (SocketError)"
-# #22361: Hash equivalence fails when a value is a Fixnum >= 2**29 or 2**61
-# ruby-core:21033: the DRb code in drb.rb does not correctly deal with
-# multiple network families if they're present.
+# ruby bug#2648 (backport from 1.8): p249 with pthread sometimes SEGV crash
+# http://redmine.ruby-lang.org/issues/show/2648
+# http://redmine.ruby-lang.org/issues/show/2603
patchfiles patch-vendordir.diff \
patch-bug3604.diff \
patch-bug19050.diff \
patch-bug15528.diff \
- patch-bug22361.diff \
- patch-ruby-core21033.diff
+ patch-ruby_bug2648.diff
# ignore getcontext() and setcontext()
# on 10.5, these functions have some problems (SEGV on ppc, slower than 1.8.6)
Deleted: trunk/dports/lang/ruby/files/patch-bug22361.diff
===================================================================
--- trunk/dports/lang/ruby/files/patch-bug22361.diff 2010-01-27 09:21:55 UTC (rev 63127)
+++ trunk/dports/lang/ruby/files/patch-bug22361.diff 2010-01-27 13:07:21 UTC (rev 63128)
@@ -1,56 +0,0 @@
-diff -ur ../ruby-1.8.7-p174.org/hash.c ./hash.c
---- ../ruby-1.8.7-p174.org/hash.c 2009-02-24 02:40:05.000000000 +0900
-+++ ./hash.c 2009-11-06 22:59:06.000000000 +0900
-@@ -81,7 +81,19 @@
- rb_hash(obj)
- VALUE obj;
- {
-- return rb_funcall(obj, id_hash, 0);
-+ VALUE hval = rb_funcall(obj, id_hash, 0);
-+ retry:
-+ switch (TYPE(hval)) {
-+ case T_FIXNUM:
-+ return hval;
-+
-+ case T_BIGNUM:
-+ return LONG2FIX(((long*)(RBIGNUM(hval)->digits))[0]);
-+
-+ default:
-+ hval = rb_to_int(hval);
-+ goto retry;
-+ }
- }
-
- static int
-@@ -102,10 +114,7 @@
- break;
-
- default:
-- hval = rb_funcall(a, id_hash, 0);
-- if (!FIXNUM_P(hval)) {
-- hval = rb_funcall(hval, '%', 1, INT2FIX(536870923));
-- }
-+ hval = rb_hash(a);
- hnum = (int)FIX2LONG(hval);
- }
- hnum <<= 1;
-Only in .: hash.c.orig
-diff -ur ../ruby-1.8.7-p174.org/test/ruby/test_hash.rb ./test/ruby/test_hash.rb
---- ../ruby-1.8.7-p174.org/test/ruby/test_hash.rb 2008-06-09 03:25:01.000000000 +0900
-+++ ./test/ruby/test_hash.rb 2009-11-06 22:43:45.000000000 +0900
-@@ -638,4 +638,15 @@
- def test_hash_hash
- assert_equal({0=>2,11=>1}.hash, {11=>1,0=>2}.hash)
- end
-+
-+ def test_hash_bignum_hash
-+ x = 2<<(32-3)-1
-+ assert_equal({x=>1}.hash, {x=>1}.hash)
-+ x = 2<<(64-3)-1
-+ assert_equal({x=>1}.hash, {x=>1}.hash)
-+
-+ o = Object.new
-+ def o.hash; 2<<100; end
-+ assert_equal({x=>1}.hash, {x=>1}.hash)
-+ end
- end
Deleted: trunk/dports/lang/ruby/files/patch-ruby-core21033.diff
===================================================================
--- trunk/dports/lang/ruby/files/patch-ruby-core21033.diff 2010-01-27 09:21:55 UTC (rev 63127)
+++ trunk/dports/lang/ruby/files/patch-ruby-core21033.diff 2010-01-27 13:07:21 UTC (rev 63128)
@@ -1,22 +0,0 @@
---- lib/drb/drb.rb.orig 2009-02-16 22:37:06.000000000 +0900
-+++ lib/drb/drb.rb 2010-01-22 22:12:00.000000000 +0900
-@@ -842,15 +842,10 @@
- Socket::SOCK_STREAM,
- 0,
- Socket::AI_PASSIVE)
-- family = infos.collect { |af, *_| af }.uniq
-- case family
-- when ['AF_INET']
-- return TCPServer.open('0.0.0.0', port)
-- when ['AF_INET6']
-- return TCPServer.open('::', port)
-- else
-- return TCPServer.open(port)
-- end
-+ families = Hash[*infos.collect { |af, *_| af }.uniq.zip([]).flatten]
-+ return TCPServer.open('0.0.0.0', port) if families.has_key?('AF_INET')
-+ return TCPServer.open('::', port) if families.has_key?('AF_INET6')
-+ return TCPServer.open(port)
- end
-
- # Open a server listening for connections at +uri+ using
Added: trunk/dports/lang/ruby/files/patch-ruby_bug2648.diff
===================================================================
--- trunk/dports/lang/ruby/files/patch-ruby_bug2648.diff (rev 0)
+++ trunk/dports/lang/ruby/files/patch-ruby_bug2648.diff 2010-01-27 13:07:21 UTC (rev 63128)
@@ -0,0 +1,138 @@
+diff -ur ../ruby-1.8.7-p249.org/eval.c ./eval.c
+--- ../ruby-1.8.7-p249.org/eval.c 2009-12-21 17:11:42.000000000 +0900
++++ ./eval.c 2010-01-27 20:59:35.000000000 +0900
+@@ -12245,7 +12245,9 @@
+ return th;
+ }
+
++#if defined(HAVE_SETITIMER) || defined(_THREAD_SAFE)
+ static int thread_init;
++#endif
+
+ #if defined(POSIX_SIGNAL)
+ #define CATCH_VTALRM() posix_signal(SIGVTALRM, catch_timer)
+@@ -12292,6 +12294,8 @@
+ pthread_t thread;
+ } time_thread = {PTHREAD_COND_INITIALIZER, PTHREAD_MUTEX_INITIALIZER};
+
++static int timer_stopping;
++
+ #define safe_mutex_lock(lock) \
+ pthread_mutex_lock(lock); \
+ pthread_cleanup_push((void (*)_((void *)))pthread_mutex_unlock, lock)
+@@ -12316,6 +12320,9 @@
+ #define WAIT_FOR_10MS() \
+ pthread_cond_timedwait(&running->cond, &running->lock, get_ts(&to, PER_NANO/100))
+ while ((err = WAIT_FOR_10MS()) == EINTR || err == ETIMEDOUT) {
++ if (timer_stopping)
++ break;
++
+ if (!rb_thread_critical) {
+ rb_thread_pending = 1;
+ if (rb_trap_immediate) {
+@@ -12343,7 +12350,9 @@
+ safe_mutex_lock(&time_thread.lock);
+ if (pthread_create(&time_thread.thread, 0, thread_timer, args) == 0) {
+ thread_init = 1;
++#if !defined(__NetBSD__) && !defined(__APPLE__)
+ pthread_atfork(0, 0, rb_thread_stop_timer);
++#endif
+ pthread_cond_wait(&start, &time_thread.lock);
+ }
+ pthread_cleanup_pop(1);
+@@ -12354,10 +12363,12 @@
+ {
+ if (!thread_init) return;
+ safe_mutex_lock(&time_thread.lock);
++ timer_stopping = 1;
+ pthread_cond_signal(&time_thread.cond);
+ thread_init = 0;
+ pthread_cleanup_pop(1);
+ pthread_join(time_thread.thread, NULL);
++ timer_stopping = 0;
+ }
+ #elif defined(HAVE_SETITIMER)
+ static void
+Only in .: eval.c.orig
+diff -ur ../ruby-1.8.7-p249.org/io.c ./io.c
+--- ../ruby-1.8.7-p249.org/io.c 2009-11-25 17:45:13.000000000 +0900
++++ ./io.c 2010-01-27 20:59:35.000000000 +0900
+@@ -3245,6 +3245,9 @@
+ }
+
+ retry:
++#if defined(__NetBSD__) || defined(__APPLE__)
++ rb_thread_stop_timer();
++#endif
+ switch ((pid = fork())) {
+ case 0: /* child */
+ if (modef & FMODE_READABLE) {
+@@ -3272,11 +3275,17 @@
+ ruby_sourcefile, ruby_sourceline, pname);
+ _exit(127);
+ }
++#if defined(__NetBSD__) || defined(__APPLE__)
++ rb_thread_start_timer();
++#endif
+ rb_io_synchronized(RFILE(orig_stdout)->fptr);
+ rb_io_synchronized(RFILE(orig_stderr)->fptr);
+ return Qnil;
+
+ case -1: /* fork failed */
++#if defined(__NetBSD__) || defined(__APPLE__)
++ rb_thread_start_timer();
++#endif
+ if (errno == EAGAIN) {
+ rb_thread_sleep(1);
+ goto retry;
+@@ -3297,6 +3306,9 @@
+ break;
+
+ default: /* parent */
++#if defined(__NetBSD__) || defined(__APPLE__)
++ rb_thread_start_timer();
++#endif
+ if (pid < 0) rb_sys_fail(pname);
+ else {
+ VALUE port = io_alloc(rb_cIO);
+Only in .: io.c.orig
+diff -ur ../ruby-1.8.7-p249.org/process.c ./process.c
+--- ../ruby-1.8.7-p249.org/process.c 2008-06-29 18:34:43.000000000 +0900
++++ ./process.c 2010-01-27 20:59:35.000000000 +0900
+@@ -1330,7 +1330,14 @@
+ fflush(stderr);
+ #endif
+
+- switch (pid = fork()) {
++#if defined(__NetBSD__) || defined(__APPLE__)
++ before_exec();
++#endif
++ pid = fork();
++#if defined(__NetBSD__) || defined(__APPLE__)
++ after_exec();
++#endif
++ switch (pid) {
+ case 0:
+ #ifdef linux
+ after_exec();
+@@ -1570,6 +1577,9 @@
+
+ chfunc = signal(SIGCHLD, SIG_DFL);
+ retry:
++#if defined(__NetBSD__) || defined(__APPLE__)
++ before_exec();
++#endif
+ pid = fork();
+ if (pid == 0) {
+ /* child process */
+@@ -1577,6 +1587,9 @@
+ rb_protect(proc_exec_args, (VALUE)&earg, NULL);
+ _exit(127);
+ }
++#if defined(__NetBSD__) || defined(__APPLE__)
++ after_exec();
++#endif
+ if (pid < 0) {
+ if (errno == EAGAIN) {
+ rb_thread_sleep(1);
+Only in .: process.c.orig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100127/95afec86/attachment.html>
More information about the macports-changes
mailing list