diff -uNr ruby-1.8.4/Makefile.in ruby-1.8.4-new/Makefile.in --- ruby-1.8.4/Makefile.in 2005-11-10 18:22:03.000000000 -0500 +++ ruby-1.8.4-new/Makefile.in 2006-08-05 18:21:28.000000000 -0400 @@ -46,12 +46,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=$(topdir):$(extout):$(RUBYARCHDIR) @MINIRUBY@ -I$(RUBYARCHDIR) -I$(srcdir) RUNRUBY = @RUNRUBY@ #### End of system configuration section. #### @@ -97,7 +100,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 -uNr ruby-1.8.4/common.mk ruby-1.8.4-new/common.mk --- ruby-1.8.4/common.mk 2005-11-16 09:25:49.000000000 -0500 +++ ruby-1.8.4-new/common.mk 2006-08-05 18:21:28.000000000 -0400 @@ -56,10 +56,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 -uNr ruby-1.8.4/config.guess ruby-1.8.4-new/config.guess --- ruby-1.8.4/config.guess 2004-07-16 22:23:52.000000000 -0400 +++ ruby-1.8.4-new/config.guess 2006-08-05 18:21:28.000000000 -0400 @@ -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 -uNr ruby-1.8.4/configure ruby-1.8.4-new/configure --- ruby-1.8.4/configure 2005-12-24 07:36:33.000000000 -0500 +++ ruby-1.8.4-new/configure 2006-08-05 18:21:28.000000000 -0400 @@ -14394,7 +14394,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 -undefined dynamic_lookup -multiply_defined suppress'} : ${LDFLAGS=""} : ${LIBPATHENV=DYLD_LIBRARY_PATH} rb_cv_dlopen=yes ;; @@ -15064,7 +15064,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)' @@ -15151,9 +15151,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 -uNr ruby-1.8.4/ext/curses/extconf.rb ruby-1.8.4-new/ext/curses/extconf.rb --- ruby-1.8.4/ext/curses/extconf.rb 2005-02-09 10:55:35.000000000 -0500 +++ ruby-1.8.4-new/ext/curses/extconf.rb 2006-08-05 18:21:28.000000000 -0400 @@ -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 -uNr ruby-1.8.4/ext/dl/depend ruby-1.8.4-new/ext/dl/depend --- ruby-1.8.4/ext/dl/depend 2003-10-23 04:59:42.000000000 -0400 +++ ruby-1.8.4-new/ext/dl/depend 2006-08-08 02:42:39.000000000 -0400 @@ -32,15 +32,15 @@ call.func: $(srcdir)/mkcall.rb ./dlconfig.rb @echo "Generating call.func" - @$(RUBY) $(srcdir)/mkcall.rb > $@ + DYLD_LIBRARY_PATH=$(topdir):$(extout):$(RUBYARCHDIR) $(topdir)/$(RUBY_INSTALL_NAME) -I../../.ext/*-darwin -I../.. -I../../lib $(srcdir)/mkcall.rb > $@ callback.func: $(srcdir)/mkcallback.rb ./dlconfig.rb @echo "Generating callback.func" - @$(RUBY) $(srcdir)/mkcallback.rb > $@ + DYLD_LIBRARY_PATH=$(topdir):$(extout):$(RUBYARCHDIR) $(topdir)/$(RUBY_INSTALL_NAME) -I../../.ext/*-darwin -I../.. -I../../lib $(srcdir)/mkcallback.rb > $@ cbtable.func: $(srcdir)/mkcbtable.rb ./dlconfig.rb @echo "Generating cbtable.func" - @$(RUBY) $(srcdir)/mkcbtable.rb > $@ + DYLD_LIBRARY_PATH=$(topdir):$(extout):$(RUBYARCHDIR) $(topdir)/$(RUBY_INSTALL_NAME) -I../../.ext/*-darwin -I../.. -I../../lib $(srcdir)/mkcbtable.rb > $@ debug: $(MAKE) CPPFLAGS="$(CPPFLAGS) -DDEBUG" diff -uNr ruby-1.8.4/ext/syck/rubyext.c ruby-1.8.4-new/ext/syck/rubyext.c --- ruby-1.8.4/ext/syck/rubyext.c 2005-12-19 23:13:26.000000000 -0500 +++ ruby-1.8.4-new/ext/syck/rubyext.c 2006-08-05 18:21:28.000000000 -0400 @@ -1157,6 +1157,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 ) ) { diff -uNr ruby-1.8.4/lib/.document ruby-1.8.4-new/lib/.document --- ruby-1.8.4/lib/.document 2005-12-15 10:57:05.000000000 -0500 +++ ruby-1.8.4-new/lib/.document 2006-08-05 18:21:28.000000000 -0400 @@ -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 diff -uNr ruby-1.8.4/lib/cgi/.document ruby-1.8.4-new/lib/cgi/.document --- ruby-1.8.4/lib/cgi/.document 2004-02-26 08:50:40.000000000 -0500 +++ ruby-1.8.4-new/lib/cgi/.document 2006-08-05 18:21:28.000000000 -0400 @@ -1,2 +1,2 @@ +session session.rb - diff -uNr ruby-1.8.4/lib/delegate.rb ruby-1.8.4-new/lib/delegate.rb --- ruby-1.8.4/lib/delegate.rb 2005-09-28 10:23:24.000000000 -0400 +++ ruby-1.8.4-new/lib/delegate.rb 2006-08-05 18:21:28.000000000 -0400 @@ -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) diff -uNr ruby-1.8.4/lib/mkmf.rb ruby-1.8.4-new/lib/mkmf.rb --- ruby-1.8.4/lib/mkmf.rb 2005-11-27 19:22:53.000000000 -0500 +++ ruby-1.8.4-new/lib/mkmf.rb 2006-08-05 18:21:28.000000000 -0400 @@ -1269,7 +1269,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 @@ -1370,7 +1370,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 -uNr ruby-1.8.4/lib/rdoc/ri/ri_display.rb ruby-1.8.4-new/lib/rdoc/ri/ri_display.rb --- ruby-1.8.4/lib/rdoc/ri/ri_display.rb 2004-03-24 14:17:42.000000000 -0500 +++ ruby-1.8.4-new/lib/rdoc/ri/ri_display.rb 2006-08-05 18:21:28.000000000 -0400 @@ -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 diff -uNr ruby-1.8.4/lib/yaml/rubytypes.rb ruby-1.8.4-new/lib/yaml/rubytypes.rb --- ruby-1.8.4/lib/yaml/rubytypes.rb 2005-09-20 02:46:45.000000000 -0400 +++ ruby-1.8.4-new/lib/yaml/rubytypes.rb 2006-08-05 18:21:28.000000000 -0400 @@ -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 @@ -372,6 +373,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 diff -uNr ruby-1.8.4/ruby.c ruby-1.8.4-new/ruby.c --- ruby-1.8.4/ruby.c 2005-12-11 19:36:52.000000000 -0500 +++ ruby-1.8.4-new/ruby.c 2006-08-05 18:21:28.000000000 -0400 @@ -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() @@ -1033,43 +1039,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 }