Revision: 69126 http://trac.macports.org/changeset/69126 Author: kimuraw@macports.org Date: 2010-06-24 05:54:41 -0700 (Thu, 24 Jun 2010) Log Message: ----------- lang/ruby: upgrade to 1.8.7-p299 - refactoring patch-bug15528.diff [ruby-core:29427] - delete unneeded two patchfiles (merged this version) Modified Paths: -------------- trunk/dports/lang/ruby/Portfile trunk/dports/lang/ruby/files/patch-bug15528.diff Removed Paths: ------------- trunk/dports/lang/ruby/files/patch-bug23650.diff trunk/dports/lang/ruby/files/patch-ruby_bug2648.diff Modified: trunk/dports/lang/ruby/Portfile =================================================================== --- trunk/dports/lang/ruby/Portfile 2010-06-24 11:41:19 UTC (rev 69125) +++ trunk/dports/lang/ruby/Portfile 2010-06-24 12:54:41 UTC (rev 69126) @@ -4,8 +4,8 @@ PortGroup muniversal 1.0 name ruby -version 1.8.7-p249 -revision 3 +version 1.8.7-p299 +revision 0 categories lang ruby maintainers kimuraw @@ -20,9 +20,9 @@ master_sites ruby:1.8 dist_subdir ruby -checksums md5 37200cc956a16996bbfd25bb4068f242 \ - rmd160 96b238bd7194652ec194a505c2e5911441c5c5ee \ - sha1 2947f21f22e9345a3e94d84e6f88e7d0fc98a871 +checksums md5 244439a87d75ab24170a9c2b451ce351 \ + rmd160 0ea4a05f439b6a2cf4bf53339df48aed329f9e43 \ + sha1 9c66c6ee21d427b5f3183b6c42beb02aa8618cef use_bzip2 yes @@ -40,20 +40,10 @@ # #15528: on some Mac, TCPServer.open("localhost", 0) raises SocketError # like "getaddrinfo: nodename nor servname provided, or not # known (SocketError)" -# 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 -# #23650: raises `super called outside of method (NoMethodError)' -# when "super" called at a block of a derived class -# (backport from 1.8) -# http://redmine.ruby-lang.org/issues/show/2537 -# http://redmine.ruby-lang.org/issues/show/2419 patchfiles patch-vendordir.diff \ patch-bug3604.diff \ patch-bug19050.diff \ - patch-bug15528.diff \ - patch-ruby_bug2648.diff \ - patch-bug23650.diff + patch-bug15528.diff # ignore getcontext() and setcontext() # on 10.5, these functions have some problems (SEGV on ppc, slower than 1.8.6) Modified: trunk/dports/lang/ruby/files/patch-bug15528.diff =================================================================== --- trunk/dports/lang/ruby/files/patch-bug15528.diff 2010-06-24 11:41:19 UTC (rev 69125) +++ trunk/dports/lang/ruby/files/patch-bug15528.diff 2010-06-24 12:54:41 UTC (rev 69126) @@ -1,69 +1,55 @@ diff -ur ../ruby-1.8.7-p249.org/ext/socket/socket.c ./ext/socket/socket.c --- ../ruby-1.8.7-p249.org/ext/socket/socket.c 2009-01-27 15:18:04.000000000 +0900 -+++ ./ext/socket/socket.c 2010-01-20 23:02:35.000000000 +0900 -@@ -877,6 +877,14 @@ - } - else if (FIXNUM_P(port)) { - snprintf(pbuf, len, "%ld", FIX2LONG(port)); -+ /* It looks like getaddrinfo changed in Mac OS X 10.5.3 so that sending "0" -+ * as the argument for the port number makes it return EAI_NONAME -+ * but feeding it a port number of NULL seems to do the trick. -+ * RSD - 2008-06-05 -+ */ -+ if (FIX2LONG(port) == 0) { -+ return ""; ++++ ./ext/socket/socket.c 2010-06-22 21:54:15.000000000 +0900 +@@ -234,6 +234,33 @@ + #endif + #endif + ++static int str_isnumber __P((const char *)); ++ ++#if defined(__APPLE__) ++/* fix [ruby-core:29427] */ ++static int ++ruby_getaddrinfo__darwin(const char *nodename, const char *servname, ++ struct addrinfo *hints, struct addrinfo **res) ++{ ++ const char *tmp_servname; ++ struct addrinfo tmp_hints; ++ tmp_servname = servname; ++ MEMCPY(&tmp_hints, hints, struct addrinfo, 1); ++ if (nodename && servname) { ++ if (str_isnumber(tmp_servname) && atoi(servname) == 0) { ++ tmp_servname = NULL; ++#ifdef AI_NUMERICSERV ++ if (tmp_hints.ai_flags) tmp_hints.ai_flags &= ~AI_NUMERICSERV; ++#endif + } - return pbuf; - } - else { -@@ -3592,6 +3600,14 @@ - else if (FIXNUM_P(port)) { - snprintf(pbuf, sizeof(pbuf), "%ld", FIX2LONG(port)); - pptr = pbuf; -+ /* It looks like getaddrinfo changed in Mac OS X 10.5.3 so that sending "0" -+ * as the argument for the port number makes it return EAI_NONAME -+ * but feeding it a port number of NULL seems to do the trick. -+ * RSD - 2008-06-05 -+ */ -+ if (FIX2LONG(port) == 0) { -+ pptr = NULL; -+ } - } - else { - strncpy(pbuf, StringValuePtr(port), sizeof(pbuf)); -@@ -3717,7 +3733,15 @@ - } - else if (FIXNUM_P(port)) { - snprintf(pbuf, sizeof(pbuf), "%ld", NUM2LONG(port)); -- pptr = pbuf; -+ pptr = pbuf; -+ /* It looks like getaddrinfo changed in Mac OS X 10.5.3 so that sending "0" -+ * as the argument for the port number makes it return EAI_NONAME -+ * but feeding it a port number of NULL seems to do the trick. -+ * RSD - 2008-06-05 -+ */ -+ if (NUM2LONG(port) == 0) { -+ pptr = NULL; -+ } - } - else { - strncpy(pbuf, StringValuePtr(port), sizeof(pbuf)); -Only in ./ext/socket: socket.c.orig ++ } ++ int error = getaddrinfo(nodename, tmp_servname, &tmp_hints, res); ++ return error; ++} ++#undef getaddrinfo ++#define getaddrinfo(node,serv,hints,res) ruby_getaddrinfo__darwin((node),(serv),(hints),(res)) ++#endif ++ + #ifdef HAVE_CLOSESOCKET + #undef close + #define close closesocket diff -ur ../ruby-1.8.7-p249.org/test/socket/test_socket.rb ./test/socket/test_socket.rb --- ../ruby-1.8.7-p249.org/test/socket/test_socket.rb 2007-02-13 08:01:19.000000000 +0900 -+++ ./test/socket/test_socket.rb 2010-01-20 23:02:40.000000000 +0900 -@@ -57,6 +57,14 @@ ++++ ./test/socket/test_socket.rb 2010-06-22 21:55:29.000000000 +0900 +@@ -71,6 +71,14 @@ } end end -+ -+ def test_getaddrinfo_raises_no_errors_on_port_argument_of_0 -+ # Added 2008-06-05 to ensure that Mac OS X 10.5.3's changes to getaddrinfo don't cause -+ # Ruby's Socket-based classes to fail. -+ # Here are two of the situations I found that were causing erroneous errors -+ assert_nothing_raised(){Socket.getaddrinfo(Socket.gethostname, 0, Socket::AF_INET, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME)} -+ assert_nothing_raised(){TCPServer.open('localhost', 0)} ++ ++ def test_getaddrinfo_raises_no_errors_on_port_argument_of_0 # [ruby-core:29427] ++ assert_nothing_raised('[ruby-core:29427]'){ Socket.getaddrinfo('localhost', 0, Socket::AF_INET, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME) } ++ assert_nothing_raised('[ruby-core:29427]'){ Socket.getaddrinfo('localhost', '0', Socket::AF_INET, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME) } ++ assert_nothing_raised('[ruby-core:29427]'){ Socket.getaddrinfo('localhost', '00', Socket::AF_INET, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME) } ++ assert_raise(SocketError, '[ruby-core:29427]'){ Socket.getaddrinfo(nil, nil, Socket::AF_INET, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME) } ++ assert_nothing_raised('[ruby-core:29427]'){ TCPServer.open('localhost', 0) {} } + end + end if defined?(Socket) - def test_listen - s = nil + class TestSocket < Test::Unit::TestCase Deleted: trunk/dports/lang/ruby/files/patch-bug23650.diff =================================================================== --- trunk/dports/lang/ruby/files/patch-bug23650.diff 2010-06-24 11:41:19 UTC (rev 69125) +++ trunk/dports/lang/ruby/files/patch-bug23650.diff 2010-06-24 12:54:41 UTC (rev 69126) @@ -1,68 +0,0 @@ -diff -ur ../ruby-1.8.7-p249.mp-patched/eval.c ./eval.c ---- ../ruby-1.8.7-p249.mp-patched/eval.c 2010-03-15 21:50:40.000000000 +0900 -+++ ./eval.c 2010-03-15 23:50:48.000000000 +0900 -@@ -8887,8 +8887,7 @@ - _block = *data; - _block.block_obj = bvar; - if (self != Qundef) _block.frame.self = self; -- _block.frame.last_class = klass; -- if (!klass) _block.frame.last_func = 0; -+ if (klass) _block.frame.last_class = klass; - _block.frame.argc = RARRAY(tmp)->len; - _block.frame.flags = ruby_frame->flags; - if (_block.frame.argc && DMETHOD_P()) { -@@ -9986,7 +9985,7 @@ - VALUE mod; - { - ID id; -- VALUE body; -+ VALUE body, orig; - NODE *node; - int noex; - -@@ -10005,6 +10004,7 @@ - else { - rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)", argc); - } -+ orig = body; - if (RDATA(body)->dmark == (RUBY_DATA_FUNC)bm_mark) { - node = NEW_DMETHOD(method_unbind(body)); - } -@@ -10033,7 +10033,7 @@ - } - } - rb_add_method(mod, id, node, noex); -- return body; -+ return orig; - } - - /* -diff -ur ../ruby-1.8.7-p249.mp-patched/test/ruby/test_super.rb ./test/ruby/test_super.rb ---- ../ruby-1.8.7-p249.mp-patched/test/ruby/test_super.rb 2009-12-14 12:39:41.000000000 +0900 -+++ ./test/ruby/test_super.rb 2010-03-15 23:22:03.000000000 +0900 -@@ -149,4 +149,25 @@ - c = C.new - assert_equal([c, "#{C.to_s}::m"], c.m, bug2419) - end -+ -+ module Bug2537 -+ class Parent -+ def run(a) -+ a -+ end -+ end -+ -+ class Child < Parent -+ def run(*a) -+ proc {super(*a)}.call -+ end -+ end -+ end -+ -+ def test_super_in_block_call -+ bug2537 = '[ruby-dev:39931]' -+ assert_nothing_raised(bug2537) do -+ assert_equal(bug2537, Bug2537::Child.new.run(bug2537), bug2537) -+ end -+ end - end Deleted: trunk/dports/lang/ruby/files/patch-ruby_bug2648.diff =================================================================== --- trunk/dports/lang/ruby/files/patch-ruby_bug2648.diff 2010-06-24 11:41:19 UTC (rev 69125) +++ trunk/dports/lang/ruby/files/patch-ruby_bug2648.diff 2010-06-24 12:54:41 UTC (rev 69126) @@ -1,138 +0,0 @@ -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
participants (1)
-
kimuraw@macports.org