### Patch 000-main-ruby18.patch diff -ur ruby-1.8.3.org/Makefile.in ruby-1.8.3/Makefile.in --- ruby-1.8.3.org/Makefile.in Wed Sep 7 01:22:56 2005 +++ ruby-1.8.3/Makefile.in Sun Oct 16 23:51:07 2005 @@ -96,7 +96,7 @@ $(PROGRAM): @$(RM) $@ - $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) $(OUTFLAG)$@ + $(PURIFY) $(CC) $(XLDFLAGS) $(LDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) $(OUTFLAG)$@ # We must `rm' the library each time this rule is invoked because "updating" a # MAB library on Apple/NeXT (see --enable-fat-binary in configure) is not diff -ur ruby-1.8.3.org/config.guess ruby-1.8.3/config.guess --- ruby-1.8.3.org/config.guess Sat Jul 17 04:23:52 2004 +++ ruby-1.8.3/config.guess Sun Oct 16 23:44:11 2005 @@ -1200,7 +1200,7 @@ *86) UNAME_PROCESSOR=i686 ;; powerpc) UNAME_PROCESSOR=powerpc ;; esac - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + echo ${UNAME_PROCESSOR}-apple-darwin exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` diff -ur ruby-1.8.3.org/configure ruby-1.8.3/configure --- ruby-1.8.3.org/configure Wed Sep 21 02:10:31 2005 +++ ruby-1.8.3/configure Sun Oct 16 23:44:11 2005 @@ -14331,7 +14331,7 @@ rhapsody*) : ${LDSHARED='cc -dynamic -bundle -undefined suppress'} : ${LDFLAGS=""} rb_cv_dlopen=yes ;; - darwin*) : ${LDSHARED='cc -dynamic -bundle -undefined suppress -flat_namespace'} + darwin*) : ${LDSHARED='cc -dynamic -bundle -flat_namespace'} : ${LDFLAGS=""} : ${LIBPATHENV=DYLD_LIBRARY_PATH} rb_cv_dlopen=yes ;; @@ -14997,7 +14997,7 @@ ;; esac -RUBY_SO_NAME='$(RUBY_INSTALL_NAME)' +RUBY_SO_NAME=ruby LIBRUBY_LDSHARED=$LDSHARED LIBRUBY_DLDFLAGS=$DLDFLAGS LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR).$(TEENY)' @@ -15084,9 +15084,9 @@ ;; darwin*) LIBRUBY_SO='lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).$(TEENY).dylib' - LIBRUBY_LDSHARED='cc -dynamiclib -undefined suppress -flat_namespace' - LIBRUBY_DLDFLAGS='-install_name $(libdir)/lib$(RUBY_SO_NAME).dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)' - LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_SO_NAME).dylib' + LIBRUBY_LDSHARED='cc -dynamiclib' + LIBRUBY_DLDFLAGS='-install_name $(libdir)/lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)' + LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_SO_NAME).dylib libruby.2.dylib' ;; interix*) LIBRUBYARG_SHARED='-L${libdir} -L. -l$(RUBY_SO_NAME)' diff -ur ruby-1.8.3.org/ext/curses/extconf.rb ruby-1.8.3/ext/curses/extconf.rb --- ruby-1.8.3.org/ext/curses/extconf.rb Wed Feb 9 16:55:35 2005 +++ ruby-1.8.3/ext/curses/extconf.rb Sun Oct 16 23:44:11 2005 @@ -7,9 +7,9 @@ make=false have_library("mytinfo", "tgetent") if /bow/ =~ RUBY_PLATFORM have_library("tinfo", "tgetent") or have_library("termcap", "tgetent") -if have_header(*curses=%w"ncurses.h") and have_library("ncurses", "initscr") +if have_header(*curses=%w"ncurses/curses.h") and have_library("ncurses", "initscr") make=true -elsif have_header(*curses=%w"ncurses/curses.h") and have_library("ncurses", "initscr") +elsif have_header(*curses=%w"ncurses.h") and have_library("ncurses", "initscr") make=true elsif have_header(*curses=%w"curses_colr/curses.h") and have_library("cur_colr", "initscr") curses.unshift("varargs.h") diff -ur ruby-1.8.3.org/lib/mkmf.rb ruby-1.8.3/lib/mkmf.rb --- ruby-1.8.3.org/lib/mkmf.rb Wed Sep 7 01:35:31 2005 +++ ruby-1.8.3/lib/mkmf.rb Sun Oct 16 23:49:20 2005 @@ -1240,7 +1240,7 @@ $CFLAGS = with_config("cflags", arg_config("CFLAGS", config["CFLAGS"])).dup $ARCH_FLAG = with_config("arch_flag", arg_config("ARCH_FLAG", config["ARCH_FLAG"])).dup $CPPFLAGS = with_config("cppflags", arg_config("CPPFLAGS", config["CPPFLAGS"])).dup - $LDFLAGS = (with_config("ldflags") || "").dup + $LDFLAGS = with_config("ldflags", arg_config("LDFLAGS", config["LDFLAGS"])).dup $INCFLAGS = "-I$(topdir)" $DLDFLAGS = with_config("dldflags", arg_config("DLDFLAGS", config["DLDFLAGS"])).dup $LIBEXT = config['LIBEXT'].dup @@ -1341,7 +1341,7 @@ if CONFIG["DLEXT"] == $OBJEXT "ld $(DLDFLAGS) -r -o $@ $(OBJS)\n" else - "$(LDSHARED) $(DLDFLAGS) $(LIBPATH) #{OUTFLAG}$@ " \ + "$(LDSHARED) $(LIBPATH) $(DLDFLAGS) #{OUTFLAG}$@ " \ "$(OBJS) $(LOCAL_LIBS) $(LIBS)" end LIBPATHFLAG = config_string('LIBPATHFLAG') || ' -L"%s"' diff -ur ruby-1.8.3.org/ruby.c ruby-1.8.3/ruby.c --- ruby-1.8.3.org/ruby.c Tue Jun 28 15:09:58 2005 +++ ruby-1.8.3/ruby.c Sun Oct 16 23:42:31 2005 @@ -975,7 +975,13 @@ static struct { char *begin, *end; } envspace; + +#ifdef __APPLE__ +#include +#define environ (*_NSGetEnviron()) +#else extern char **environ; +#endif static void set_arg0space() ### Patch 002-prevent-core-dumps-from-older-installed-rubies.patch diff -ru ruby-1.8.3.orig/Makefile.in ruby-1.8.3/Makefile.in --- ruby-1.8.3.orig/Makefile.in 2005-09-06 16:22:56.000000000 -0700 +++ ruby-1.8.3/Makefile.in 2005-10-26 22:35:36.000000000 -0700 @@ -45,12 +45,15 @@ MAINLIBS = @MAINLIBS@ MINIOBJS = @MINIOBJS@ +extout = $(srcdir)/$(EXTOUT) +RUBYARCHDIR = $(extout)/$(arch)$(target_prefix) + RUBY_INSTALL_NAME=@RUBY_INSTALL_NAME@ RUBY_SO_NAME=@RUBY_SO_NAME@ EXEEXT = @EXEEXT@ PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT) RUBY = $(RUBY_INSTALL_NAME) -MINIRUBY = @MINIRUBY@ +MINIRUBY = DYLD_LIBRARY_PATH=$(srcdir) @MINIRUBY@ -I$(RUBYARCHDIR) RUNRUBY = @RUNRUBY@ #### End of system configuration section. #### diff -ru ruby-1.8.3.orig/common.mk ruby-1.8.3/common.mk --- ruby-1.8.3.orig/common.mk 2005-08-03 08:27:06.000000000 -0700 +++ ruby-1.8.3/common.mk 2005-10-26 21:48:28.000000000 -0700 @@ -54,10 +54,12 @@ --make="$(MAKE)" \ --mflags="$(MFLAGS)" \ --make-flags="$(MAKEFLAGS)" +EXTMK_ARGS_ETC= $(SCRIPT_ARGS) --extout="$(EXTOUT)" --extension etc --extstatic $(EXTSTATIC) -- EXTMK_ARGS = $(SCRIPT_ARGS) --extout="$(EXTOUT)" --extension $(EXTS) --extstatic $(EXTSTATIC) -- all: $(MKFILES) $(PREP) $(RBCONFIG) $(LIBRUBY) - @$(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS) + $(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS_ETC) + $(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS) prog: $(PROGRAM) $(WPROGRAM) miniruby$(EXEEXT): config.status $(LIBRUBY_A) $(MAINOBJ) $(MINIOBJS) $(OBJS) $(DMYEXT) diff -ru ruby-1.8.3.orig/ext/dl/depend ruby-1.8.3/ext/dl/depend --- ruby-1.8.3.orig/ext/dl/depend 2003-10-23 01:59:42.000000000 -0700 +++ ruby-1.8.3/ext/dl/depend 2005-10-26 21:49:24.000000000 -0700 @@ -32,15 +32,15 @@ call.func: $(srcdir)/mkcall.rb ./dlconfig.rb @echo "Generating call.func" - @$(RUBY) $(srcdir)/mkcall.rb > $@ + DYLD_LIBRARY_PATH=../.. $(RUBY) -I../../.ext/powerpc-darwin $(srcdir)/mkcall.rb > $@ callback.func: $(srcdir)/mkcallback.rb ./dlconfig.rb @echo "Generating callback.func" - @$(RUBY) $(srcdir)/mkcallback.rb > $@ + DYLD_LIBRARY_PATH=../.. $(RUBY) -I../../.ext/powerpc-darwin $(srcdir)/mkcallback.rb > $@ cbtable.func: $(srcdir)/mkcbtable.rb ./dlconfig.rb @echo "Generating cbtable.func" - @$(RUBY) $(srcdir)/mkcbtable.rb > $@ + DYLD_LIBRARY_PATH=../.. $(RUBY) -I../../.ext/powerpc-darwin $(srcdir)/mkcbtable.rb > $@ debug: $(MAKE) CPPFLAGS="$(CPPFLAGS) -DDEBUG" ### Patch 003-prevent-dyld-core-dumps-after-setting-argv.patch # Patch for # http://rubyforge.org/tracker/index.php?func=detail&aid=3399&group_id=426&atid=1698 --- ruby-1.8.4/ruby.c.orig 2005-12-11 16:36:52.000000000 -0800 +++ ruby-1.8.4/ruby.c 2006-02-02 12:38:41.000000000 -0800 @@ -1033,43 +1033,47 @@ rb_progname = rb_tainted_str_new(s, i); #else if (len == 0) { - char *s = origargv[0]; - int i; + char *s1 = origargv[0]; + int j; - s += strlen(s); + s1 += strlen(s1); /* See if all the arguments are contiguous in memory */ - for (i = 1; i < origargc; i++) { - if (origargv[i] == s + 1) { - s++; - s += strlen(s); /* this one is ok too */ + for (j = 1; j < origargc; j++) { + if (origargv[j] == s1 + 1) { + s1++; + s1 += strlen(s1); /* this one is ok too */ } else { break; } } #ifndef DOSISH - if (s + 1 == envspace.begin) { - s = envspace.end; + if (s1 + 1 == envspace.begin) { + s1 = envspace.end; ruby_setenv("", NULL); /* duplicate environ vars */ } #endif - len = s - origargv[0]; + len = s1 - origargv[0]; } if (i >= len) { i = len; - memcpy(origargv[0], s, i); - origargv[0][i] = '\0'; } - else { - memcpy(origargv[0], s, i); - s = origargv[0]+i; - *s++ = '\0'; - while (++i < len) - *s++ = ' '; - for (i = 1; i < origargc; i++) - origargv[i] = 0; + memcpy(origargv[0], s, i); + memset(origargv[0] + i, '\0', len - i + 1); + + /* If the new program name is longer than the original one, then + * have any command line arguments that were written over be + * empty strings. */ + s = origargv[0] + i; + for (i = 1; i < origargc; ++i) { + if (origargv[i] < s ) { + origargv[i] = s; + } else { + break; + } } + rb_progname = rb_tainted_str_new2(origargv[0]); #endif } ### Patch 800_delegate.rb.patch Index: lib/delegate.rb =================================================================== RCS file: /var/cvs/src/ruby/lib/delegate.rb,v retrieving revision 1.14.2.12 diff -u -r1.14.2.12 delegate.rb --- ruby-1.8.4/lib/delegate.rb 28 Sep 2005 14:23:24 -0000 1.14.2.12 +++ ruby-1.8.4/lib/delegate.rb 29 Oct 2005 03:22:24 -0000 @@ -140,7 +140,7 @@ rescue Exception $@.delete_if{|s| /:in `__getobj__'$/ =~ s} #` $@.delete_if{|s| /^\\(eval\\):/ =~ s} - Kernel::raise + ::Kernel::raise end end EOS @@ -290,7 +290,7 @@ } for method in methods begin - klass.module_eval <<-EOS + klass.module_eval <<-EOS, __FILE__, __LINE__+1 def #{method}(*args, &block) begin @_dc_obj.__send__(:#{method}, *args, &block) ### Patch 801_yaml_bignum.patch Index: ext/syck/rubyext.c =================================================================== RCS file: /var/cvs/src/ruby/ext/syck/rubyext.c,v retrieving revision 1.30.2.16 diff -u -r1.30.2.16 rubyext.c --- ruby-1.8.4/ext/syck/rubyext.c 13 Oct 2005 14:30:53 -0000 1.30.2.16 +++ ruby-1.8.4/ext/syck/rubyext.c 29 Oct 2005 03:23:03 -0000 @@ -1142,6 +1142,9 @@ } else if ( !NIL_P( target_class ) ) { + if (subclass == rb_cBignum) + obj = rb_str2inum(val, 10); + else obj = rb_obj_alloc( subclass ); if ( rb_respond_to( obj, s_yaml_initialize ) ) { Index: lib/yaml/rubytypes.rb =================================================================== RCS file: /var/cvs/src/ruby/lib/yaml/rubytypes.rb,v retrieving revision 1.16.2.9 diff -u -r1.16.2.9 rubytypes.rb --- ruby-1.8.4/lib/yaml/rubytypes.rb 20 Sep 2005 06:46:45 -0000 1.16.2.9 +++ ruby-1.8.4/lib/yaml/rubytypes.rb 29 Oct 2005 03:23:03 -0000 @@ -372,6 +372,10 @@ yaml_as "tag:yaml.org,2002:int" end +class Bignum + yaml_as "tag:yaml.org,2002:int#yes" +end + class Float yaml_as "tag:yaml.org,2002:float" end ### Patch 802_yaml_symbol.patch http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=344042 http://rubyforge.org/tracker/?func=detail&aid=2535&group_id=426&atid=1698 diff -u -r1.16.2.9 rubytypes.rb --- ruby-1.8.4/lib/yaml/rubytypes.rb 20 Sep 2005 06:46:45 -0000 1.16.2.9 +++ ruby-1.8.4/lib/yaml/rubytypes.rb 25 Dec 2005 04:02:48 -0000 @@ -183,6 +183,7 @@ yaml_as "tag:ruby.yaml.org,2002:sym" def Symbol.yaml_new( klass, tag, val ) if String === val + val = YAML::load( val ) if val =~ /\A(["']).*\1\z/ val.intern else raise YAML::TypeError, "Invalid Symbol: " + val.inspect ### Patch 900_ri_pager.patch Index: lib/rdoc/ri/ri_display.rb =================================================================== RCS file: /var/cvs/src/ruby/lib/rdoc/ri/ri_display.rb,v retrieving revision 1.1.2.3 diff -u -r1.1.2.3 ri_display.rb --- ruby-1.8.4/lib/rdoc/ri/ri_display.rb 24 Mar 2004 19:17:42 -0000 1.1.2.3 +++ ruby-1.8.4/lib/rdoc/ri/ri_display.rb 29 Oct 2005 03:24:38 -0000 @@ -222,7 +222,7 @@ STDOUT.reopen(@save_stdout) @save_stdout = nil paged = false - for pager in [ ENV['PAGER'], "less", "more <", 'pager' ].compact.uniq + for pager in [ ENV['PAGER'], 'pager', "less", "more <" ].compact.uniq if system("#{pager} #{path}") paged = true break ### Patch 901_.document.patch Index: lib/.document =================================================================== RCS file: /var/cvs/src/ruby/lib/.document,v retrieving revision 1.1.2.9 diff -u -r1.1.2.9 .document --- ruby-1.8.4/lib/.document 15 Dec 2005 15:57:05 -0000 1.1.2.9 +++ ruby-1.8.4/lib/.document 17 Dec 2005 04:03:16 -0000 @@ -13,29 +13,44 @@ cgi complex.rb date.rb +date delegate.rb erb.rb +drb.rb +drb English.rb fileutils.rb find.rb forwardable.rb generator.rb +gserver.rb +ipaddr.rb logger.rb matrix.rb +monitor.rb +net observer.rb -optionparser.rb +open-uri.rb +optparse +optparse.rb +ostruct.rb pathname.rb +pp.rb pstore.rb rational.rb +rexml +rinda set.rb shellwords.rb singleton.rb tempfile.rb -test/unit.rb +test thread.rb thwait.rb time.rb timeout.rb tmpdir.rb +tsort.rb +uri.rb uri yaml.rb Index: lib/cgi/.document =================================================================== RCS file: /var/cvs/src/ruby/lib/cgi/.document,v retrieving revision 1.1.2.1 diff -u -r1.1.2.1 .document --- ruby-1.8.4/lib/cgi/.document 26 Feb 2004 13:50:40 -0000 1.1.2.1 +++ ruby-1.8.4/lib/cgi/.document 17 Dec 2005 04:03:17 -0000 @@ -1,2 +1,2 @@ +session session.rb -