diff options
-rw-r--r-- | Mk/bsd.ruby.mk | 4 | ||||
-rw-r--r-- | lang/ruby18/distinfo | 6 | ||||
-rw-r--r-- | lang/ruby18/files/patch-class.c | 11 | ||||
-rw-r--r-- | lang/ruby18/files/patch-ext_bigdecimal_bigdecimal.c | 211 | ||||
-rw-r--r-- | lang/ruby18/files/patch-file-check-space | 11 | ||||
-rw-r--r-- | lang/ruby18/files/patch-gc.c | 17 | ||||
-rw-r--r-- | lang/ruby18/files/patch-lib_soap_mimemessage.rb | 11 | ||||
-rw-r--r-- | lang/ruby18/files/patch-ostruct-fix-frozen | 46 | ||||
-rw-r--r-- | lang/ruby18/files/patch-ostruct-recursion-test | 39 | ||||
-rw-r--r-- | lang/ruby18/files/patch-select-ebadf-fix | 106 |
10 files changed, 9 insertions, 453 deletions
diff --git a/Mk/bsd.ruby.mk b/Mk/bsd.ruby.mk index 6f7b99c83581..29d17dd7e0be 100644 --- a/Mk/bsd.ruby.mk +++ b/Mk/bsd.ruby.mk @@ -170,9 +170,9 @@ RUBY?= ${LOCALBASE}/bin/${RUBY_NAME} # Ruby 1.8 # RUBY_RELVERSION= 1.8.7 -RUBY_PORTREVISION= 5 +RUBY_PORTREVISION= 0 RUBY_PORTEPOCH= 1 -RUBY_PATCHLEVEL= 160 +RUBY_PATCHLEVEL= 248 . if ${RUBY_PATCHLEVEL} == 0 RUBY_VERSION?= ${RUBY_RELVERSION} diff --git a/lang/ruby18/distinfo b/lang/ruby18/distinfo index 99594eea178f..91b6686456a0 100644 --- a/lang/ruby18/distinfo +++ b/lang/ruby18/distinfo @@ -1,3 +1,3 @@ -MD5 (ruby/ruby-1.8.7-p160.tar.bz2) = f8ddb886b8a81cf005f53e9a9541091d -SHA256 (ruby/ruby-1.8.7-p160.tar.bz2) = e524a086212d2142c03eb6b82cd602adcac9dcf8bf60049e89aa4ca69864984d -SIZE (ruby/ruby-1.8.7-p160.tar.bz2) = 4137518 +MD5 (ruby/ruby-1.8.7-p248.tar.bz2) = 37e19d46b7d4b845f57d3389084b94a6 +SHA256 (ruby/ruby-1.8.7-p248.tar.bz2) = 3d238c4cf0988797d33169ab05829f1a483194e7cacae4232f3a0e2cc01b6bfc +SIZE (ruby/ruby-1.8.7-p248.tar.bz2) = 4153123 diff --git a/lang/ruby18/files/patch-class.c b/lang/ruby18/files/patch-class.c deleted file mode 100644 index 7530520d312a..000000000000 --- a/lang/ruby18/files/patch-class.c +++ /dev/null @@ -1,11 +0,0 @@ ---- class.c.orig 2009-06-18 16:17:27.000000000 +0400 -+++ class.c 2009-06-18 16:17:42.000000000 +0400 -@@ -153,7 +153,7 @@ - data.klass = obj; - break; - default: -- data.klass = 0; -+ data.klass = Qnil; - break; - } - diff --git a/lang/ruby18/files/patch-ext_bigdecimal_bigdecimal.c b/lang/ruby18/files/patch-ext_bigdecimal_bigdecimal.c deleted file mode 100644 index fa6bab2683a6..000000000000 --- a/lang/ruby18/files/patch-ext_bigdecimal_bigdecimal.c +++ /dev/null @@ -1,211 +0,0 @@ ---- ext/bigdecimal/bigdecimal.c.orig 2009-06-13 01:11:45.000000000 +0400 -+++ ext/bigdecimal/bigdecimal.c 2009-06-13 01:11:49.000000000 +0400 -@@ -306,17 +306,19 @@ - BigDecimal_dump(int argc, VALUE *argv, VALUE self) - { - ENTER(5); -- char sz[50]; - Real *vp; - char *psz; - VALUE dummy; -+ volatile VALUE dump; -+ - rb_scan_args(argc, argv, "01", &dummy); - GUARD_OBJ(vp,GetVpValue(self,1)); -- sprintf(sz,"%lu:",VpMaxPrec(vp)*VpBaseFig()); -- psz = ALLOCA_N(char,(unsigned int)VpNumOfChars(vp,"E")+strlen(sz)); -- sprintf(psz,"%s",sz); -+ dump = rb_str_new(0,VpNumOfChars(vp,"E")+50); -+ psz = RSTRING_PTR(dump); -+ sprintf(psz,"%lu:",VpMaxPrec(vp)*VpBaseFig()); - VpToString(vp, psz+strlen(psz), 0, 0); -- return rb_str_new2(psz); -+ rb_str_resize(dump, strlen(psz)); -+ return dump; - } - - /* -@@ -520,6 +522,7 @@ - ENTER(5); - int e,n,i,nf; - U_LONG v,b,j; -+ volatile VALUE str; - char *psz,*pch; - Real *p; - -@@ -527,14 +530,14 @@ - - /* Infinity or NaN not converted. */ - if(VpIsNaN(p)) { -- VpException(VP_EXCEPTION_NaN,"Computation results to 'NaN'(Not a Number)",0); -- return Qnil; -+ VpException(VP_EXCEPTION_NaN,"Computation results to 'NaN'(Not a Number)",1); -+ return Qnil; /* not reached */ - } else if(VpIsPosInf(p)) { -- VpException(VP_EXCEPTION_INFINITY,"Computation results to 'Infinity'",0); -- return Qnil; -+ VpException(VP_EXCEPTION_INFINITY,"Computation results to 'Infinity'",1); -+ return Qnil; /* not reached */ - } else if(VpIsNegInf(p)) { -- VpException(VP_EXCEPTION_INFINITY,"Computation results to '-Infinity'",0); -- return Qnil; -+ VpException(VP_EXCEPTION_INFINITY,"Computation results to '-Infinity'",1); -+ return Qnil; /* not reached */ - } - - e = VpExponent10(p); -@@ -544,7 +547,8 @@ - e = VpGetSign(p)*p->frac[0]; - return INT2FIX(e); - } -- psz = ALLOCA_N(char,(unsigned int)(e+nf+2)); -+ str = rb_str_new(0, e+nf+2); -+ psz = RSTRING_PTR(str); - - n = (e+nf-1)/nf; - pch = psz; -@@ -589,17 +593,21 @@ - double d; - S_LONG e; - char *buf; -+ volatile VALUE str; - - GUARD_OBJ(p,GetVpValue(self,1)); - if(VpVtoD(&d, &e, p)!=1) return rb_float_new(d); -- buf = ALLOCA_N(char,(unsigned int)VpNumOfChars(p,"E")); -+ if (e > DBL_MAX_10_EXP) goto erange; -+ str = rb_str_new(0, VpNumOfChars(p,"E")); -+ buf = RSTRING_PTR(str); - VpToString(p, buf, 0, 0); - errno = 0; - d = strtod(buf, 0); - if(errno == ERANGE) { -+ erange: - VpException(VP_EXCEPTION_OVERFLOW,"BigDecimal to Float conversion",0); -- if(d>0.0) return rb_float_new(DBL_MAX); -- else return rb_float_new(-DBL_MAX); -+ if(d>0.0) d = VpGetDoublePosInf(); -+ else d = VpGetDoubleNegInf(); - } - return rb_float_new(d); - } -@@ -1491,6 +1499,7 @@ - int fmt=0; /* 0:E format */ - int fPlus=0; /* =0:default,=1: set ' ' before digits ,set '+' before digits. */ - Real *vp; -+ volatile VALUE str; - char *psz; - char ch; - U_LONG nc; -@@ -1527,14 +1536,16 @@ - } - if(mc>0) nc += (nc + mc - 1) / mc + 1; - -- psz = ALLOCA_N(char,(unsigned int)nc); -+ str = rb_str_new(0, nc); -+ psz = RSTRING_PTR(str); - - if(fmt) { - VpToFString(vp, psz, mc, fPlus); - } else { - VpToString (vp, psz, mc, fPlus); - } -- return rb_str_new2(psz); -+ rb_str_resize(str, strlen(psz)); -+ return str; - } - - /* Splits a BigDecimal number into four parts, returned as an array of values. -@@ -1566,24 +1577,29 @@ - { - ENTER(5); - Real *vp; -- VALUE obj,obj1; -+ VALUE obj,str; - S_LONG e; - S_LONG s; - char *psz1; - - GUARD_OBJ(vp,GetVpValue(self,1)); -- psz1 = ALLOCA_N(char,(unsigned int)VpNumOfChars(vp,"E")); -+ str = rb_str_new(0, VpNumOfChars(vp,"E")); -+ psz1 = RSTRING_PTR(str); - VpSzMantissa(vp,psz1); - s = 1; - if(psz1[0]=='-') { -- s = -1; ++psz1; -+ int len = strlen(psz1+1); -+ -+ memmove(psz1, psz1+1, len); -+ psz1[len] = '\0'; -+ s = -1; - } - if(psz1[0]=='N') s=0; /* NaN */ - e = VpExponent10(vp); -- obj1 = rb_str_new2(psz1); - obj = rb_ary_new2(4); - rb_ary_push(obj, INT2FIX(s)); -- rb_ary_push(obj, obj1); -+ rb_ary_push(obj, str); -+ rb_str_resize(str, strlen(psz1)); - rb_ary_push(obj, INT2FIX(10)); - rb_ary_push(obj, INT2NUM(e)); - return obj; -@@ -1616,20 +1632,22 @@ - { - ENTER(5); - Real *vp; -- VALUE obj; -+ volatile VALUE obj; - unsigned int nc; -- char *psz1; -- char *pszAll; -+ char *psz, *tmp; - - GUARD_OBJ(vp,GetVpValue(self,1)); - nc = VpNumOfChars(vp,"E"); - nc +=(nc + 9) / 10; - -- psz1 = ALLOCA_N(char,nc); -- pszAll = ALLOCA_N(char,nc+256); -- VpToString(vp, psz1, 10, 0); -- sprintf(pszAll,"#<BigDecimal:%lx,'%s',%lu(%lu)>",self,psz1,VpPrec(vp)*VpBaseFig(),VpMaxPrec(vp)*VpBaseFig()); -- obj = rb_str_new2(pszAll); -+ obj = rb_str_new(0, nc+256); -+ psz = RSTRING_PTR(obj); -+ sprintf(psz,"#<BigDecimal:%lx,'",self); -+ tmp = psz + strlen(psz); -+ VpToString(vp, tmp, 10, 0); -+ tmp += strlen(tmp); -+ sprintf(tmp,"',%lu(%lu)>",VpPrec(vp)*VpBaseFig(),VpMaxPrec(vp)*VpBaseFig()); -+ rb_str_resize(obj, strlen(psz)); - return obj; - } - -@@ -2482,6 +2500,7 @@ - int sign=1; - Real *vp = NULL; - U_LONG mf = VpGetPrecLimit(); -+ volatile VALUE buf; - - mx = (mx + BASE_FIG - 1) / BASE_FIG + 1; /* Determine allocation unit. */ - if(szVal) { -@@ -2509,7 +2528,8 @@ - - /* Skip all '_' after digit: 2006-6-30 */ - ni = 0; -- psz = ALLOCA_N(char,strlen(szVal)+1); -+ buf = rb_str_new(0,strlen(szVal)+1); -+ psz = RSTRING_PTR(buf); - i = 0; - ipn = 0; - while((psz[i]=szVal[ipn])!=0) { -@@ -3601,7 +3621,7 @@ - nc += fprintf(fp, "0."); - n = a->Prec; - for(i=0;i < n;++i) { -- m = BASE1; -+ m = BASE1; - e = a->frac[i]; - while(m) { - nn = e / m; diff --git a/lang/ruby18/files/patch-file-check-space b/lang/ruby18/files/patch-file-check-space deleted file mode 100644 index fbe9a41fa55a..000000000000 --- a/lang/ruby18/files/patch-file-check-space +++ /dev/null @@ -1,11 +0,0 @@ ---- file.c 2009/05/26 12:15:23 23584 -+++ file.c 2009/05/26 12:20:27 23585 -@@ -3035,7 +3035,7 @@ - p = last; - break; - } -- if (*last == '.') e = dot; -+ if (*last == '.' || dot > last) e = dot; - continue; - #else - e = p; /* get the last dot of the last component */ diff --git a/lang/ruby18/files/patch-gc.c b/lang/ruby18/files/patch-gc.c index 2ca3a480416f..971b52e2ab9b 100644 --- a/lang/ruby18/files/patch-gc.c +++ b/lang/ruby18/files/patch-gc.c @@ -1,5 +1,5 @@ ---- gc.c.orig 2009-03-27 13:25:23.000000000 +0300 -+++ gc.c 2009-09-29 01:09:29.000000000 +0400 +--- gc.c.orig 2009-12-24 00:28:08.000000000 -0800 ++++ gc.c 2010-01-05 18:02:16.000000000 -0800 @@ -30,6 +30,10 @@ #include <sys/resource.h> #endif @@ -64,7 +64,7 @@ return ret; } -@@ -1599,18 +1620,72 @@ +@@ -1607,18 +1628,72 @@ } rb_gc_stack_start = addr; #endif @@ -141,7 +141,7 @@ } void ruby_init_stack(VALUE *addr -@@ -1631,31 +1706,7 @@ +@@ -1639,31 +1714,7 @@ rb_gc_register_stack_start = (VALUE*)bsp; } #endif @@ -174,12 +174,3 @@ } /* -@@ -1980,7 +2031,7 @@ - chain_finalized_object(st_data_t key, st_data_t val, st_data_t arg) - { - RVALUE *p = (RVALUE *)key, **final_list = (RVALUE **)arg; -- if ((p->as.basic.flags & (FL_FINALIZE|FL_MARK)) == FL_FINALIZE) { -+ if ((p->as.basic.flags & (FL_FINALIZE)) == FL_FINALIZE) { - if (BUILTIN_TYPE(p) != T_DEFERRED) { - p->as.free.flags = FL_MARK | T_DEFERRED; /* remain marked */ - RDATA(p)->dfree = 0; diff --git a/lang/ruby18/files/patch-lib_soap_mimemessage.rb b/lang/ruby18/files/patch-lib_soap_mimemessage.rb deleted file mode 100644 index 5399068c516a..000000000000 --- a/lang/ruby18/files/patch-lib_soap_mimemessage.rb +++ /dev/null @@ -1,11 +0,0 @@ ---- lib/soap/mimemessage.rb 2009/05/26 12:20:36 23586 -+++ lib/soap/mimemessage.rb 2009/05/26 12:22:37 23587 -@@ -232,7 +232,7 @@ - end - - def to_s -- str = headers_str + "\r\n\r\n" + conent_str -+ str = headers_str + "\r\n\r\n" + content_str - end - end - diff --git a/lang/ruby18/files/patch-ostruct-fix-frozen b/lang/ruby18/files/patch-ostruct-fix-frozen deleted file mode 100644 index a92eaa46a778..000000000000 --- a/lang/ruby18/files/patch-ostruct-fix-frozen +++ /dev/null @@ -1,46 +0,0 @@ ---- lib/ostruct.rb 2009/05/26 12:00:53 23580 -+++ lib/ostruct.rb 2009/05/26 12:06:21 23581 -@@ -67,28 +67,33 @@ - @table.each_key{|key| new_ostruct_member(key)} - end - -+ def modifiable -+ if self.frozen? -+ raise TypeError, "can't modify frozen #{self.class}", caller(2) -+ end -+ @table -+ end -+ protected :modifiable -+ - def new_ostruct_member(name) - name = name.to_sym - unless self.respond_to?(name) -- meta = class << self; self; end -- meta.send(:define_method, name) { @table[name] } -- meta.send(:define_method, :"#{name}=") { |x| @table[name] = x } -+ class << self; self; end.class_eval do -+ define_method(name) { @table[name] } -+ define_method("#{name}=") { |x| modifiable[name] = x } -+ end - end -+ name - end - - def method_missing(mid, *args) # :nodoc: - mname = mid.id2name - len = args.length -- if mname =~ /=$/ -+ if mname.chomp!('=') - if len != 1 - raise ArgumentError, "wrong number of arguments (#{len} for 1)", caller(1) - end -- if self.frozen? -- raise TypeError, "can't modify frozen #{self.class}", caller(1) -- end -- mname.chop! -- self.new_ostruct_member(mname) -- @table[mname.intern] = args[0] -+ modifiable[new_ostruct_member(mname)] = args[0] - elsif len == 0 - @table[mid] - else diff --git a/lang/ruby18/files/patch-ostruct-recursion-test b/lang/ruby18/files/patch-ostruct-recursion-test deleted file mode 100644 index 3c3d1f54e62c..000000000000 --- a/lang/ruby18/files/patch-ostruct-recursion-test +++ /dev/null @@ -1,39 +0,0 @@ ---- lib/ostruct.rb 2009/05/26 11:54:29 23578 -+++ lib/ostruct.rb 2009/05/26 12:00:44 23579 -@@ -111,25 +111,23 @@ - def inspect - str = "#<#{self.class}" - -- Thread.current[InspectKey] ||= [] -- if Thread.current[InspectKey].include?(self) then -- str << " ..." -- else -+ ids = (Thread.current[InspectKey] ||= []) -+ if ids.include?(object_id) -+ return str << ' ...>' -+ end -+ -+ ids << object_id -+ begin - first = true - for k,v in @table - str << "," unless first - first = false -- -- Thread.current[InspectKey] << v -- begin -- str << " #{k}=#{v.inspect}" -- ensure -- Thread.current[InspectKey].pop -- end -+ str << " #{k}=#{v.inspect}" - end -+ return str << '>' -+ ensure -+ ids.pop - end -- -- str << ">" - end - alias :to_s :inspect - diff --git a/lang/ruby18/files/patch-select-ebadf-fix b/lang/ruby18/files/patch-select-ebadf-fix deleted file mode 100644 index c89483faafb2..000000000000 --- a/lang/ruby18/files/patch-select-ebadf-fix +++ /dev/null @@ -1,106 +0,0 @@ ---- eval.c 2009/05/26 05:24:19 23576 -+++ eval.c 2009/05/26 11:54:05 23577 -@@ -74,7 +74,16 @@ - - #include <time.h> - --#ifdef __BEOS__ -+#if defined(HAVE_FCNTL_H) || defined(_WIN32) -+#include <fcntl.h> -+#elif defined(HAVE_SYS_FCNTL_H) -+#include <sys/fcntl.h> -+#endif -+#ifdef __CYGWIN__ -+#include <io.h> -+#endif -+ -+#if defined(__BEOS__) && !defined(BONE) - #include <net/socket.h> - #endif - -@@ -11084,20 +11093,60 @@ - #ifdef ERESTART - if (e == ERESTART) goto again; - #endif -- FOREACH_THREAD_FROM(curr, th) { -- if (th->wait_for & WAIT_SELECT) { -- int v = 0; -- -- v |= find_bad_fds(&readfds, &th->readfds, th->fd); -- v |= find_bad_fds(&writefds, &th->writefds, th->fd); -- v |= find_bad_fds(&exceptfds, &th->exceptfds, th->fd); -- if (v) { -- th->select_value = n; -- n = max; -- } -- } -- } -- END_FOREACH_FROM(curr, th); -+ if (e == EBADF) { -+ int badfd = -1; -+ int fd; -+ int dummy; -+ for (fd = 0; fd <= max; fd++) { -+ if ((FD_ISSET(fd, &readfds) || -+ FD_ISSET(fd, &writefds) || -+ FD_ISSET(fd, &exceptfds)) && -+ fcntl(fd, F_GETFD, &dummy) == -1 && -+ errno == EBADF) { -+ badfd = fd; -+ break; -+ } -+ } -+ if (badfd != -1) { -+ FOREACH_THREAD_FROM(curr, th) { -+ if (th->wait_for & WAIT_FD) { -+ if (th->fd == badfd) { -+ found = 1; -+ th->status = THREAD_RUNNABLE; -+ th->fd = 0; -+ break; -+ } -+ } -+ if (th->wait_for & WAIT_SELECT) { -+ if (FD_ISSET(badfd, &th->readfds) || -+ FD_ISSET(badfd, &th->writefds) || -+ FD_ISSET(badfd, &th->exceptfds)) { -+ found = 1; -+ th->status = THREAD_RUNNABLE; -+ th->select_value = -EBADF; -+ break; -+ } -+ } -+ } -+ END_FOREACH_FROM(curr, th); -+ } -+ } -+ else { -+ FOREACH_THREAD_FROM(curr, th) { -+ if (th->wait_for & WAIT_SELECT) { -+ int v = 0; -+ -+ v |= find_bad_fds(&readfds, &th->readfds, th->fd); -+ v |= find_bad_fds(&writefds, &th->writefds, th->fd); -+ v |= find_bad_fds(&exceptfds, &th->exceptfds, th->fd); -+ if (v) { -+ th->select_value = n; -+ n = max; -+ } -+ } -+ } -+ END_FOREACH_FROM(curr, th); -+ } - } - if (select_timeout && n == 0) { - if (now < 0.0) now = timeofday(); -@@ -11408,6 +11457,10 @@ - if (read) *read = curr_thread->readfds; - if (write) *write = curr_thread->writefds; - if (except) *except = curr_thread->exceptfds; -+ if (curr_thread->select_value < 0) { -+ errno = -curr_thread->select_value; -+ return -1; -+ } - return curr_thread->select_value; - } - |