[63130] trunk/dports/lang/ruby186

kimuraw at macports.org kimuraw at macports.org
Wed Jan 27 05:57:41 PST 2010


Revision: 63130
          http://trac.macports.org/changeset/63130
Author:   kimuraw at macports.org
Date:     2010-01-27 05:57:41 -0800 (Wed, 27 Jan 2010)
Log Message:
-----------
lang/ruby186: ugrade to 1.8.6-p388
    add two patches to solve error of drb.

Modified Paths:
--------------
    trunk/dports/lang/ruby186/Portfile

Added Paths:
-----------
    trunk/dports/lang/ruby186/files/patch-bug15528.diff
    trunk/dports/lang/ruby186/files/patch-ruby_core21033.diff

Modified: trunk/dports/lang/ruby186/Portfile
===================================================================
--- trunk/dports/lang/ruby186/Portfile	2010-01-27 13:54:42 UTC (rev 63129)
+++ trunk/dports/lang/ruby186/Portfile	2010-01-27 13:57:41 UTC (rev 63130)
@@ -3,7 +3,7 @@
 PortSystem 1.0
 
 name			ruby186
-version			1.8.6-p368
+version			1.8.6-p388
 
 categories		lang ruby
 maintainers		kimuraw openmaintainer
@@ -22,9 +22,9 @@
 
 dist_subdir		ruby
 distname		ruby-${version}
-checksums		md5     623447c6d8c973193aae565a5538ccfc \
-				sha1    7a2cfb9f0803d21221e7d066837037bbbc50b6ad \
-				rmd160  fba1ef4f6b2b069f4fcd4734b09fc36197138929
+checksums		md5     f26cefbc8ab6728650ab9ae773d22bcb \
+				sha1    175e7f1571761e522e88cc8a8ed123f000c99c59 \
+				rmd160  9f451182ef4fb485109d96953e6af388151cadc8
 
 platforms		darwin
 
@@ -41,6 +41,13 @@
 				patch-mkmf.rb \
 				patch-ruby.c
 
+# bug15528: TCPServer.open('localhost', 0) fails on some Mac
+# [ruby-core:21033]: The DRb code in drb.rb does not correctly deal with
+#                    multiple network families if they're present.
+patchfiles-append \
+				patch-bug15528.diff \
+				patch-ruby_core21033.diff
+
 use_autoconf	yes
 
 configure.args	--enable-shared \

Added: trunk/dports/lang/ruby186/files/patch-bug15528.diff
===================================================================
--- trunk/dports/lang/ruby186/files/patch-bug15528.diff	                        (rev 0)
+++ trunk/dports/lang/ruby186/files/patch-bug15528.diff	2010-01-27 13:57:41 UTC (rev 63130)
@@ -0,0 +1,69 @@
+diff -ur ../ruby-1.8.6-p388.org/ext/socket/socket.c ./ext/socket/socket.c
+--- ../ruby-1.8.6-p388.org/ext/socket/socket.c	2009-01-27 15:17:02.000000000 +0900
++++ ./ext/socket/socket.c	2010-01-27 22:19:05.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 "";
++	}
+ 	return pbuf;
+     }
+     else {
+@@ -3591,6 +3599,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));
+@@ -3716,7 +3732,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
+diff -ur ../ruby-1.8.6-p388.org/test/socket/test_socket.rb ./test/socket/test_socket.rb
+--- ../ruby-1.8.6-p388.org/test/socket/test_socket.rb	2007-02-13 08:01:19.000000000 +0900
++++ ./test/socket/test_socket.rb	2010-01-27 22:19:05.000000000 +0900
+@@ -57,6 +57,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)}
++  end
+ 
+   def test_listen
+     s = nil

Added: trunk/dports/lang/ruby186/files/patch-ruby_core21033.diff
===================================================================
--- trunk/dports/lang/ruby186/files/patch-ruby_core21033.diff	                        (rev 0)
+++ trunk/dports/lang/ruby186/files/patch-ruby_core21033.diff	2010-01-27 13:57:41 UTC (rev 63130)
@@ -0,0 +1,22 @@
+--- 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 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100127/2768f488/attachment-0001.html>


More information about the macports-changes mailing list