diff --git a/.cvsignore b/.cvsignore index e4e63dc..89ca5b2 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,6 +1,2 @@ -ruby-1.8.6-p388.tar.bz2 -ruby-refm-rdp-1.8.2-ja-html.tar.gz -rubyfaq-990927.tar.gz -rubyfaq-jp-990927.tar.gz -ruby-1.8.6-p399.tar.bz2 -ruby-1.8-rev27738_trunk-ext_tk.tar.gz +ruby-1.8.7-p299.tar.bz2 +ruby-rev415a3ef9ab82c65a7abc-ext_tk.tar.gz diff --git a/irb.1 b/irb.1 deleted file mode 100644 index 7fc9828..0000000 --- a/irb.1 +++ /dev/null @@ -1,488 +0,0 @@ -.\" DO NOT MODIFY THIS FILE! it was generated by rd2 -.TH irb-beta 1 "May 2001" -.SH What is irb? -.PP -irb stands for `interactive ruby'. irb is a tool to execute interactively -ruby expressions read from stdin. -.SH Invoking -.PP -.nf -\& % ruby \-r irb \-e0 -\& % irb -.fi -Either of the aboves. In the former style, options can be specified -as follows: -.nf -\& % ruby \-r irb \-e0 \-\- \-v -.fi -.SH Usage -.PP -Use of irb is easy if you know ruby. Executing irb, prompts are -displayed as follows. Then, enter expression of ruby. A input is -executed when it is syntacticaly completed. -.nf -\& dim% irb -\& irb(main):001:0> 1+2 -\& 3 -\& irb(main):002:0> class Foo -\& irb(main):003:1> def foo -\& irb(main):004:2> print 1 -\& irb(main):005:2> end -\& irb(main):006:1> end -\& nil -\& irb(main):007:0> -.fi -And, Readline extesion module can be used with irb. Using Readline -is the standard default action if Readline is installed. -.SH Command line option -.PP -.nf -\& irb.rb [options] file_name opts -\& options: -\& \-f suppress read ~/.irbrc -\& \-m bc mode (fraction or matrix are available) -\& \-d set $DEBUG to true (same as `ruby \-d') -\& \-r load\-module same as `ruby \-r' -\& \-\-inspect uses `inspect' for output (the default except bc mode) -\& \-\-noinspect doesn't uses inspect for output -\& \-\-readline uses Readline extension module -\& \-\-noreadline doesn't use Readline extension module -\& \-\-prompt prompt\-mode -\& \-\-prompt\-mode prompt\-mode -.fi -.nf -\& switches prompt mode. Pre\-defined prompt modes are -\& `defalut', `simple', `xmp' and `inf\-ruby' -.fi -.nf -\& \-\-inf\-ruby\-mode uses prompt appreciate for inf\-ruby\-mode on emacs. -.fi -.nf -\& Suppresses \-\-readline. -.fi -.nf -\& \-\-simple\-prompt simple prompt mode -\& \-\-noprompt no prompt -\& \-\-tracer display trace for each execution of commands. -\& \-\-back\-trace\-limit n -.fi -.nf -\& displayes backtrace top n and tail n. The default -\& value is 16. -.fi -.nf -\& \-\-irb_debug n sets internal debug level to n (It shouldn't be used) -\& \-v, \-\-version prints the version of irb -.fi -.SH Configurations -.PP -irb reads `~/.irbrc' when it is invoked. If `~/.irbrb' doesn't exist -irb try to read in the order `.irbrc', `irb.rc', `_irbrc' then `$irbrc'. -The following is altanative to the command line option. To use them -type as follows in an irb session. -.nf -\& IRB.conf[:IRB_NAME]="irb" -\& IRB.conf[:MATH_MODE]=false -\& IRB.conf[:USE_TRACER]=false -\& IRB.conf[:USE_LOADER]=false -\& IRB.conf[:IGNORE_SIGINT]=true -\& IRB.conf[:IGNORE_EOF]=false -\& IRB.conf[:INSPECT_MODE]=nil -\& IRB.conf[:IRB_RC] = nil -\& IRB.conf[:BACK_TRACE_LIMIT]=16 -\& IRB.conf[:USE_LOADER] = false -\& IRB.conf[:USE_READLINE] = nil -\& IRB.conf[:USE_TRACER] = false -\& IRB.conf[:IGNORE_SIGINT] = true -\& IRB.conf[:IGNORE_EOF] = false -\& IRB.conf[:PROMPT_MODE] = :DEFALUT -\& IRB.conf[:PROMPT] = {...} -\& IRB.conf[:DEBUG_LEVEL]=0 -\& IRB.conf[:VERBOSE]=true -.fi -.SH Customizing prompt -.PP -To costomize the prompt you set a variable -.nf -\& IRB.conf[:PROMPT] -.fi -For example, describe as follows in `.irbrc'. -.nf -\& IRB.conf[:PROMPT][:MY_PROMPT] = { # name of prompt mode -\& :PROMPT_I => nil, # normal prompt -\& :PROMPT_S => nil, # prompt for continuated strings -\& :PROMPT_C => nil, # prompt for continuated statement -\& :RETURN => " ==>%s\\n" # format to return value -\& } -.fi -Then, invoke irb with the above prompt mode by -.nf -\& % irb \-\-prompt my\-prompt -.fi -Or add the following in `.irbrc'. -.nf -\& IRB.conf[:PROMPT_MODE] = :MY_PROMPT -.fi -Constants PROMPT_I, PROMPT_S and PROMPT_C specifies the format. -In the prompt specification, some special strings are available. -.nf -\& %N command name which is running -\& %m to_s of main object (self) -\& %M inspect of main object (self) -\& %l type of string(", ', /, ]), `]' is inner %w[...] -\& %NNi indent level. NN is degits and means as same as printf("%NNd"). -\& It can be ommited -\& %NNn line number. -\& %% % -.fi -For instance, the default prompt mode is defined as follows: -IRB.conf[:PROMPT_MODE][:DEFAULT] = { - -.TP -.fi -.B -PROMPT_I => "%N(%m):%03n:%i> ", - - -.TP -.fi -.B -PROMPT_S => "%N(%m):%03n:%i%l ", - - -.TP -.fi -.B -PROMPT_C => "%N(%m):%03n:%i* ", - - -.TP -.fi -.B -RETURN => "%s\\n" -} -RETURN is used to printf. -.SH Configurating subirb -.PP -The command line option or IRB.conf specify the default behavior of -(sub)irb. On the other hand, each conf of in the next sction `6. Command' -is used to individually configurate (sub)irb. -If proc is set to IRB.conf[:IRB_RC], its subirb will be invoked after -execution of that proc under giving the context of irb as its -aregument. By this mechanism each subirb can be configurated. -.SH Command -.PP -For irb commands, both simple name and `irb_'\-prefixed name are prepared. - -.TP -.fi -.B -exit, quit, irb_exit -Quits (sub)irb. -if you've done cb (see below), exit from the binding mode. - - -.TP -.fi -.B -conf, irb_context -Displays current configuration. Modifing the configuration is -achieved by sending message to `conf'. - - -.TP -.fi -.B -conf.back_trace_limit -Sets display lines of backtrace as top n and tail n. -The default value is 16. - - -.TP -.fi -.B -conf.debug_level = N -Sets debug level of irb. - - -.TP -.fi -.B -conf.ignore_eof = true/false -Whether ^D (control\-d) will be ignored or not. -If false is set, ^D means quit. - - -.TP -.fi -.B -conf.ignore_sigint= true/false -Whether ^C (control\-c) will be ignored or not. -If false is set, ^D means quit. If true, - -.nf -\& during input: cancel inputing then return to top level. -\& during execute: abondon current execution. -.fi - - -.TP -.fi -.B -conf.inf_ruby_mode = true/false -Whether inf\-ruby\-mode or not. The default value is false. - - -.TP -.fi -.B -conf.inspect_mode = true/false/nil -Specifies inspect mode. -true: display inspect -false: display to_s -nil: inspect mode in non math mode, - -.nf -\& non inspect mode in math mode. -.fi - - -.TP -.fi -.B -conf.irb_level -The level of cb. - - -.TP -.fi -.B -conf.math_mode -Whether bc mode or not. - - -.TP -.fi -.B -conf.use_loader = true/false -Whether irb's own file reader method is used when load/require or not. -This mode is globaly affected (irb wide). - - -.TP -.fi -.B -conf.prompt_c -prompt for a continuating statement (e.g, immediately after of `if') - - -.TP -.fi -.B -conf.prompt_i -standard prompt - - -.TP -.fi -.B -conf.prompt_s -prompt for a continuating string - - -.TP -.fi -.B -conf.rc -Whether ~/.irbrc is read or not. - - -.TP -.fi -.B -conf.use_prompt = true/false -Prompting or not. - - -.TP -.fi -.B -conf.use_readline = true/false/nil -Whether readline is used or not. -true: uses -false: doen't use -nil: intends to use readline except for inf\-reuby\-mode (default) - - -.TP -.fi -.B -conf.verbose=T/F -Whether verbose messages are display or not. - - -.TP -.fi -.B -cb, irb_change_binding [obj] -Enter new binding which has a distinct scope of local variables. -If obj is given, obj will be self. - - -.TP -.fi -.B -irb [obj] -Invoke subirb. If obj is given, obj will be self. - - -.TP -.fi -.B -jobs, irb_jobs -List of subirb - - -.TP -.fi -.B -fg n, irb_fg n -Switch into specified subirb. The following is candidates of n: - -.nf -\& irb number -\& thhread -\& irb object -\& self(obj which is specified of irb obj) -.fi - - -.TP -.fi -.B -kill n, irb_kill n -Kill subirb. The means of n is as same as the case of irb_fg. -.SH System variable -.PP -.nf -\& _ The latest value of evaluation (it is local) -.fi -.SH Session Example -.PP -.nf -\& dim% ruby irb.rb -\& irb(main):001:0> irb # invoke subirb -\& irb#1(main):001:0> jobs # list of subirbs -\& #0\->irb on main (# : stop) -\& #1\->irb#1 on main (# : running) -\& nil -\& irb#1(main):002:0> fg 0 # switch job -\& nil -\& irb(main):002:0> class Foo;end -\& nil -\& irb(main):003:0> irb Foo # invoke subirb which has the -.fi -.nf -\& # context of Foo -.fi -.nf -\& irb#2(Foo):001:0> def foo # define Foo#foo -\& irb#2(Foo):002:1> print 1 -\& irb#2(Foo):003:1> end -\& nil -\& irb#2(Foo):004:0> fg 0 # switch job -\& nil -\& irb(main):004:0> jobs # list of job -\& #0\->irb on main (# : running) -\& #1\->irb#1 on main (# : stop) -\& #2\->irb#2 on Foo (# : stop) -\& nil -\& irb(main):005:0> Foo.instance_methods # Foo#foo is defined asurely -\& ["foo"] -\& irb(main):006:0> fg 2 # switch job -\& nil -\& irb#2(Foo):005:0> def bar # define Foo#bar -\& irb#2(Foo):006:1> print "bar" -\& irb#2(Foo):007:1> end -\& nil -\& irb#2(Foo):010:0> Foo.instance_methods -\& ["bar", "foo"] -\& irb#2(Foo):011:0> fg 0 -\& nil -\& irb(main):007:0> f = Foo.new -\& # -\& irb(main):008:0> irb f # invoke subirb which has the -.fi -.nf -\& # context of f (instance of Foo) -.fi -.nf -\& irb#3(#):001:0> jobs -\& #0\->irb on main (# : stop) -\& #1\->irb#1 on main (# : stop) -\& #2\->irb#2 on Foo (# : stop) -\& #3\->irb#3 on # (# : running) -\& nil -\& irb#3(#):002:0> foo # evaluate f.foo -\& 1nil -\& irb#3(#):003:0> bar # evaluate f.bar -\& barnil -\& irb#3(#):004:0> kill 1, 2, 3# kill job -\& nil -\& irb(main):009:0> jobs -\& #0\->irb on main (# : running) -\& nil -\& irb(main):010:0> exit # exit -\& dim% -.fi -.SH Restrictions -.PP -Because irb evaluates the inputs immediately after the imput is -syntactically completed, irb gives slight different result than -directly use ruby. Known difference is pointed out here. -.SH Declaration of the local variable -.PP -The following causes an error in ruby: -.nf -\& eval "foo = 0" -\& foo -\& \-\- -\& \-:2: undefined local variable or method `foo' for # (NameError) -\& \-\-\- -\& NameError -.fi -Though, the above will successfully done by irb. -.nf -\& >> eval "foo = 0" -.fi -.nf -\& => 0 -\& >> foo -\& => 0 -.fi -Ruby evaluates a code after reading entire of code and determination -of the scope of local variables. On the other hand, irb do -immediately. More precisely, irb evaluate at first -.nf -\& evel "foo = 0" -.fi -then foo is defined on this timing. It is because of this -incompatibility. -If you'd like to detect those differences, begin...end can be used: -.nf -\& >> begin -\& ?> eval "foo = 0" -\& >> foo -\& >> end -\& NameError: undefined local variable or method `foo' for # -\& (irb):3 -\& (irb_local_binding):1:in `eval' -.fi -.SH Here\-document -.PP -Implementation of Here\-document is incomplete. -.SH Symbol -.PP -Irb can not always recognize a symbol as to be Symbol. Concretely, an -expression have completed, however Irb regard it as continuation line. - diff --git a/ruby-1.8.6-openssl-digest-once-revert-for-simplify-patch.patch b/ruby-1.8.6-openssl-digest-once-revert-for-simplify-patch.patch deleted file mode 100644 index 336254a..0000000 --- a/ruby-1.8.6-openssl-digest-once-revert-for-simplify-patch.patch +++ /dev/null @@ -1,15 +0,0 @@ -Index: ruby_1_8_6/ext/openssl/ossl_digest.c -=================================================================== ---- ruby_1_8_6/ext/openssl/ossl_digest.c (revision 12042) -+++ ruby_1_8_6/ext/openssl/ossl_digest.c (revision 12043) -@@ -264,6 +264,10 @@ - void - Init_ossl_digest() - { -+#if 0 /* let rdoc know about mOSSL */ -+ mOSSL = rb_define_module("OpenSSL"); -+#endif -+ - mDigest = rb_define_module_under(mOSSL, "Digest"); - - eDigestError = rb_define_class_under(mDigest, "DigestError", eOSSLError); diff --git a/ruby-1.8.6-p287-CVE-2008-5189.patch b/ruby-1.8.6-p287-CVE-2008-5189.patch deleted file mode 100644 index 2854826..0000000 --- a/ruby-1.8.6-p287-CVE-2008-5189.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- lib/cgi.rb (revision 19665) -+++ lib/cgi.rb (working copy) -@@ -546,6 +546,11 @@ - when Hash - options = options.dup - end -+ options.each_value do |value| -+ if /\n(?![ \t])/ === value -+ raise ArgumentError, "potential HTTP header injection detected" -+ end -+ end - - unless options.has_key?("type") - options["type"] = "text/html" diff --git a/ruby-1.8.6-p287-remove-ssl-rand-range.patch b/ruby-1.8.6-p287-remove-ssl-rand-range.patch deleted file mode 100644 index 705f3d3..0000000 --- a/ruby-1.8.6-p287-remove-ssl-rand-range.patch +++ /dev/null @@ -1,100 +0,0 @@ -diff -ur ruby-1.8.6-p287.orig/ext/openssl/openssl_missing.c ruby-1.8.6-p287/ext/openssl/openssl_missing.c ---- ruby-1.8.6-p287.orig/ext/openssl/openssl_missing.c 2007-02-13 00:01:19.000000000 +0100 -+++ ruby-1.8.6-p287/ext/openssl/openssl_missing.c 2009-03-15 05:32:31.000000000 +0100 -@@ -43,7 +43,7 @@ - { - return CRYPTO_set_ex_data(&str->ex_data, idx, data); - } -- -+ - void *X509_STORE_get_ex_data(X509_STORE *str, int idx) - { - return CRYPTO_get_ex_data(&str->ex_data, idx); -@@ -113,7 +113,7 @@ - #endif - - #if !defined(HAVE_EVP_CIPHER_CTX_COPY) --/* -+/* - * this function does not exist in OpenSSL yet... or ever?. - * a future version may break this function. - * tested on 0.9.7d. -@@ -182,12 +182,12 @@ - (ASN1_STRING *)(*a)->serialNumber, - (ASN1_STRING *)(*b)->serialNumber)); - } -- -+ - int - X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev) - { - X509_CRL_INFO *inf; -- -+ - inf = crl->crl; - if (!inf->revoked) - inf->revoked = sk_X509_REVOKED_new(OSSL_X509_REVOKED_cmp); -@@ -233,54 +233,6 @@ - } - #endif - --#if !defined(HAVE_BN_RAND_RANGE) || !defined(HAVE_BN_PSEUDO_RAND_RANGE) --static int --bn_rand_range(int pseudo, BIGNUM *r, BIGNUM *range) --{ -- int (*bn_rand)(BIGNUM *, int, int, int) = pseudo ? BN_pseudo_rand : BN_rand; -- int n; -- -- if (range->neg || BN_is_zero(range)) return 0; -- -- n = BN_num_bits(range); -- -- if (n == 1) { -- if (!BN_zero(r)) return 0; -- } else if (!BN_is_bit_set(range, n - 2) && !BN_is_bit_set(range, n - 3)) { -- do { -- if (!bn_rand(r, n + 1, -1, 0)) return 0; -- if (BN_cmp(r ,range) >= 0) { -- if (!BN_sub(r, r, range)) return 0; -- if (BN_cmp(r, range) >= 0) -- if (!BN_sub(r, r, range)) return 0; -- } -- } while (BN_cmp(r, range) >= 0); -- } else { -- do { -- if (!bn_rand(r, n, -1, 0)) return 0; -- } while (BN_cmp(r, range) >= 0); -- } -- -- return 1; --} --#endif -- --#if !defined(HAVE_BN_RAND_RANGE) --int --BN_rand_range(BIGNUM *r, BIGNUM *range) --{ -- return bn_rand_range(0, r, range); --} --#endif -- --#if !defined(HAVE_BN_PSEUDO_RAND_RANGE) --int --BN_pseudo_rand_range(BIGNUM *r, BIGNUM *range) --{ -- return bn_rand_range(1, r, range); --} --#endif -- - #if !defined(HAVE_CONF_GET1_DEFAULT_CONFIG_FILE) - #define OPENSSL_CONF "openssl.cnf" - char * -@@ -315,7 +267,7 @@ - { - int i,j; - const char *prompt; -- -+ - if (key) { - i = strlen(key); - i = (i > num) ? num : i; diff --git a/ruby-1.8.6-p369-ri-gem_multipath.patch b/ruby-1.8.6-p369-ri-gem_multipath.patch deleted file mode 100644 index 2c069d8..0000000 --- a/ruby-1.8.6-p369-ri-gem_multipath.patch +++ /dev/null @@ -1,130 +0,0 @@ -Mon Dec 24 16:18:57 2007 Eric Hodel - - * lib/rdoc/ri/ri_options.rb: Fix ri --help listing of gem ri paths. - Merge of r14567 and r14569 from trunk. - - * lib/rdoc/ri/ri_paths.rb: Fix duplication of ri data for multiple - gems. Merge of r14567 from trunk - -Index: ruby_1_8/lib/rdoc/ri/ri_options.rb -=================================================================== ---- ruby_1_8/lib/rdoc/ri/ri_options.rb (revision 14581) -+++ ruby_1_8/lib/rdoc/ri/ri_options.rb (revision 14582) -@@ -62,10 +62,11 @@ - (RI::Paths::HOMEDIR || "No ~/.rdoc found") ], - - [ "--gems", nil, nil, -- "Include documentation from Rubygems:\n " + -- (RI::Paths::GEMDIRS ? "#{Gem.path}/doc/*/ri" : -- "No Rubygems ri found.") ], -- -+ "Include documentation from RubyGems:\n" + -+ (RI::Paths::GEMDIRS ? -+ Gem.path.map { |dir| " #{dir}/doc/*/ri" }.join("\n") : -+ "No Rubygems ri found.") ], -+ - [ "--format", "-f", "", - "Format to use when displaying output:\n" + - " " + RI::TextFormatter.list + "\n" + -@@ -116,7 +117,8 @@ - def OptionList.error(msg) - $stderr.puts - $stderr.puts msg -- $stderr.puts "\nFor help on options, try 'ri --help'\n\n" -+ name = File.basename $PROGRAM_NAME -+ $stderr.puts "\nFor help on options, try '#{name} --help'\n\n" - exit 1 - end - -@@ -136,7 +138,11 @@ - RI::Paths::HOMEDIR - ] - -- directories << "#{Gem.path}/doc/*/ri" if RI::Paths::GEMDIRS -+ if RI::Paths::GEMDIRS then -+ Gem.path.each do |dir| -+ directories << "#{dir}/doc/*/ri" -+ end -+ end - - directories = directories.join("\n ") - -@@ -157,16 +163,16 @@ - - For example: - -- ri File -- ri File.new -- ri F.n -- ri zip -+ #{name} File -+ #{name} File.new -+ #{name} F.n -+ #{name} zip - - Note that shell quoting may be required for method names - containing punctuation: - -- ri 'Array.[]' -- ri compact\\! -+ #{name} 'Array.[]' -+ #{name} compact\\! - - By default ri searches for documentation in the following - directories: -@@ -180,8 +186,8 @@ - EOT - - if short_form -- puts "For help on options, type 'ri -h'" -- puts "For a list of classes I know about, type 'ri -c'" -+ puts "For help on options, type '#{name} -h'" -+ puts "For a list of classes I know about, type '#{name} -c'" - else - puts "Options:\n\n" - OPTION_LIST.each do|long, short, arg, desc| -Index: ruby_1_8/lib/rdoc/ri/ri_paths.rb -=================================================================== ---- ruby_1_8/lib/rdoc/ri/ri_paths.rb (revision 14581) -+++ ruby_1_8/lib/rdoc/ri/ri_paths.rb (revision 14582) -@@ -44,8 +44,29 @@ - - begin - require 'rubygems' -- GEMDIRS = Dir["#{Gem.path}/doc/*/ri"] -- GEMDIRS.each { |path| RI::Paths::PATH << path } -+ -+ # HACK dup'd from Gem.latest_partials and friends -+ all_paths = [] -+ -+ all_paths = Gem.path.map do |dir| -+ Dir[File.join(dir, 'doc', '*', 'ri')] -+ end.flatten -+ -+ ri_paths = {} -+ -+ all_paths.each do |dir| -+ base = File.basename File.dirname(dir) -+ if base =~ /(.*)-((\d+\.)*\d+)/ then -+ name, version = $1, $2 -+ ver = Gem::Version.new version -+ if ri_paths[name].nil? or ver > ri_paths[name][0] then -+ ri_paths[name] = [ver, dir] -+ end -+ end -+ end -+ -+ GEMDIRS = ri_paths.map { |k,v| v.last }.sort -+ GEMDIRS.each { |dir| RI::Paths::PATH << dir } - rescue LoadError - GEMDIRS = nil - end -@@ -55,7 +76,7 @@ - - def self.path(use_system, use_site, use_home, use_gems, *extra_dirs) - path = raw_path(use_system, use_site, use_home, use_gems, *extra_dirs) -- return path.select { |path| File.directory? path } -+ return path.select { |directory| File.directory? directory } - end - - # Returns the selected documentation directories including nonexistent diff --git a/ruby-1.8.6-p383-mkmf-use-shared.patch b/ruby-1.8.6-p383-mkmf-use-shared.patch deleted file mode 100644 index fb0e6a5..0000000 --- a/ruby-1.8.6-p383-mkmf-use-shared.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ruby-1.8.6-p383/lib/mkmf.rb.static 2009-03-31 18:19:39.000000000 +0900 -+++ ruby-1.8.6-p383/lib/mkmf.rb 2009-12-09 15:03:19.000000000 +0900 -@@ -275,7 +275,7 @@ - 'LDFLAGS' => "#$LDFLAGS #{ldflags}", - 'LIBPATH' => libpathflag(libpath), - 'LOCAL_LIBS' => "#$LOCAL_LIBS #$libs", -- 'LIBS' => "#$LIBRUBYARG_STATIC #{opt} #$LIBS") -+ 'LIBS' => "#$LIBRUBYARG_SHARED #{opt} #$LIBS") - Config::expand(TRY_LINK.dup, conf) - end - diff --git a/ruby-1.8.6-p383-rubyprefix.patch b/ruby-1.8.6-p383-rubyprefix.patch deleted file mode 100644 index 1f0fa43..0000000 --- a/ruby-1.8.6-p383-rubyprefix.patch +++ /dev/null @@ -1,97 +0,0 @@ -diff -ur ruby-1.8.6-p383.0-deadcode/configure.in ruby-1.8.6-p383/configure.in ---- ruby-1.8.6-p383.0-deadcode/configure.in 2009-07-20 15:24:22.000000000 +0200 -+++ ruby-1.8.6-p383/configure.in 2009-10-22 16:37:13.729623476 +0200 -@@ -1613,6 +1613,13 @@ - rubyw_install_name="$RUBYW_INSTALL_NAME" - ;; - esac -+ -+AC_ARG_WITH(ruby-prefix, -+ AC_HELP_STRING([--with-ruby-prefix], [build ruby with the special library prefix.]) -+ ,, -+ with_ruby_prefix=no) -+ -+if test "x$with_ruby_prefix" = "x"; then - case "$target_os" in - cygwin*|mingw*|*djgpp*|os2-emx*) - RUBY_LIB_PREFIX="/lib/ruby" -@@ -1621,20 +1628,30 @@ - RUBY_LIB_PREFIX="`eval "echo ${libdir}"`/ruby" - ;; - esac -+else -+ RUBY_LIB_PREFIX="${with_ruby_prefix}/ruby" -+fi - RUBY_LIB_PATH="${RUBY_LIB_PREFIX}/${MAJOR}.${MINOR}" -+RUBY_LIB_PATH2="${libdir}/ruby/${MAJOR}.${MINOR}" - - AC_ARG_WITH(sitedir, - [ --with-sitedir=DIR site libraries in DIR [PREFIX/lib/ruby/site_ruby]], - [sitedir=$withval], - [sitedir="`eval "echo ${libdir}"`/ruby/site_ruby"]) --SITE_DIR=`eval echo \\"${sitedir}\\"` -+SITE_DIR=`eval echo \\"${sitedir}\\" | sed -e "s/lib64/lib/"` -+_fc_sitedir="\$(DESTDIR)${sitedir}" -+SITE_DIR2=`eval echo \\"${_fc_sitedir}\\"` -+sitedir=`eval echo \\"${sitedir}\\" | sed -e "s/lib64/lib/"` -+ - case "$target_os" in - cygwin*|mingw*|*djgpp*|os2-emx*) - RUBY_SITE_LIB_PATH="`expr "$SITE_DIR" : "$prefix\(/.*\)"`" || - RUBY_SITE_LIB_PATH="$SITE_DIR";; - *) -- RUBY_SITE_LIB_PATH="$SITE_DIR";; -+ RUBY_SITE_LIB_PATH="$SITE_DIR"; -+ RUBY_SITE_LIB_PATH2="$SITE_DIR2";; - esac -+RUBY_SITE_LIB_PATH3="${RUBY_SITE_LIB_PATH2}/${MAJOR}.${MINOR}" - RUBY_SITE_LIB_PATH2="${RUBY_SITE_LIB_PATH}/${MAJOR}.${MINOR}" - - AC_DEFINE_UNQUOTED(RUBY_LIB, "${RUBY_LIB_PATH}") -@@ -1644,6 +1661,7 @@ - AC_SUBST(arch)dnl - AC_SUBST(sitearch)dnl - AC_SUBST(sitedir)dnl -+AC_SUBST(_fc_sitedir)dnl - - configure_args=$ac_configure_args - AC_SUBST(configure_args)dnl -@@ -1652,7 +1670,7 @@ - arch="fat-${target_os}" - - AC_DEFINE_UNQUOTED(RUBY_THIN_ARCHLIB, -- "${RUBY_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}") -+ "${RUBY_LIB_PATH2}/" __ARCHITECTURE__ "-${target_os}") - - AC_DEFINE_UNQUOTED(RUBY_SITE_THIN_ARCHLIB, - "${RUBY_SITE_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}") -@@ -1667,8 +1685,8 @@ - *) sitearch="${arch}" ;; - esac - --AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, "${RUBY_LIB_PATH}/${arch}") --AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, "${RUBY_SITE_LIB_PATH2}/${sitearch}") -+AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, "${RUBY_LIB_PATH2}/${arch}") -+AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, "${RUBY_SITE_LIB_PATH3}/${sitearch}") - - AC_ARG_WITH(search-path, - [ --with-search-path=DIR specify the additional search path], -Only in ruby-1.8.6-p383/: configure.in.orig -Only in ruby-1.8.6-p383/: configure.in.rej -diff -ur ruby-1.8.6-p383.0-deadcode/mkconfig.rb ruby-1.8.6-p383/mkconfig.rb ---- ruby-1.8.6-p383.0-deadcode/mkconfig.rb 2008-06-07 18:37:10.000000000 +0200 -+++ ruby-1.8.6-p383/mkconfig.rb 2009-10-22 16:30:55.776872493 +0200 -@@ -139,10 +139,10 @@ - print(*v_others) - print < - * ext/openssl/digest.c ext/openssl/lib/openssl/digest.rb: - Commit patch #9280 from Akinori MUSHA. - Simplify the OpenSSL::Digest class and make use of the - existing Digest framework. - Enhance performance. - -Thu Apr 5 14:58:49 2007 Technorama Ltd. - * ext/openssl/ossl_pkcs5.c: New module. - - * ext/openssl/ossl_{cipher,digest,pkcs7,pkcs12}.c: - Remove redundant module namespace. - - * ext/openssl/lib/openssl/{cipher,digest}.rb - Add backwards compatibile classes for rearranged classes. - - * ext/openssl/ossl_{pkcs7,pkcs12}.c: Add documentation. - -Index: ruby_1_8/ext/openssl/lib/openssl/digest.rb -=================================================================== ---- ruby_1_8/ext/openssl/lib/openssl/digest.rb (revision 11708) -+++ ruby_1_8/ext/openssl/lib/openssl/digest.rb (revision 15600) -@@ -19,13 +19,17 @@ - #require 'openssl' - - module OpenSSL -- module Digest -+ class Digest - - alg = %w(DSS DSS1 MD2 MD4 MD5 MDC2 RIPEMD160 SHA SHA1) - if OPENSSL_VERSION_NUMBER > 0x00908000 - alg += %w(SHA224 SHA256 SHA384 SHA512) - end - -+ def self.digest(name, data) -+ super(data, name) -+ end -+ - alg.each{|name| - klass = Class.new(Digest){ - define_method(:initialize){|*data| -@@ -44,6 +48,14 @@ - const_set(name, klass) - } - -+ # This class is only provided for backwards compatibility. Use OpenSSL::Digest in the future. -+ class Digest < Digest -+ def initialize(*args) -+ # add warning -+ super(*args) -+ end -+ end -+ - end # Digest - end # OpenSSL - -Index: ruby_1_8/ext/openssl/ossl_digest.c -=================================================================== ---- ruby_1_8/ext/openssl/ossl_digest.c (revision 11708) -+++ ruby_1_8/ext/openssl/ossl_digest.c (revision 15600) -@@ -24,7 +24,6 @@ - /* - * Classes - */ --VALUE mDigest; - VALUE cDigest; - VALUE eDigestError; - -@@ -36,11 +35,23 @@ - const EVP_MD * - GetDigestPtr(VALUE obj) - { -- EVP_MD_CTX *ctx; -+ const EVP_MD *md; - -- SafeGetDigest(obj, ctx); -+ if (TYPE(obj) == T_STRING) { -+ const char *name = STR2CSTR(obj); - -- return EVP_MD_CTX_md(ctx); /*== ctx->digest*/ -+ md = EVP_get_digestbyname(name); -+ if (!md) -+ ossl_raise(rb_eRuntimeError, "Unsupported digest algorithm (%s).", name); -+ } else { -+ EVP_MD_CTX *ctx; -+ -+ SafeGetDigest(obj, ctx); -+ -+ md = EVP_MD_CTX_md(ctx); -+ } -+ -+ return md; - } - - VALUE -@@ -51,7 +62,6 @@ - - ret = ossl_digest_alloc(cDigest); - GetDigest(ret, ctx); -- EVP_MD_CTX_init(ctx); - EVP_DigestInit_ex(ctx, md, NULL); - - return ret; -@@ -69,14 +79,18 @@ - ctx = EVP_MD_CTX_create(); - if (ctx == NULL) - ossl_raise(rb_eRuntimeError, "EVP_MD_CTX_create() failed"); -- EVP_MD_CTX_init(ctx); - obj = Data_Wrap_Struct(klass, 0, EVP_MD_CTX_destroy, ctx); -- -+ - return obj; - } - - VALUE ossl_digest_update(VALUE, VALUE); - -+/* -+ * call-seq: -+ * Digest.new(string) -> digest -+ * -+ */ - static VALUE - ossl_digest_initialize(int argc, VALUE *argv, VALUE self) - { -@@ -86,14 +100,9 @@ - VALUE type, data; - - rb_scan_args(argc, argv, "11", &type, &data); -- StringValue(type); -+ md = GetDigestPtr(type); - if (!NIL_P(data)) StringValue(data); -- name = StringValuePtr(type); -- -- md = EVP_get_digestbyname(name); -- if (!md) { -- ossl_raise(rb_eRuntimeError, "Unsupported digest algorithm (%s).", name); -- } -+ - GetDigest(self, ctx); - EVP_DigestInit_ex(ctx, md, NULL); - -@@ -118,6 +127,11 @@ - return self; - } - -+/* -+ * call-seq: -+ * digest.reset -> self -+ * -+ */ - static VALUE - ossl_digest_reset(VALUE self) - { -@@ -129,6 +143,11 @@ - return self; - } - -+/* -+ * call-seq: -+ * digest.update(string) -> aString -+ * -+ */ - VALUE - ossl_digest_update(VALUE self, VALUE data) - { -@@ -136,126 +155,77 @@ - - StringValue(data); - GetDigest(self, ctx); -- EVP_DigestUpdate(ctx, RSTRING(data)->ptr, RSTRING(data)->len); -+ EVP_DigestUpdate(ctx, RSTRING_PTR(data), RSTRING_LEN(data)); - - return self; - } - --static void --digest_final(EVP_MD_CTX *ctx, char **buf, int *buf_len) --{ -- EVP_MD_CTX final; -- -- if (!EVP_MD_CTX_copy(&final, ctx)) { -- ossl_raise(eDigestError, NULL); -- } -- if (!(*buf = OPENSSL_malloc(EVP_MD_CTX_size(&final)))) { -- EVP_MD_CTX_cleanup(&final); -- ossl_raise(eDigestError, "Cannot allocate mem for digest"); -- } -- EVP_DigestFinal_ex(&final, *buf, buf_len); -- EVP_MD_CTX_cleanup(&final); --} -- -+/* -+ * call-seq: -+ * digest.finish -> aString -+ * -+ */ - static VALUE --ossl_digest_digest(VALUE self) -+ossl_digest_finish(int argc, VALUE *argv, VALUE self) - { - EVP_MD_CTX *ctx; -- char *buf; -- int buf_len; -- VALUE digest; -- -- GetDigest(self, ctx); -- digest_final(ctx, &buf, &buf_len); -- digest = ossl_buf2str(buf, buf_len); -- -- return digest; --} -+ VALUE str; - --static VALUE --ossl_digest_hexdigest(VALUE self) --{ -- EVP_MD_CTX *ctx; -- char *buf, *hexbuf; -- int buf_len; -- VALUE hexdigest; -+ rb_scan_args(argc, argv, "01", &str); - - GetDigest(self, ctx); -- digest_final(ctx, &buf, &buf_len); -- if (string2hex(buf, buf_len, &hexbuf, NULL) != 2 * buf_len) { -- OPENSSL_free(buf); -- ossl_raise(eDigestError, "Memory alloc error"); -+ -+ if (NIL_P(str)) { -+ str = rb_str_new(NULL, EVP_MD_CTX_size(ctx)); -+ } else { -+ StringValue(str); -+ rb_str_resize(str, EVP_MD_CTX_size(ctx)); - } -- OPENSSL_free(buf); -- hexdigest = ossl_buf2str(hexbuf, 2 * buf_len); - -- return hexdigest; --} -+ EVP_DigestFinal_ex(ctx, RSTRING_PTR(str), NULL); - --static VALUE --ossl_digest_s_digest(VALUE klass, VALUE str, VALUE data) --{ -- VALUE obj = rb_class_new_instance(1, &str, klass); -- -- ossl_digest_update(obj, data); -- -- return ossl_digest_digest(obj); -+ return str; - } - -+/* -+ * call-seq: -+ * digest.name -> string -+ * -+ */ - static VALUE --ossl_digest_s_hexdigest(VALUE klass, VALUE str, VALUE data) -+ossl_digest_name(VALUE self) - { -- VALUE obj = rb_class_new_instance(1, &str, klass); -- -- ossl_digest_update(obj, data); -- -- return ossl_digest_hexdigest(obj); --} -- --static VALUE --ossl_digest_equal(VALUE self, VALUE other) --{ - EVP_MD_CTX *ctx; -- VALUE str1, str2; - -- if (rb_obj_is_kind_of(other, cDigest) == Qtrue) { -- str2 = ossl_digest_digest(other); -- } else { -- StringValue(other); -- str2 = other; -- } - GetDigest(self, ctx); -- if (RSTRING(str2)->len == EVP_MD_CTX_size(ctx)) { -- str1 = ossl_digest_digest(self); -- } else { -- str1 = ossl_digest_hexdigest(self); -- } -- if (RSTRING(str1)->len == RSTRING(str2)->len -- && rb_str_cmp(str1, str2) == 0) { -- return Qtrue; -- } - -- return Qfalse; -+ return rb_str_new2(EVP_MD_name(EVP_MD_CTX_md(ctx))); - } - -+/* -+ * call-seq: -+ * digest.digest_size -> integer -+ * -+ * Returns the output size of the digest. -+ */ - static VALUE --ossl_digest_name(VALUE self) -+ossl_digest_size(VALUE self) - { - EVP_MD_CTX *ctx; - - GetDigest(self, ctx); - -- return rb_str_new2(EVP_MD_name(EVP_MD_CTX_md(ctx))); -+ return INT2NUM(EVP_MD_CTX_size(ctx)); - } - - static VALUE --ossl_digest_size(VALUE self) -+ossl_digest_block_length(VALUE self) - { - EVP_MD_CTX *ctx; - - GetDigest(self, ctx); - -- return INT2NUM(EVP_MD_CTX_size(ctx)); -+ return INT2NUM(EVP_MD_CTX_block_size(ctx)); - } - - /* -@@ -264,31 +234,26 @@ - void - Init_ossl_digest() - { -- mDigest = rb_define_module_under(mOSSL, "Digest"); -+ rb_require("openssl"); -+ rb_require("digest"); -+ -+#if 0 /* let rdoc know about mOSSL */ -+ mOSSL = rb_define_module("OpenSSL"); -+#endif -+ -+ cDigest = rb_define_class_under(mOSSL, "Digest", rb_path2class("Digest::Class")); -+ eDigestError = rb_define_class_under(cDigest, "DigestError", eOSSLError); - -- eDigestError = rb_define_class_under(mDigest, "DigestError", eOSSLError); -- -- cDigest = rb_define_class_under(mDigest, "Digest", rb_cObject); -- - rb_define_alloc_func(cDigest, ossl_digest_alloc); -- rb_define_singleton_method(cDigest, "digest", ossl_digest_s_digest, 2); -- rb_define_singleton_method(cDigest, "hexdigest", ossl_digest_s_hexdigest, 2); -- -+ - rb_define_method(cDigest, "initialize", ossl_digest_initialize, -1); -- rb_define_method(cDigest, "reset", ossl_digest_reset, 0); -- - rb_define_copy_func(cDigest, ossl_digest_copy); -- -- rb_define_method(cDigest, "digest", ossl_digest_digest, 0); -- rb_define_method(cDigest, "hexdigest", ossl_digest_hexdigest, 0); -- rb_define_alias(cDigest, "inspect", "hexdigest"); -- rb_define_alias(cDigest, "to_s", "hexdigest"); -- -+ rb_define_method(cDigest, "reset", ossl_digest_reset, 0); - rb_define_method(cDigest, "update", ossl_digest_update, 1); - rb_define_alias(cDigest, "<<", "update"); -- -- rb_define_method(cDigest, "==", ossl_digest_equal, 1); -- -+ rb_define_private_method(cDigest, "finish", ossl_digest_finish, -1); -+ rb_define_method(cDigest, "digest_length", ossl_digest_size, 0); -+ rb_define_method(cDigest, "block_length", ossl_digest_block_length, 0); -+ - rb_define_method(cDigest, "name", ossl_digest_name, 0); -- rb_define_method(cDigest, "size", ossl_digest_size, 0); - } diff --git a/ruby-1.8.7-always-use-i386.patch b/ruby-1.8.7-always-use-i386.patch new file mode 100644 index 0000000..ad0dca1 --- /dev/null +++ b/ruby-1.8.7-always-use-i386.patch @@ -0,0 +1,11 @@ +--- ruby-1.8.7-p299/configure.in.orig 2010-06-24 16:09:00.000000000 -0400 ++++ ruby-1.8.7-p299/configure.in 2010-06-24 16:09:13.000000000 -0400 +@@ -1802,6 +1802,8 @@ AC_SUBST(vendordir)dnl + configure_args=$ac_configure_args + AC_SUBST(configure_args)dnl + ++target_cpu=`echo $target_cpu | sed s/i.86/i386/` ++ + if test "$fat_binary" != no ; then + arch="fat-${target_os}" + diff --git a/ruby-1.8.7-lib-paths.patch b/ruby-1.8.7-lib-paths.patch new file mode 100644 index 0000000..4cef830 --- /dev/null +++ b/ruby-1.8.7-lib-paths.patch @@ -0,0 +1,228 @@ +--- ruby-1.8.7-p249/Makefile.in.orig 2010-06-15 17:51:14.000000000 -0400 ++++ ruby-1.8.7-p249/Makefile.in 2010-06-15 17:56:54.000000000 -0400 +@@ -24,6 +24,9 @@ datadir = @datadir@ + arch = @arch@ + sitearch = @sitearch@ + sitedir = @sitedir@ ++sitearchdir = @sitearchdir@ ++vendordir = @vendordir@ ++vendorarchdir = @vendorarchdir@ + + TESTUI = console + TESTS = +--- ruby-1.8.7-p249/mkconfig.rb.orig2 2010-06-15 18:19:29.000000000 -0400 ++++ ruby-1.8.7-p249/mkconfig.rb 2010-06-15 18:19:33.000000000 -0400 +@@ -141,12 +141,12 @@ print(*v_fast) + print(*v_others) + print < "#$LDFLAGS #{ldflags}", + 'LIBPATH' => libpathflag(libpath), + 'LOCAL_LIBS' => "#$LOCAL_LIBS #$libs", +- 'LIBS' => "#$LIBRUBYARG_STATIC #{opt} #$LIBS") ++ 'LIBS' => "#$LIBRUBYARG_SHARED #{opt} #$LIBS") + Config::expand(TRY_LINK.dup, conf) + end + diff --git a/ruby-1.8.x-RHASH_SIZE-rb_hash_lookup-def.patch b/ruby-1.8.x-RHASH_SIZE-rb_hash_lookup-def.patch deleted file mode 100644 index 503a6b4..0000000 --- a/ruby-1.8.x-RHASH_SIZE-rb_hash_lookup-def.patch +++ /dev/null @@ -1,65 +0,0 @@ -Sat Apr 19 18:42:04 2008 Akinori MUSHA - - * intern.h, hash.c (rb_hash_lookup): New internal function to - check if a key exists in a hash, ignoring #default; backported - from 1.9. - -Thu Aug 30 08:24:18 2007 Tanaka Akira - - * ruby.h (RHASH_TBL): defined for compatibility to 1.9. - * (RHASH_ITER_LEV): ditto. - * (RHASH_IFNONE): ditto. - * (RHASH_SIZE): ditto. - * (RHASH_EMPTY_P): ditto. - -Index: ruby_1_8/ruby.h -=================================================================== ---- ruby_1_8/ruby.h (revision 13310) -+++ ruby_1_8/ruby.h (revision 13311) -@@ -374,6 +374,11 @@ - int iter_lev; - VALUE ifnone; - }; -+#define RHASH_TBL(h) (RHASH(h)->tbl) -+#define RHASH_ITER_LEV(h) (RHASH(h)->iter_lev) -+#define RHASH_IFNONE(h) (RHASH(h)->ifnone) -+#define RHASH_SIZE(h) (RHASH(h)->tbl->num_entries) -+#define RHASH_EMPTY_P(h) (RHASH_SIZE(h) == 0) - - struct RFile { - struct RBasic basic; -Index: ruby_1_8/hash.c -=================================================================== ---- ruby_1_8/hash.c (revision 16077) -+++ ruby_1_8/hash.c (revision 16078) -@@ -454,6 +454,18 @@ - return val; - } - -+VALUE -+rb_hash_lookup(hash, key) -+ VALUE hash, key; -+{ -+ VALUE val; -+ -+ if (!st_lookup(RHASH(hash)->tbl, key, &val)) { -+ return Qnil; /* without Hash#default */ -+ } -+ return val; -+} -+ - /* - * call-seq: - * hsh.fetch(key [, default] ) => obj -Index: ruby_1_8/intern.h -=================================================================== ---- ruby_1_8/intern.h (revision 16077) -+++ ruby_1_8/intern.h (revision 16078) -@@ -270,6 +270,7 @@ - VALUE rb_hash_new _((void)); - VALUE rb_hash_freeze _((VALUE)); - VALUE rb_hash_aref _((VALUE, VALUE)); -+VALUE rb_hash_lookup _((VALUE, VALUE)); - VALUE rb_hash_aset _((VALUE, VALUE, VALUE)); - VALUE rb_hash_delete_if _((VALUE)); - VALUE rb_hash_delete _((VALUE,VALUE)); diff --git a/ruby-1.8.x-ext_tk-flatten-level-revert.patch b/ruby-1.8.x-ext_tk-flatten-level-revert.patch deleted file mode 100644 index 7d57b37..0000000 --- a/ruby-1.8.x-ext_tk-flatten-level-revert.patch +++ /dev/null @@ -1,58 +0,0 @@ -Index: ruby-1.8-rev27736_trunk/ext/tk/lib/tk/pack.rb -=================================================================== ---- ruby-1.8-rev27736_trunk/ext/tk/lib/tk/pack.rb (revision 27738) -+++ ruby-1.8-rev27736_trunk/ext/tk/lib/tk/pack.rb (working copy) -@@ -39,7 +39,23 @@ - end - fail ArgumentError, 'no widget is given' if args.empty? - params = [] -- args.flatten(1).each{|win| params.push(_epath(win))} -+ -+ #args.flatten(1).each{|win| params.push(_epath(win))} -+ # -+ # flatten(level) is ruby >=1.8.7 feature, substituting -+ # -+ args_flatten_one = [] -+ args.each {|args1| -+ if args1.is_a? Array then -+ args1.each {|args2| -+ args_flatten_one << args2 -+ } -+ else -+ args_flatten_one << args1 -+ end -+ } -+ args_flatten_one.each{|win| params.push(_epath(win))} -+ - opts.each{|k, v| - params.push("-#{k}") - params.push(_epath(v)) # have to use 'epath' (hash_kv() is unavailable) -Index: ruby-1.8-rev27736_trunk/ext/tk/lib/tk/grid.rb -=================================================================== ---- ruby-1.8-rev27736_trunk/ext/tk/lib/tk/grid.rb (revision 27738) -+++ ruby-1.8-rev27736_trunk/ext/tk/lib/tk/grid.rb (working copy) -@@ -63,7 +63,23 @@ - end - fail ArgumentError, 'no widget is given' if args.empty? - params = [] -- args.flatten(1).each{|win| -+ -+ #args.flatten(1).each{|win| -+ # -+ # flatten(level) is ruby >=1.8.7 feature, substituting -+ # -+ -+ args_flatten_one = [] -+ args.each {|args1| -+ if args1.is_a? Array then -+ args1.each {|args2| -+ args_flatten_one << args2 -+ } -+ else -+ args_flatten_one << args1 -+ end -+ } -+ args_flatten_one.each{|win| - case win - when '-', ?- # RELATIVE PLACEMENT (increase columnspan) - params.push('-') diff --git a/ruby-1.8.x-null-class-must-be-Qnil.patch b/ruby-1.8.x-null-class-must-be-Qnil.patch deleted file mode 100644 index 114a97b..0000000 --- a/ruby-1.8.x-null-class-must-be-Qnil.patch +++ /dev/null @@ -1,21 +0,0 @@ -Sun Mar 1 03:04:19 2009 Akinori MUSHA - - * class.c (rb_singleton_class_clone): Qnil must be used for a null - class reference when we use NIL_P() to check class reference - validity. The bug was exposed by the spec test of Sequel. - - * eval.c (ruby_init): Use NEW_CREF(). - -Index: ruby_1_8/class.c -=================================================================== ---- ruby_1_8/class.c (revision 22678) -+++ ruby_1_8/class.c (revision 22679) -@@ -153,7 +153,7 @@ - data.klass = obj; - break; - default: -- data.klass = 0; -+ data.klass = Qnil; - break; - } - diff --git a/ruby-1.8head-irb-save-history.patch b/ruby-1.8head-irb-save-history.patch deleted file mode 100644 index 9349016..0000000 --- a/ruby-1.8head-irb-save-history.patch +++ /dev/null @@ -1,111 +0,0 @@ -Thu Jul 23 15:04:20 2009 Keiju Ishitsuka - -ruby* lib/irb.rb, lib/irb/init.rb, lib/irb/ext/save-history.rb: add -ruby IRB::irb_at_exit. no use finalizer saving history. [ruby-dev-38563] - -Index: lib/irb/ext/save-history.rb -=================================================================== ---- lib/irb/ext/save-history.rb (revision 24225) -+++ lib/irb/ext/save-history.rb (revision 24254) -@@ -50,23 +50,24 @@ - module HistorySavingAbility - include Readline - -- def HistorySavingAbility.create_finalizer -- proc do -- if num = IRB.conf[:SAVE_HISTORY] and (num = num.to_i) > 0 -- if hf = IRB.conf[:HISTORY_FILE] -- file = File.expand_path(hf) -- end -- file = IRB.rc_file("_history") unless file -- open(file, 'w' ) do |f| -- hist = HISTORY.to_a -- f.puts(hist[-num..-1] || hist) -- end -- end -- end -- end -+# def HistorySavingAbility.create_finalizer -+# proc do -+# if num = IRB.conf[:SAVE_HISTORY] and (num = num.to_i) > 0 -+# if hf = IRB.conf[:HISTORY_FILE] -+# file = File.expand_path(hf) -+# end -+# file = IRB.rc_file("_history") unless file -+# open(file, 'w' ) do |f| -+# hist = HISTORY.to_a -+# f.puts(hist[-num..-1] || hist) -+# end -+# end -+# end -+# end - - def HistorySavingAbility.extended(obj) -- ObjectSpace.define_finalizer(obj, HistorySavingAbility.create_finalizer) -+# ObjectSpace.define_finalizer(obj, HistorySavingAbility.create_finalizer) -+ IRB.conf[:AT_EXIT].push proc{obj.save_history} - obj.load_history - obj - end -@@ -80,6 +81,19 @@ - end - end - end -+ -+ def save_history -+ if num = IRB.conf[:SAVE_HISTORY] and (num = num.to_i) > 0 -+ if history_file = IRB.conf[:HISTORY_FILE] -+ history_file = File.expand_path(history_file) -+ end -+ history_file = IRB.rc_file("_history") unless history_file -+ open(history_file, 'w' ) do |f| -+ hist = HISTORY.to_a -+ f.puts(hist[-num..-1] || hist) -+ end -+ end -+ end - end - end - -Index: lib/irb/init.rb -=================================================================== ---- lib/irb/init.rb (revision 24225) -+++ lib/irb/init.rb (revision 24254) -@@ -114,6 +114,8 @@ - # @CONF[:LC_MESSAGES] = "en" - @CONF[:LC_MESSAGES] = Locale.new - -+ @CONF[:AT_EXIT] = [] -+ - @CONF[:DEBUG_LEVEL] = 1 - end - -Index: lib/irb.rb -=================================================================== ---- lib/irb.rb (revision 24225) -+++ lib/irb.rb (revision 24254) -@@ -65,13 +65,21 @@ - trap("SIGINT") do - irb.signal_handle - end -- -- catch(:IRB_EXIT) do -- irb.eval_input -+ -+ begin -+ catch(:IRB_EXIT) do -+ irb.eval_input -+ end -+ ensure -+ irb_at_exit - end - # print "\n" - end - -+ def IRB.irb_at_exit -+ @CONF[:AT_EXIT].each{|hook| hook.call} -+ end -+ - def IRB.irb_exit(irb, ret) - throw :IRB_EXIT, ret - end diff --git a/ruby-always-use-i386.patch b/ruby-always-use-i386.patch deleted file mode 100644 index 9dc8c87..0000000 --- a/ruby-always-use-i386.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ruby-1.8.6-p287/configure.in.i386 2009-03-16 00:55:15.000000000 +0900 -+++ ruby-1.8.6-p287/configure.in 2009-03-16 01:42:41.000000000 +0900 -@@ -1662,6 +1662,8 @@ - configure_args=$ac_configure_args - AC_SUBST(configure_args)dnl - -+target_cpu=`echo $target_cpu | sed s/i.86/i386/` -+ - if test "$fat_binary" != no ; then - arch="fat-${target_os}" - diff --git a/ruby-deadcode.patch b/ruby-deadcode.patch deleted file mode 100644 index 2cc3654..0000000 --- a/ruby-deadcode.patch +++ /dev/null @@ -1,72 +0,0 @@ -diff -pruN ruby-1.8.6.orig/ext/bigdecimal/bigdecimal.c ruby-1.8.6/ext/bigdecimal/bigdecimal.c ---- ruby-1.8.6.orig/ext/bigdecimal/bigdecimal.c 2007-02-27 20:51:55.000000000 +0900 -+++ ruby-1.8.6/ext/bigdecimal/bigdecimal.c 2007-03-15 21:14:32.000000000 +0900 -@@ -2167,12 +2167,14 @@ VpGetDoubleNegZero(void) /* Returns the - return nzero; - } - -+#if 0 - VP_EXPORT int - VpIsNegDoubleZero(double v) - { - double z = VpGetDoubleNegZero(); - return MemCmp(&v,&z,sizeof(v))==0; - } -+#endif - - VP_EXPORT int - VpException(unsigned short f, const char *str,int always) -diff -pruN ruby-1.8.6.orig/parse.y ruby-1.8.6/parse.y ---- ruby-1.8.6.orig/parse.y 2007-03-03 16:30:46.000000000 +0900 -+++ ruby-1.8.6/parse.y 2007-03-15 21:15:58.000000000 +0900 -@@ -4511,6 +4511,7 @@ rb_node_newnode(type, a0, a1, a2) - return n; - } - -+#if 0 - static enum node_type - nodetype(node) /* for debug */ - NODE *node; -@@ -4524,6 +4525,7 @@ nodeline(node) - { - return nd_line(node); - } -+#endif - - static NODE* - newline_node(node) -diff -pruN ruby-1.8.6.orig/regex.c ruby-1.8.6/regex.c ---- ruby-1.8.6.orig/regex.c 2007-02-27 20:51:55.000000000 +0900 -+++ ruby-1.8.6/regex.c 2007-03-15 21:16:52.000000000 +0900 -@@ -998,6 +998,7 @@ print_partial_compiled_pattern(start, en - } - - -+#if 0 - static void - print_compiled_pattern(bufp) - struct re_pattern_buffer *bufp; -@@ -1006,6 +1007,7 @@ print_compiled_pattern(bufp) - - print_partial_compiled_pattern(buffer, buffer + bufp->used); - } -+#endif - - static char* - calculate_must_string(start, end) -@@ -2586,6 +2588,7 @@ insert_jump_n(op, from, to, current_end, - - If you call this function, you must zero out pending_exact. */ - -+#if 0 - static void - insert_op(op, there, current_end) - int op; -@@ -2599,6 +2602,7 @@ insert_op(op, there, current_end) - - there[0] = (char)op; - } -+#endif - - - /* Open up space at location THERE, and insert operation OP followed by diff --git a/ruby-deprecated-search-path.patch b/ruby-deprecated-search-path.patch deleted file mode 100644 index aead58e..0000000 --- a/ruby-deprecated-search-path.patch +++ /dev/null @@ -1,51 +0,0 @@ -diff -ruN ruby-1.8.4.orig/configure.in ruby-1.8.4/configure.in ---- ruby-1.8.4.orig/configure.in 2006-04-20 12:53:38.000000000 +0900 -+++ ruby-1.8.4/configure.in 2006-04-20 13:06:07.000000000 +0900 -@@ -1472,12 +1472,16 @@ - esac - RUBY_SITE_LIB_PATH3="${RUBY_SITE_LIB_PATH2}/${MAJOR}.${MINOR}" - RUBY_SITE_LIB_PATH2="${RUBY_SITE_LIB_PATH}/${MAJOR}.${MINOR}" -+RUBY_DEPRECATED_SITE_LIB_PATH="${SITE_DIR2}/${MAJOR}.${MINOR}" - - AC_DEFINE_UNQUOTED(RUBY_LIB, "${RUBY_LIB_PATH}") - AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, "${RUBY_SITE_LIB_PATH}") - AC_DEFINE_UNQUOTED(RUBY_SITE_LIB2, "${RUBY_SITE_LIB_PATH2}") - AC_DEFINE_UNQUOTED(RUBY_DEPRECATED_OLD_SITE_LIB, "${libdir}/site_ruby") - AC_DEFINE_UNQUOTED(RUBY_DEPRECATED_OLD_SITE_LIB2, "${libdir}/site_ruby/${MAJOR}.${MINOR}") -+AC_DEFINE_UNQUOTED(RUBY_DEPRECATED_LIB, "${RUBY_LIB_PATH2}") -+AC_DEFINE_UNQUOTED(RUBY_DEPRECATED_SITE_LIB, "${SITE_DIR2}") -+AC_DEFINE_UNQUOTED(RUBY_DEPRECATED_SITE_LIB2, "${RUBY_DEPRECATED_SITE_LIB_PATH}") - - AC_SUBST(arch)dnl - AC_SUBST(sitearch)dnl -diff -ruN ruby-1.8.4.orig/ruby.c ruby-1.8.4/ruby.c ---- ruby-1.8.4.orig/ruby.c 2005-12-12 09:36:52.000000000 +0900 -+++ ruby-1.8.4/ruby.c 2006-04-20 12:59:50.000000000 +0900 -@@ -292,11 +292,17 @@ - #endif - - incpush(RUBY_RELATIVE(RUBY_SITE_LIB2)); -+#ifdef RUBY_DEPRECATED_SITE_LIB -+ incpush(RUBY_RELATIVE(RUBY_DEPRECATED_SITE_LIB2)); -+#endif - #ifdef RUBY_SITE_THIN_ARCHLIB - incpush(RUBY_RELATIVE(RUBY_SITE_THIN_ARCHLIB)); - #endif - incpush(RUBY_RELATIVE(RUBY_SITE_ARCHLIB)); - incpush(RUBY_RELATIVE(RUBY_SITE_LIB)); -+#ifdef RUBY_DEPRECATED_SITE_LIB -+ incpush(RUBY_RELATIVE(RUBY_DEPRECATED_SITE_LIB)); -+#endif - #ifdef RUBY_DEPRECATED_OLD_SITE_LIB2 - incpush(RUBY_RELATIVE(RUBY_DEPRECATED_OLD_SITE_LIB2)); - #endif -@@ -308,6 +314,9 @@ - #endif - - incpush(RUBY_RELATIVE(RUBY_LIB)); -+#ifdef RUBY_DEPRECATED_LIB -+ incpush(RUBY_RELATIVE(RUBY_DEPRECATED_LIB)); -+#endif - #ifdef RUBY_THIN_ARCHLIB - incpush(RUBY_RELATIVE(RUBY_THIN_ARCHLIB)); - #endif diff --git a/ruby-deprecated-sitelib-search-path.patch b/ruby-deprecated-sitelib-search-path.patch deleted file mode 100644 index 5711727..0000000 --- a/ruby-deprecated-sitelib-search-path.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff -ruN ruby-1.8.4.orig/configure.in ruby-1.8.4/configure.in ---- ruby-1.8.4.orig/configure.in 2006-06-07 13:58:03.000000000 +0900 -+++ ruby-1.8.4/configure.in 2006-06-07 15:54:36.000000000 +0900 -@@ -1476,6 +1476,8 @@ - AC_DEFINE_UNQUOTED(RUBY_LIB, "${RUBY_LIB_PATH}") - AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, "${RUBY_SITE_LIB_PATH}") - AC_DEFINE_UNQUOTED(RUBY_SITE_LIB2, "${RUBY_SITE_LIB_PATH2}") -+AC_DEFINE_UNQUOTED(RUBY_DEPRECATED_OLD_SITE_LIB, "${libdir}/site_ruby") -+AC_DEFINE_UNQUOTED(RUBY_DEPRECATED_OLD_SITE_LIB2, "${libdir}/site_ruby/${MAJOR}.${MINOR}") - - AC_SUBST(arch)dnl - AC_SUBST(sitearch)dnl -@@ -1506,6 +1508,7 @@ - - AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, "${RUBY_LIB_PATH2}/${arch}") - AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, "${RUBY_SITE_LIB_PATH3}/${sitearch}") -+AC_DEFINE_UNQUOTED(RUBY_DEPRECATED_OLD_SITE_ARCHLIB, "${libdir}/site_ruby/${MAJOR}.${MINOR}/${sitearch}") - - AC_ARG_WITH(search-path, - [ --with-search-path=DIR specify the additional search path], -diff -ruN ruby-1.8.4.orig/ruby.c ruby-1.8.4/ruby.c ---- ruby-1.8.4.orig/ruby.c 2005-12-12 09:36:52.000000000 +0900 -+++ ruby-1.8.4/ruby.c 2006-06-07 15:56:14.000000000 +0900 -@@ -297,6 +297,15 @@ - #endif - incpush(RUBY_RELATIVE(RUBY_SITE_ARCHLIB)); - incpush(RUBY_RELATIVE(RUBY_SITE_LIB)); -+#ifdef RUBY_DEPRECATED_OLD_SITE_LIB2 -+ incpush(RUBY_RELATIVE(RUBY_DEPRECATED_OLD_SITE_LIB2)); -+#endif -+#ifdef RUBY_DEPRECATED_OLD_SITE_ARCHLIB -+ incpush(RUBY_RELATIVE(RUBY_DEPRECATED_OLD_SITE_ARCHLIB)); -+#endif -+#ifdef RUBY_DEPRECATED_OLD_SITE_LIB -+ incpush(RUBY_RELATIVE(RUBY_DEPRECATED_OLD_SITE_LIB)); -+#endif - - incpush(RUBY_RELATIVE(RUBY_LIB)); - #ifdef RUBY_THIN_ARCHLIB diff --git a/ruby-mode-init.el b/ruby-mode-init.el deleted file mode 100644 index fcd99db..0000000 --- a/ruby-mode-init.el +++ /dev/null @@ -1,20 +0,0 @@ -;; ruby-mode-init.el -;; Created: 2002-02-01 -;; -(if (featurep 'xemacs) - (setq load-path (cons "/usr/lib/xemacs/xemacs-packages/lisp/ruby-mode" load-path)) - (setq load-path (cons "/usr/share/emacs/site-lisp/ruby-mode" load-path))) - - -(autoload 'ruby-mode "ruby-mode" "Mode for editing ruby source files" t) -(setq auto-mode-alist - (cons '("\\.rb$" . ruby-mode) auto-mode-alist)) -(setq interpreter-mode-alist - (cons '("ruby" . ruby-mode) interpreter-mode-alist)) - -(autoload 'run-ruby "inf-ruby" "Run an inferior Ruby process") -(autoload 'inf-ruby-keys "inf-ruby" "Set local key defs for inf-ruby in ruby-mode") - -(add-hook 'ruby-mode-hook - '(lambda () - (inf-ruby-keys))) diff --git a/ruby-multilib.patch b/ruby-multilib.patch deleted file mode 100644 index 5f2f75b..0000000 --- a/ruby-multilib.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ruN ruby-1.8.3.orig/mkconfig.rb ruby-1.8.3/mkconfig.rb ---- ruby-1.8.3.orig/mkconfig.rb 2005-09-21 15:10:57.000000000 +0900 -+++ ruby-1.8.3/mkconfig.rb 2005-09-21 15:17:32.000000000 +0900 -@@ -74,7 +74,7 @@ - - drive = File::PATH_SEPARATOR == ';' - --prefix = '/lib/ruby/' + RUBY_VERSION.sub(/\.\d+$/, '') + '/' + RUBY_PLATFORM -+prefix = '/lib64/ruby/' + RUBY_VERSION.sub(/\.\d+$/, '') + '/' + RUBY_PLATFORM - print " TOPDIR = File.dirname(__FILE__).chomp!(#{prefix.dump})\n" - print " DESTDIR = ", (drive ? "TOPDIR && TOPDIR[/\\A[a-z]:/i] || " : ""), "'' unless defined? DESTDIR\n" - print " CONFIG = {}\n" diff --git a/ruby-openssl-1.0.patch b/ruby-openssl-1.0.patch deleted file mode 100644 index 508fd75..0000000 --- a/ruby-openssl-1.0.patch +++ /dev/null @@ -1,176 +0,0 @@ -diff -up ruby-1.8.6.369/ruby-1.8.6-p369/ext/openssl/ossl.c.ossl10 ruby-1.8.6.369/ruby-1.8.6-p369/ext/openssl/ossl.c ---- ruby-1.8.6.369/ruby-1.8.6-p369/ext/openssl/ossl.c.ossl10 2007-02-13 00:01:19.000000000 +0100 -+++ ruby-1.8.6.369/ruby-1.8.6-p369/ext/openssl/ossl.c 2009-08-26 12:29:41.000000000 +0200 -@@ -92,7 +92,7 @@ ossl_x509_ary2sk(VALUE ary) - - #define OSSL_IMPL_SK2ARY(name, type) \ - VALUE \ --ossl_##name##_sk2ary(STACK *sk) \ -+ossl_##name##_sk2ary(STACK_OF(type) *sk) \ - { \ - type *t; \ - int i, num; \ -@@ -102,7 +102,7 @@ ossl_##name##_sk2ary(STACK *sk) \ - OSSL_Debug("empty sk!"); \ - return Qnil; \ - } \ -- num = sk_num(sk); \ -+ num = sk_##type##_num(sk); \ - if (num < 0) { \ - OSSL_Debug("items in sk < -1???"); \ - return rb_ary_new(); \ -@@ -110,7 +110,7 @@ ossl_##name##_sk2ary(STACK *sk) \ - ary = rb_ary_new2(num); \ - \ - for (i=0; id.sign->cert; -- crls = pkcs7->d.sign->crl; - break; - case NID_pkcs7_signedAndEnveloped: - certs = pkcs7->d.signed_and_enveloped->cert; -+ break; -+ default: -+ certs = NULL; -+ } -+ -+ return certs; -+} -+ -+static STACK_OF(X509_CRL) * -+pkcs7_get_crls(VALUE self) -+{ -+ PKCS7 *pkcs7; -+ STACK_OF(X509_CRL) *crls; -+ int i; -+ -+ GetPKCS7(self, pkcs7); -+ i = OBJ_obj2nid(pkcs7->type); -+ switch(i){ -+ case NID_pkcs7_signed: -+ crls = pkcs7->d.sign->crl; -+ break; -+ case NID_pkcs7_signedAndEnveloped: - crls = pkcs7->d.signed_and_enveloped->crl; - break; - default: -- certs = crls = NULL; -+ crls = NULL; - } - -- return want_certs ? certs : crls; -+ return crls; - } - - static VALUE -@@ -581,7 +601,7 @@ ossl_pkcs7_set_certificates(VALUE self, - STACK_OF(X509) *certs; - X509 *cert; - -- certs = pkcs7_get_certs_or_crls(self, 1); -+ certs = pkcs7_get_certs(self); - while((cert = sk_X509_pop(certs))) X509_free(cert); - rb_iterate(rb_each, ary, ossl_pkcs7_set_certs_i, self); - -@@ -591,7 +611,7 @@ ossl_pkcs7_set_certificates(VALUE self, - static VALUE - ossl_pkcs7_get_certificates(VALUE self) - { -- return ossl_x509_sk2ary(pkcs7_get_certs_or_crls(self, 1)); -+ return ossl_x509_sk2ary(pkcs7_get_certs(self)); - } - - static VALUE -@@ -621,7 +641,7 @@ ossl_pkcs7_set_crls(VALUE self, VALUE ar - STACK_OF(X509_CRL) *crls; - X509_CRL *crl; - -- crls = pkcs7_get_certs_or_crls(self, 0); -+ crls = pkcs7_get_crls(self); - while((crl = sk_X509_CRL_pop(crls))) X509_CRL_free(crl); - rb_iterate(rb_each, ary, ossl_pkcs7_set_crls_i, self); - -@@ -631,7 +651,7 @@ ossl_pkcs7_set_crls(VALUE self, VALUE ar - static VALUE - ossl_pkcs7_get_crls(VALUE self) - { -- return ossl_x509crl_sk2ary(pkcs7_get_certs_or_crls(self, 0)); -+ return ossl_x509crl_sk2ary(pkcs7_get_crls(self)); - } - - static VALUE -diff -up ruby-1.8.6.369/ruby-1.8.6-p369/ext/openssl/ossl_ssl.c.ossl10 ruby-1.8.6.369/ruby-1.8.6-p369/ext/openssl/ossl_ssl.c ---- ruby-1.8.6.369/ruby-1.8.6-p369/ext/openssl/ossl_ssl.c.ossl10 2007-03-12 05:12:32.000000000 +0100 -+++ ruby-1.8.6.369/ruby-1.8.6-p369/ext/openssl/ossl_ssl.c 2009-08-26 12:08:48.000000000 +0200 -@@ -89,12 +89,18 @@ static char *ossl_sslctx_attrs[] = { - static char *ossl_ssl_attr_readers[] = { "io", "context", }; - static char *ossl_ssl_attrs[] = { "sync_close", }; - -+#if OPENSSL_VERSION_NUMBER >= 0x10000000L -+#define OSSL_MORE_CONST const -+#define STACK _STACK -+#else -+#define OSSL_MORE_CONST -+#endif - /* - * SSLContext class - */ - struct { - const char *name; -- SSL_METHOD *(*func)(void); -+ OSSL_MORE_CONST SSL_METHOD *(*func)(void); - } ossl_ssl_method_tab[] = { - #define OSSL_SSL_METHOD_ENTRY(name) { #name, name##_method } - OSSL_SSL_METHOD_ENTRY(TLSv1), -@@ -144,7 +150,7 @@ static VALUE - ossl_sslctx_initialize(int argc, VALUE *argv, VALUE self) - { - VALUE ssl_method; -- SSL_METHOD *method = NULL; -+ OSSL_MORE_CONST SSL_METHOD *method = NULL; - SSL_CTX *ctx; - int i; - char *s; -@@ -407,7 +413,7 @@ ossl_sslctx_setup(VALUE self) - } - - static VALUE --ossl_ssl_cipher_to_ary(SSL_CIPHER *cipher) -+ossl_ssl_cipher_to_ary(OSSL_MORE_CONST SSL_CIPHER *cipher) - { - VALUE ary; - int bits, alg_bits; -@@ -805,7 +811,7 @@ static VALUE - ossl_ssl_get_cipher(VALUE self) - { - SSL *ssl; -- SSL_CIPHER *cipher; -+ OSSL_MORE_CONST SSL_CIPHER *cipher; - - Data_Get_Struct(self, SSL, ssl); - if (!ssl) { diff --git a/ruby.spec b/ruby.spec index 38e16cd..144339d 100644 --- a/ruby.spec +++ b/ruby.spec @@ -1,104 +1,76 @@ -%define rubyxver 1.8 -%define rubyver 1.8.6 -%define _patchlevel 399 -%define dotpatchlevel %{?_patchlevel:.%{_patchlevel}} -%define patchlevel %{?_patchlevel:-p%{_patchlevel}} -%define arcver %{rubyver}%{?patchlevel} -%define sitedir %{_libdir}/ruby/site_ruby -# This is required to ensure that noarch files puts under /usr/lib/... for -# multilib because ruby library is installed under /usr/{lib,lib64}/ruby anyway. -%define sitedir2 %{_prefix}/lib/ruby/site_ruby -%define _normalized_cpu %(echo `echo %{_target_cpu} | sed 's/^ppc/powerpc/' | sed -e 's|i.86|i386|'`) - -%define tk_using_svn_number 27738 - -# emacs sitelisp directory -%{!?_emacs_sitelispdir: %global _emacs_sitelispdir %{_datadir}/emacs/site-lisp} -%{!?_emacs_sitestartdir: %global _emacs_sitestartdir %{_datadir}/emacs/site-lisp/site-start.d} +%global rubyxver 1.8 +%global rubyver 1.8.7 +%global _patchlevel 299 + +%global dotpatchlevel %{?_patchlevel:.%{_patchlevel}} +%global patchlevel %{?_patchlevel:-p%{_patchlevel}} +%global arcver %{rubyver}%{?patchlevel} + +%{!?vendorlibbase: %global vendorlibbase %{_prefix}/lib/ruby} +%{!?vendorarchbase: %global vendorarchbase %{_libdir}/ruby} +%{!?sitelibbase: %global sitelibbase %{vendorlibbase}/site_ruby} +%{!?sitearchbase: %global sitearchbase %{vendorarchbase}/site_ruby} + +%global _normalized_cpu %(echo %{_target_cpu} | sed 's/^ppc/powerpc/;s/i.86/i386/') +%global ruby_tk_git_revision 415a3ef9ab82c65a7abc Name: ruby Version: %{rubyver}%{?dotpatchlevel} -Release: 5%{?dist} +Release: 4%{?dist} +# Please check if ruby upstream changes this to "Ruby or GPLv2+" License: Ruby or GPLv2 URL: http://www.ruby-lang.org/ -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6 -BuildRequires: compat-readline5-devel -%else -BuildRequires: readline readline-devel -%endif -BuildRequires: ncurses ncurses-devel gdbm gdbm-devel glibc-devel tcl-devel tk-devel libX11-devel autoconf gcc unzip openssl-devel db4-devel byacc -# Use bison to recreate parse.c (ref: bug 530275 comment 4) + +BuildRequires: compat-readline5-devel +BuildRequires: db4-devel +BuildRequires: gdbm-devel +BuildRequires: libX11-devel +BuildRequires: ncurses-devel +BuildRequires: openssl-devel +BuildRequires: tcl-devel +BuildRequires: tk-devel + +BuildRequires: autoconf BuildRequires: bison -BuildRequires: emacs +BuildRequires: byacc +# Official ruby source release tarball Source0: ftp://ftp.ruby-lang.org/pub/%{name}/%{rubyxver}/%{name}-%{arcver}.tar.bz2 -## Dead link -##Source1: http://www7.tok2.com/home/misc/files/%{name}/%{name}-refm-rdp-1.8.1-ja-html.tar.gz -#Source1: %{name}-refm-rdp-1.8.1-ja-html.tar.gz -Source1: http://elbereth-hp.hp.infoseek.co.jp/files/ruby/refm/old/2005/%{name}-refm-rdp-1.8.2-ja-html.tar.gz -Source2: ftp://ftp.ruby-lang.org/pub/%{name}/doc/rubyfaq-990927.tar.gz -Source3: ftp://ftp.ruby-lang.org/pub/%{name}/doc/rubyfaq-jp-990927.tar.gz -Source4: irb.1 -Source10: ruby-mode-init.el -# -# Source100: contains ext/tk directory of the head of ruby_1_8 branch -# i.e. http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8 -# see bug 560053, 590503, and -# http://lists.fedoraproject.org/pipermail/ruby-sig/2010-May/000096.html -Source100: ruby-1.8-rev%{tk_using_svn_number}_trunk-ext_tk.tar.gz - -# Patch1 - Patch23 are Fedora specific -Patch1: ruby-deadcode.patch -Patch20: ruby-1.8.6-p383-rubyprefix.patch -Patch21: ruby-deprecated-sitelib-search-path.patch -Patch22: ruby-deprecated-search-path.patch -Patch23: ruby-multilib.patch -# Needed in 1.8.6-p287, no longer needed in 1.8.6-p368? -#Patch25: ruby-1.8.6.111-gcc43.patch -# ruby_1_8 branch rev 19320, 20121, bug 460134 -# Included in 1.8.6 p368 -#Patch26: ruby-1.8.6-rexml-CVE-2008-3790.patch -# Patch27, 28 could not be found in the upstream VCS -# Need checking?? -Patch27: ruby-1.8.6-p287-CVE-2008-5189.patch -Patch28: ruby-1.8.6-p287-remove-ssl-rand-range.patch -# Fedora specific -# Change the directory of sitearchdir from i?86 to i386 for upgrade path -Patch29: ruby-always-use-i386.patch -# By Tomas Mraz, "seems" already in ruby_1_8 branch head -# (but have not checked yet in detail) -Patch30: ruby-openssl-1.0.patch -# bug 528787, patch from in ruby_1_8 branch -Patch31: ruby-1.8.6-p369-ri-gem_multipath.patch -# bug 518584, ruby issue 1556, patch from ruby_1_8??? branch -Patch32: ruby-1.8head-irb-save-history.patch -# bug 428384, Fedora specific, however needed for Fedora's static -# archive policy -Patch33: ruby-1.8.6-p383-mkmf-use-shared.patch -# bug 559158, Simplify the OpenSSL::Digest class -# Applying Patch34 needs reversing Patch39 part -Patch34: ruby-1.8.6-simplify-openssl-digest.patch -# bug 580993, patch from ruby_1_8_7 branch -Patch35: ruby_1_8_7-gc-open4_096segv.patch -# -# Patch36, 37: needed to use the head of ext/tk directory of ruby_1_8 branch head -# Patch36: taken from ruby_1_8 branch, RHASH_SIZE definition is needed -# for ruby_1_8 head ext/tk -# With this change, rb_hash_lookup becomes also needed for rubygem-nokogiri -# (bug 592936) -Patch36: ruby-1.8.x-RHASH_SIZE-rb_hash_lookup-def.patch -# Patch37: flatten(level) feature is in >= 1.8.7, reverting -Patch37: ruby-1.8.x-ext_tk-flatten-level-revert.patch -# From ruby_1_8 branch: bz 530407 -# bz 530407 reproducible with 1.8.7p174, not with 1.8.7p249 -Patch38: ruby-1.8.x-null-class-must-be-Qnil.patch -# Once revert this patch to apply Patch34 cleanly -Patch39: ruby-1.8.6-openssl-digest-once-revert-for-simplify-patch.patch + +# Source100: contains ext/tk directory of the ruby source head +# see http://lists.fedoraproject.org/pipermail/ruby-sig/2010-May/000096.html +# and bug 560053, 590503. +# To checkout, run the following commands +# (replacing 'ruby_tk_git_revision' with the value of the macro above): +# * git clone http://github.com/ruby/ruby.git +# * cd ruby +# * git checkout %%{ruby_tk_git_revision} ext/tk +# * tar czvf ruby-rev%%{ruby_tk_git_revision}-ext_tk.tar.gz ext/tk +Source100: ruby-rev%{ruby_tk_git_revision}-ext_tk.tar.gz + +# Patches 23, 29, and 33 brought over from ruby 1.8.6 +# (updated to apply against 1.8.7 source) +# If building against a 64bit arch, use 64bit libdir +Patch23: ruby-1.8.7-multilib.patch +# Mark all i.86 arch's (eg i586, i686, etc) as i386 +Patch29: ruby-1.8.7-always-use-i386.patch +# Use shared libs as opposed to static for mkmf +# See bug 428384 +Patch33: ruby-1.8.7-p249-mkmf-use-shared.patch +# Change ruby load path to conform to Fedora/ruby +# library placement (various 1.8.6 patches consolidated into this) +Patch100: ruby-1.8.7-lib-paths.patch Summary: An interpreter of object-oriented scripting language Group: Development/Languages -Requires: %{name}-libs = %{version}-%{release} +Requires: %{name}-libs%{?_isa} = %{version}-%{release} + +# emacs-23.2.x itself now provides the ruby mode +# And no Provides here +Obsoletes: %{name}-mode < 1.8.7 +# remove old documentation +# And no Provides here +Obsoletes: %{name}-docs < 1.8.7 %description Ruby is the interpreted scripting language for quick and easy @@ -107,7 +79,7 @@ files and to do system management tasks (as in Perl). It is simple, straight-forward, and extensible. -%package libs +%package libs Summary: Libraries necessary to run Ruby Group: Development/Libraries # ext/bigdecimal/bigdecimal.{c,h} are under (GPL+ or Artistic) which @@ -115,64 +87,54 @@ Group: Development/Libraries License: (Ruby or GPLv2) and (GPL+ or Artistic) Provides: ruby(abi) = %{rubyxver} Provides: libruby = %{version}-%{release} -Obsoletes: libruby <= %{version}-%{release} +Obsoletes: libruby < %{version}-%{release} %description libs This package includes the libruby, necessary to run Ruby. -%package devel +%package devel Summary: A Ruby development environment Group: Development/Languages -Requires: %{name}-libs = %{version}-%{release} -#Provides: %{name}-libs-static = %{version}-%{release} +Requires: %{name}-libs%{?_isa} = %{version}-%{release} -%description devel +%description devel Header files and libraries for building a extension library for the Ruby or an application embedded Ruby. -%package static +%package static Summary: Static libraries for Ruby development environment Group: Development/Languages -Requires: %{name}-devel = %{version}-%{release} +Requires: %{name}-devel%{?_isa} = %{version}-%{release} -%description static +%description static Static libraries for for building a extension library for the Ruby or an application embedded Ruby. -%package tcltk -Summary: Tcl/Tk interface for scripting language Ruby -Group: Development/Languages -# Many files under ext/tk/sample/ are under TCL -License: (Ruby or GPLv2) and TCL -Requires: %{name}-libs = %{version}-%{release} - -%description tcltk -Tcl/Tk interface for the object-oriented scripting language Ruby. - - -%package irb +%package irb Summary: The Interactive Ruby Group: Development/Languages +# No isa specific Requires: %{name} = %{version}-%{release} Provides: irb = %{version}-%{release} -Obsoletes: irb <= %{version}-%{release} +Obsoletes: irb < %{version}-%{release} +BuildArch: noarch %description irb The irb is acronym for Interactive Ruby. It evaluates ruby expression from the terminal. -%package rdoc +%package rdoc Summary: A tool to generate documentation from Ruby source files Group: Development/Languages # generators/template/html/html.rb is under CC-BY License: (GPLv2 or Ruby) and CC-BY -## ruby-irb requires ruby -#Requires: %{name} = %{version}-%{release} +# No isa specific Requires: %{name}-irb = %{version}-%{release} Provides: rdoc = %{version}-%{release} -Obsoletes: rdoc <= %{version}-%{release} +Obsoletes: rdoc < %{version}-%{release} +BuildArch: noarch %description rdoc The rdoc is a tool to generate the documentation from Ruby source files. @@ -180,31 +142,17 @@ It supports some output formats, like HTML, Ruby interactive reference (ri), XML and Windows Help file (chm). -%package docs -Summary: Manuals and FAQs for scripting language Ruby -Group: Documentation - -%description docs -Manuals and FAQs for the object-oriented scripting language Ruby. - - -%package mode -Summary: Emacs Lisp for the scripting language Ruby -Group: Applications/Editors -Requires: emacs-common - -%description mode -Emacs Lisp ruby-mode for the object-oriented scripting language Ruby. - - -%package ri +%package ri Summary: Ruby interactive reference Group: Documentation ## ruby-irb requires ruby, which ruby-rdoc requires -#Requires: %{name} = %{version}-%{release} +#Requires: %%{name} = %%{version}-%%{release} +# No isa specific Requires: %{name}-rdoc = %{version}-%{release} Provides: ri = %{version}-%{release} -Obsoletes: ri <= %{version}-%{release} +Obsoletes: ri < %{version}-%{release} +# FIXME: Make ruby-ri really arch independent +# BuildArch: noarch # Currently commented out %description ri ri is a command line tool that displays descriptions of built-in @@ -212,50 +160,38 @@ Ruby methods, classes and modules. For methods, it shows you the calling sequence and a description. For classes and modules, it shows a synopsis along with a list of the methods the class or module implements. +## +## ruby-tcltk +## +%package tcltk +Summary: Tcl/Tk interface for scripting language Ruby +Group: Development/Languages +Requires: %{name}-libs%{?_isa} = %{version}-%{release} + +%description tcltk +Tcl/Tk interface for the object-oriented scripting language Ruby. %prep -%setup -q -c -a 2 -a 3 -a 100 -mkdir -p ruby-refm-ja -pushd ruby-refm-ja -tar fxz %{SOURCE1} -popd +%setup -q -c -a 100 pushd %{name}-%{arcver} - -( cd ext - mv tk .tk.old - cp -a ../../ruby-1.8-rev*/ext/tk tk - find tk -type d -name \.svn | sort -r | xargs rm -rf -) - -%patch1 -p1 -%patch20 -p1 -%patch21 -p1 -%ifarch ppc64 s390x sparc64 x86_64 -%patch22 -p1 %patch23 -p1 -%endif -#%%patch25 -p1 -#%%patch26 -p1 -%patch27 -p0 -%patch28 -p1 %patch29 -p1 -%patch30 -p2 -%patch31 -p1 -%patch32 -p0 %patch33 -p1 -# To apply patch34, patch39 part must once be reverted -%patch39 -p1 -R -%patch34 -p1 -%patch35 -p1 -%patch36 -p1 -%patch37 -p1 -%patch38 -p1 +%patch100 -p1 + +( + cd ext + rm -rf tk + cp -a ../../ext/tk tk + find tk -type d -name \.svn | sort -r | xargs rm -rf +) + popd %build pushd %{name}-%{arcver} for i in config.sub config.guess; do - test -f %{_datadir}/libtool/$i && cp %{_datadir}/libtool/$i . + test -f %{_datadir}/libtool/$i && cp -p %{_datadir}/libtool/$i . done autoconf @@ -264,35 +200,33 @@ export rb_cv_func_strtod # bug 489990 CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" - export CFLAGS + %configure \ - --with-sitedir='%{sitedir}' \ - --with-default-kcode=none \ - --with-bundled-sha1 \ - --with-bundled-md5 \ - --with-bundled-rmd160 \ - --enable-shared \ - --enable-ipv6 \ - --enable-pthread \ - --with-lookup-order-hack=INET \ - --disable-rpath \ -%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6 - --with-readline-include=%{_includedir}/readline5 \ - --with-readline-lib=%{_libdir}/readline5 \ -%endif - --with-ruby-prefix=%{_prefix}/lib + --with-default-kcode=none \ + --enable-shared \ + --enable-pthread \ + --disable-rpath \ + --with-readline-include=%{_includedir}/readline5 \ + --with-readline-lib=%{_libdir}/readline5 \ + --with-sitedir='%{sitelibbase}' \ + --with-sitearchdir='%{sitearchbase}' \ + --with-vendordir='%{vendorlibbase}' \ + --with-vendorarchdir='%{vendorarchbase}' # For example ext/socket/extconf.rb uses try_run (for getaddrinfo test), # which executes conftest and setting LD_LIBRARY_PATH for libruby.so is # needed. export LD_LIBRARY_PATH=$(pwd) -make RUBY_INSTALL_NAME=ruby %{?_smp_mflags} COPY="cp -p" %{?_smp_mflags} +make RUBY_INSTALL_NAME=ruby \ + COPY="cp -p" \ + %{?_smp_mflags} %ifarch ia64 # Miscompilation? Buggy code? rm -f parse.o -make OPT=-O0 RUBY_INSTALL_NAME=ruby %{?_smp_mflags} +make OPT=-O0 RUBY_INSTALL_NAME=ruby \ + %{?_smp_mflags} %endif popd @@ -300,158 +234,115 @@ popd %check pushd %{name}-%{arcver} %ifarch ppc64 -make test || : +make test || true %else make test %endif popd %install -rm -rf $RPM_BUILD_ROOT - -mkdir -p $RPM_BUILD_ROOT%{_emacs_sitelispdir}/ruby-mode -mkdir -p $RPM_BUILD_ROOT%{_emacs_sitestartdir} - -# installing documents and exapmles... +# install documenation in tmp directory to be +# picked up by %%doc macros in %%files sections rm -rf tmp-ruby-docs mkdir tmp-ruby-docs -cd tmp-ruby-docs +pushd tmp-ruby-docs -# for ruby.rpm -mkdir ruby ruby-libs ruby-devel ruby-tcltk ruby-docs irb -cd ruby -(cd ../../%{name}-%{arcver} && tar cf - sample) | tar xvf - -cd .. +mkdir \ + ruby ruby-libs ruby-tcltk irb -# for ruby-libs +# First gather all samples +cp -a ../%{name}-%{arcver}/sample/ ruby +cp -a \ + ../%{name}-%{arcver}/lib/README* ../%{name}-%{arcver}/doc/ \ + ruby-libs +# Use tar to keep directory hierarchy cd ruby-libs -(cd ../../%{name}-%{arcver} && tar cf - lib/README*) | tar xf - -(cd ../../%{name}-%{arcver}/doc && tar cf - .) | tar xf - -(cd ../../%{name}-%{arcver} && - tar cf - `find ext \ - -mindepth 1 \ - \( -path '*/sample/*' -o -path '*/demo/*' \) -o \ - \( -name '*.rb' -not -path '*/lib/*' -not -name extconf.rb \) -o \ - \( -name 'README*' -o -name '*.txt*' -o -name 'MANUAL*' \)`) | tar xf - -cd .. - -# for irb -cd irb -mv ../ruby-libs/irb/* . -rmdir ../ruby-libs/irb -cd .. - -# for ruby-devel -cd ruby-devel - -cd .. - -# for ruby-tcltk -cd ruby-tcltk -for target in tcltklib tk -do - (cd ../ruby-libs && - tar cf - `find . -path "*/$target/*"`) | tar xf - - (cd ../ruby-libs && - rm -rf `find . -name "$target" -type d`) -done +( + cd ../../%{name}-%{arcver} ; \ + find ext \ + -mindepth 1 \ + \( -path '*/sample/*' -o -path '*/demo/*' \) -o \ + \( -name '*.rb' -not -path '*/lib/*' -not -name extconf.rb \) -o \ + \( -name 'README*' -o -name '*.txt*' -o -name 'MANUAL*' \) \ + \ + | xargs tar cf - +) \ + | tar xf - cd .. -# for ruby-docs -cd ruby-docs -mkdir refm-ja faq-en faq-ja -(cd ../../ruby-refm-ja && tar cf - .) | (cd refm-ja && tar xf -) -(cd ../../rubyfaq && tar cf - .) | (cd faq-en && tar xf -) -(cd ../../rubyfaq-jp && tar cf - .) | (cd faq-ja && tar xf -) - -(cd faq-ja && - for f in rubyfaq-jp*.html - do - sed -e 's/\(/dev/null || { iconv -f euc-jp -t utf-8 $i > $i.new && mv $i.new $i || status=1 ; } - if [ $status = 0 ]; then - if dirname $i | grep -q refm-ja ; then - sed -i -e '/encoding/s|EUC-JP|UTF-8|' -e '/charset/s|EUC-JP|UTF-8|' $i - fi - else - iconv -f iso8859-1 -t utf-8 $i > $.new && mv $i.new $i || rm -f $i.new - fi -done +# tcltk +mv ruby-libs/ext/tk/* ruby-tcltk/ +rmdir ruby-libs/ext/tk -# fix Japanese encoding strings for ruby-tcltk/ext/tk/sample/ -pushd ruby-tcltk/ext/tk/ +## Fix encodings +pushd ruby-tcltk cd sample find . -path ./demos-jp/\*.rb -or -path ./tkoptdb\*.rb -or -path ./msgs_rb2/ja.msg | \ - xargs sed -i -e 's|euc-jp|utf-8|' + xargs sed -i -e 's|euc-jp|utf-8|' sed -i \ - -e '/KCODE =/s|euc|utf-8|' -e 's|EUC-JP|UTF-8|' \ - demos-jp/widget + -e '/KCODE =/s|euc|utf-8|' -e 's|EUC-JP|UTF-8|' \ + demos-jp/widget cd .. sed -i -e 's|EUC-JP|UTF-8|' README.1st popd -# done -cd .. +# done w/ docs +popd # installing binaries ... -make -C $RPM_BUILD_DIR/%{name}-%{version}/%{name}-%{arcver} DESTDIR=$RPM_BUILD_ROOT install +make \ + -C $RPM_BUILD_DIR/%{name}-%{version}/%{name}-%{arcver} \ + DESTDIR=$RPM_BUILD_ROOT \ + install # generate ri doc rubybuilddir=$RPM_BUILD_DIR/%{name}-%{version}/%{name}-%{arcver} rm -rf %{name}-%{arcver}/.ext/rdoc -LD_LIBRARY_PATH=$RPM_BUILD_ROOT%{_libdir} RUBYLIB=$RPM_BUILD_ROOT%{_libdir}/ruby/%{rubyxver}:$RPM_BUILD_ROOT%{_libdir}/ruby/%{rubyxver}/%{_normalized_cpu}-%{_target_os} make -C $rubybuilddir DESTDIR=$RPM_BUILD_ROOT install-doc -#DESTDIR=$RPM_BUILD_ROOT LD_LIBRARY_PATH=$RPM_BUILD_ROOT%{_libdir} $RPM_BUILD_ROOT%{_bindir}/ruby -I $rubybuilddir -I $RPM_BUILD_ROOT%{_libdir}/ruby/%{rubyxver}/%{_normalized_cpu}-%{_target_os}/ -I $rubybuilddir/lib $RPM_BUILD_ROOT%{_bindir}/rdoc --all --ri-system $rubybuilddir - -mkdir -p $RPM_BUILD_ROOT%{sitedir2}/%{rubyxver} -mkdir -p $RPM_BUILD_ROOT%{sitedir}/%{rubyxver}/%{_normalized_cpu}-%{_target_os} - -# XXX: installing irb -install -p -m 0644 %{SOURCE4} $RPM_BUILD_ROOT%{_mandir}/man1/ - -# installing ruby-mode -cd %{name}-%{arcver} -cp -p misc/*.el $RPM_BUILD_ROOT%{_emacs_sitelispdir}/ruby-mode - -## for ruby-mode -pushd $RPM_BUILD_ROOT%{_emacs_sitelispdir}/ruby-mode -cat < path.el -(setq load-path (cons "." load-path) byte-compile-warnings nil) -EOF -emacs --no-site-file -q -batch -l path.el -f batch-byte-compile *.el -rm -f path.el* -popd -install -p -m 644 %{SOURCE10} \ - $RPM_BUILD_ROOT%{_emacs_sitestartdir} +env \ + LD_LIBRARY_PATH=$RPM_BUILD_ROOT%{_libdir} \ + RUBYLIB=$RPM_BUILD_ROOT%{vendorarchbase}/%{rubyxver}:$RPM_BUILD_ROOT%{vendorarchbase}/%{rubyxver}/%{_normalized_cpu}-%{_target_os} \ + make \ + -C $rubybuilddir DESTDIR=$RPM_BUILD_ROOT \ + install-doc -cd .. +mkdir -p $RPM_BUILD_ROOT%{sitelibbase}/%{rubyxver} +mkdir -p $RPM_BUILD_ROOT%{sitearchbase}/%{rubyxver}/%{_normalized_cpu}-%{_target_os} # remove shebang -for i in $RPM_BUILD_ROOT%{_prefix}/lib/ruby/1.8/{abbrev,generator,irb/{cmd/subirb,ext/save-history},matrix,rdoc/{markup/sample/rdoc2latex,parsers/parse_rb},set,tsort}.rb; do +for i in \ + $RPM_BUILD_ROOT%{vendorlibbase}/1.8/{abbrev,generator,irb/{cmd/subirb,ext/save-history},matrix,rdoc/{markup/sample/rdoc2latex,parsers/parse_rb},set,tsort}.rb; \ + do sed -i -e '/^#!.*/,1D' $i done +chmod 0644 $RPM_BUILD_ROOT%{vendorarchbase}/%{rubyxver}/%{_normalized_cpu}-%{_target_os}/*.h find $RPM_BUILD_ROOT/ -name "*.so" -exec chmod 755 {} \; @@ -464,182 +355,195 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-, root, root, -) -%doc %{name}-%{arcver}/COPYING* -%doc %{name}-%{arcver}/ChangeLog -%doc %{name}-%{arcver}/GPL -%doc %{name}-%{arcver}/LEGAL -%doc %{name}-%{arcver}/LGPL -%doc %{name}-%{arcver}/NEWS -%doc %{name}-%{arcver}/README -%lang(ja) %doc %{name}-%{arcver}/README.ja -%doc %{name}-%{arcver}/ToDo -%doc %{name}-%{arcver}/doc/ChangeLog-1.8.0 -%doc %{name}-%{arcver}/doc/NEWS-1.8.0 -%doc tmp-ruby-docs/ruby/* +%doc %{name}-%{arcver}/COPYING* +%doc %{name}-%{arcver}/ChangeLog +%doc %{name}-%{arcver}/GPL +%doc %{name}-%{arcver}/LEGAL +%doc %{name}-%{arcver}/LGPL +%doc %{name}-%{arcver}/NEWS +%doc %{name}-%{arcver}/README +%lang(ja) %doc %{name}-%{arcver}/README.ja +%doc %{name}-%{arcver}/ToDo +%doc tmp-ruby-docs/ruby/* %{_bindir}/ruby %{_bindir}/erb %{_bindir}/testrb %{_mandir}/man1/ruby.1* -%files devel +%files devel %defattr(-, root, root, -) -%doc %{name}-%{arcver}/COPYING* -%doc %{name}-%{arcver}/ChangeLog -%doc %{name}-%{arcver}/GPL -%doc %{name}-%{arcver}/LEGAL -%doc %{name}-%{arcver}/LGPL -%doc %{name}-%{arcver}/README.EXT -%lang(ja) %doc %{name}-%{arcver}/README.EXT.ja +%doc %{name}-%{arcver}/COPYING* +%doc %{name}-%{arcver}/ChangeLog +%doc %{name}-%{arcver}/GPL +%doc %{name}-%{arcver}/LEGAL +%doc %{name}-%{arcver}/LGPL +%doc %{name}-%{arcver}/README.EXT +%lang(ja) %doc %{name}-%{arcver}/README.EXT.ja %{_libdir}/libruby.so -#%%{_libdir}/libruby-static.a -%{_libdir}/ruby/%{rubyxver}/*/*.h +%{vendorarchbase}/%{rubyxver}/%{_normalized_cpu}-%{_target_os}/*.h -%files static +%files static %defattr(-, root, root, -) %{_libdir}/libruby-static.a -%files libs +%files libs %defattr(-, root, root, -) %doc %{name}-%{arcver}/README -%lang(ja) %doc %{name}-%{arcver}/README.ja -%doc %{name}-%{arcver}/COPYING* -%doc %{name}-%{arcver}/ChangeLog -%doc %{name}-%{arcver}/GPL -%doc %{name}-%{arcver}/LEGAL -%doc %{name}-%{arcver}/LGPL -%dir %{_prefix}/lib/ruby -%dir %{_prefix}/lib/ruby/%{rubyxver} -%ifnarch ppc64 s390x sparc64 x86_64 -%if "%{_gnu}" == "-gnueabi" -%dir %{_prefix}/lib/ruby/%{rubyxver}/%{_normalized_cpu}-%{_target_os}-eabi -%else -%dir %{_prefix}/lib/ruby/%{rubyxver}/%{_normalized_cpu}-%{_target_os} -%endif -%endif +%lang(ja) %doc %{name}-%{arcver}/README.ja +%doc %{name}-%{arcver}/COPYING* +%doc %{name}-%{arcver}/ChangeLog +%doc %{name}-%{arcver}/GPL +%doc %{name}-%{arcver}/LEGAL +%doc %{name}-%{arcver}/LGPL +%doc tmp-ruby-docs/ruby-libs/* +%dir %{vendorlibbase} +%dir %{vendorlibbase}/%{rubyxver} +%{sitelibbase} %ifarch ppc64 s390x sparc64 x86_64 -%dir %{_libdir}/ruby -%dir %{_libdir}/ruby/%{rubyxver} -%dir %{_libdir}/ruby/%{rubyxver}/%{_normalized_cpu}-%{_target_os} -%{sitedir} +%dir %{vendorarchbase} +%dir %{vendorarchbase}/%{rubyxver} +%{sitearchbase} %endif -%{sitedir2} ## the following files should goes into ruby-tcltk package. -%exclude %{_prefix}/lib/ruby/%{rubyxver}/*tk.rb -%exclude %{_prefix}/lib/ruby/%{rubyxver}/tcltk.rb -%exclude %{_prefix}/lib/ruby/%{rubyxver}/tk -%exclude %{_prefix}/lib/ruby/%{rubyxver}/tk*.rb -%exclude %{_prefix}/lib/ruby/%{rubyxver}/tkextlib -%exclude %{_libdir}/ruby/%{rubyxver}/*/tcltklib.so -%exclude %{_libdir}/ruby/%{rubyxver}/*/tkutil.so +%exclude %{vendorlibbase}/%{rubyxver}/*tk.rb +%exclude %{vendorlibbase}/%{rubyxver}/tcltk.rb +%exclude %{vendorlibbase}/%{rubyxver}/tk +%exclude %{vendorlibbase}/%{rubyxver}/tk*.rb +%exclude %{vendorlibbase}/%{rubyxver}/tkextlib +%exclude %{vendorarchbase}/%{rubyxver}/%{_normalized_cpu}-%{_target_os}/tcltklib.so +%exclude %{vendorarchbase}/%{rubyxver}/%{_normalized_cpu}-%{_target_os}/tkutil.so ## the following files should goes into ruby-rdoc package. -%exclude %{_prefix}/lib/ruby/%{rubyxver}/rdoc +%exclude %{vendorlibbase}/%{rubyxver}/rdoc ## the following files should goes into ruby-irb package. -%exclude %{_prefix}/lib/ruby/%{rubyxver}/irb.rb -%exclude %{_prefix}/lib/ruby/%{rubyxver}/irb +%exclude %{vendorlibbase}/%{rubyxver}/irb.rb +%exclude %{vendorlibbase}/%{rubyxver}/irb ## files in ruby-libs from here -%{_prefix}/lib/ruby/%{rubyxver}/*.rb -%{_prefix}/lib/ruby/%{rubyxver}/bigdecimal -%{_prefix}/lib/ruby/%{rubyxver}/cgi -%{_prefix}/lib/ruby/%{rubyxver}/date -%{_prefix}/lib/ruby/%{rubyxver}/digest -%{_prefix}/lib/ruby/%{rubyxver}/dl -%{_prefix}/lib/ruby/%{rubyxver}/drb -%{_prefix}/lib/ruby/%{rubyxver}/io -%{_prefix}/lib/ruby/%{rubyxver}/net -%{_prefix}/lib/ruby/%{rubyxver}/openssl -%{_prefix}/lib/ruby/%{rubyxver}/optparse -%{_prefix}/lib/ruby/%{rubyxver}/racc -%{_prefix}/lib/ruby/%{rubyxver}/rexml -%{_prefix}/lib/ruby/%{rubyxver}/rinda -%{_prefix}/lib/ruby/%{rubyxver}/rss -%{_prefix}/lib/ruby/%{rubyxver}/runit -%{_prefix}/lib/ruby/%{rubyxver}/shell -%{_prefix}/lib/ruby/%{rubyxver}/soap -%{_prefix}/lib/ruby/%{rubyxver}/test -%{_prefix}/lib/ruby/%{rubyxver}/uri -%{_prefix}/lib/ruby/%{rubyxver}/webrick -%{_prefix}/lib/ruby/%{rubyxver}/wsdl -%{_prefix}/lib/ruby/%{rubyxver}/xmlrpc -%{_prefix}/lib/ruby/%{rubyxver}/xsd -%{_prefix}/lib/ruby/%{rubyxver}/yaml +%{vendorlibbase}/%{rubyxver}/*.rb +%{vendorlibbase}/%{rubyxver}/bigdecimal +%{vendorlibbase}/%{rubyxver}/cgi +%{vendorlibbase}/%{rubyxver}/date +%{vendorlibbase}/%{rubyxver}/digest +%{vendorlibbase}/%{rubyxver}/dl +%{vendorlibbase}/%{rubyxver}/drb +%{vendorlibbase}/%{rubyxver}/io +%{vendorlibbase}/%{rubyxver}/net +%{vendorlibbase}/%{rubyxver}/openssl +%{vendorlibbase}/%{rubyxver}/optparse +%{vendorlibbase}/%{rubyxver}/racc +%{vendorlibbase}/%{rubyxver}/rexml +%{vendorlibbase}/%{rubyxver}/rinda +%{vendorlibbase}/%{rubyxver}/rss +%{vendorlibbase}/%{rubyxver}/runit +%{vendorlibbase}/%{rubyxver}/shell +%{vendorlibbase}/%{rubyxver}/soap +%{vendorlibbase}/%{rubyxver}/test +%{vendorlibbase}/%{rubyxver}/uri +%{vendorlibbase}/%{rubyxver}/webrick +%{vendorlibbase}/%{rubyxver}/wsdl +%{vendorlibbase}/%{rubyxver}/xmlrpc +%{vendorlibbase}/%{rubyxver}/xsd +%{vendorlibbase}/%{rubyxver}/yaml %{_libdir}/libruby.so.* -%{_libdir}/ruby/%{rubyxver}/*/*.so -%{_libdir}/ruby/%{rubyxver}/*/digest -%{_libdir}/ruby/%{rubyxver}/*/io -%{_libdir}/ruby/%{rubyxver}/*/racc -%{_libdir}/ruby/%{rubyxver}/*/rbconfig.rb +%{vendorarchbase}/%{rubyxver}/%{_normalized_cpu}-%{_target_os}/*.so +%{vendorarchbase}/%{rubyxver}/%{_normalized_cpu}-%{_target_os}/digest +%{vendorarchbase}/%{rubyxver}/%{_normalized_cpu}-%{_target_os}/io +%{vendorarchbase}/%{rubyxver}/%{_normalized_cpu}-%{_target_os}/racc +%{vendorarchbase}/%{rubyxver}/%{_normalized_cpu}-%{_target_os}/rbconfig.rb %files tcltk %defattr(-, root, root, -) -%doc %{name}-%{arcver}/COPYING* -%doc %{name}-%{arcver}/ChangeLog -%doc %{name}-%{arcver}/GPL -%doc %{name}-%{arcver}/LEGAL -%doc %{name}-%{arcver}/LGPL -%doc tmp-ruby-docs/ruby-tcltk/ext/* -%{_prefix}/lib/ruby/%{rubyxver}/*-tk.rb -%{_prefix}/lib/ruby/%{rubyxver}/tcltk.rb -%{_prefix}/lib/ruby/%{rubyxver}/tk -%{_prefix}/lib/ruby/%{rubyxver}/tk*.rb -%{_prefix}/lib/ruby/%{rubyxver}/tkextlib -%{_libdir}/ruby/%{rubyxver}/*/tcltklib.so -%{_libdir}/ruby/%{rubyxver}/*/tkutil.so - -%files rdoc +%doc %{name}-%{arcver}/COPYING* +%doc %{name}-%{arcver}/ChangeLog +%doc %{name}-%{arcver}/GPL +%doc %{name}-%{arcver}/LEGAL +%doc %{name}-%{arcver}/LGPL +%doc tmp-ruby-docs/ruby-tcltk/* +%{vendorlibbase}/%{rubyxver}/*-tk.rb +%{vendorlibbase}/%{rubyxver}/tcltk.rb +%{vendorlibbase}/%{rubyxver}/tk +%{vendorlibbase}/%{rubyxver}/tk*.rb +%{vendorlibbase}/%{rubyxver}/tkextlib +%{vendorarchbase}/%{rubyxver}/%{_normalized_cpu}-%{_target_os}/tcltklib.so +%{vendorarchbase}/%{rubyxver}/%{_normalized_cpu}-%{_target_os}/tkutil.so + +%files rdoc %defattr(-, root, root, -) -%doc %{name}-%{arcver}/COPYING* -%doc %{name}-%{arcver}/ChangeLog -%doc %{name}-%{arcver}/GPL -%doc %{name}-%{arcver}/LEGAL -%doc %{name}-%{arcver}/LGPL +%doc %{name}-%{arcver}/COPYING* +%doc %{name}-%{arcver}/ChangeLog +%doc %{name}-%{arcver}/GPL +%doc %{name}-%{arcver}/LEGAL +%doc %{name}-%{arcver}/LGPL %{_bindir}/rdoc -%{_prefix}/lib/ruby/%{rubyxver}/rdoc +%{vendorlibbase}/%{rubyxver}/rdoc %files irb %defattr(-, root, root, -) -%doc %{name}-%{arcver}/COPYING* -%doc %{name}-%{arcver}/ChangeLog -%doc %{name}-%{arcver}/GPL -%doc %{name}-%{arcver}/LEGAL -%doc %{name}-%{arcver}/LGPL -%doc tmp-ruby-docs/irb/* +%doc %{name}-%{arcver}/COPYING* +%doc %{name}-%{arcver}/ChangeLog +%doc %{name}-%{arcver}/GPL +%doc %{name}-%{arcver}/LEGAL +%doc %{name}-%{arcver}/LGPL +%doc tmp-ruby-docs/irb/* %{_bindir}/irb -%{_prefix}/lib/ruby/%{rubyxver}/irb.rb -%{_prefix}/lib/ruby/%{rubyxver}/irb -%{_mandir}/man1/irb.1* +%{vendorlibbase}/%{rubyxver}/irb.rb +%{vendorlibbase}/%{rubyxver}/irb %files ri %defattr(-, root, root, -) -%doc %{name}-%{arcver}/COPYING* -%doc %{name}-%{arcver}/ChangeLog -%doc %{name}-%{arcver}/GPL -%doc %{name}-%{arcver}/LEGAL -%doc %{name}-%{arcver}/LGPL +%doc %{name}-%{arcver}/COPYING* +%doc %{name}-%{arcver}/ChangeLog +%doc %{name}-%{arcver}/GPL +%doc %{name}-%{arcver}/LEGAL +%doc %{name}-%{arcver}/LGPL %{_bindir}/ri %{_datadir}/ri -%files docs -%defattr(-, root, root, -) -%doc %{name}-%{arcver}/COPYING* -%doc %{name}-%{arcver}/ChangeLog -%doc %{name}-%{arcver}/GPL -%doc %{name}-%{arcver}/LEGAL -%doc %{name}-%{arcver}/LGPL -%doc tmp-ruby-docs/ruby-docs/* -%doc tmp-ruby-docs/ruby-libs/* - -%files mode -%defattr(-, root, root, -) -%doc %{name}-%{arcver}/COPYING* -%doc %{name}-%{arcver}/ChangeLog -%doc %{name}-%{arcver}/GPL -%doc %{name}-%{arcver}/LEGAL -%doc %{name}-%{arcver}/LGPL -%doc %{name}-%{arcver}/misc/README -%{_emacs_sitelispdir}/ruby-mode -%{_emacs_sitestartdir}/ruby-mode-init.el - %changelog +* Mon Jul 26 2010 Mamoru Tasaka - 1.8.7.299-4 +- Cleanup spec file +- Make -irb, -rdoc subpackage noarch +- Make dependencies between arch-dependent subpackages isa specific +- Improve sample documentation gathering + +* Mon Jul 12 2010 Mohammed Morsi - 1.8.7.299-3 +- updated packaged based on feedback (from mtasaka) +- added comments to all patches / sources +- obsoleted ruby-mode, as it's now provided by the emacs package itself +- readded missing documentation +- various small compatability/regression fixes + +* Tue Jul 06 2010 Mohammed Morsi - 1.8.7.299-2 +- readded bits to pull tk package from upstream source branch +- removed unecessary .tk.old dir +- renamed macros which may cause confusion, removed unused ones + +* Thu Jun 24 2010 Mohammed Morsi - 1.8.7.299-1 +- integrate more of jmeyering's and mtaska's feedback +- removed emacs bits that are now shipped with the emacs package +- various patch and spec cleanup +- rebased to ruby 1.8.7 patch 299, removed patches no longer needed: + ruby-1.8.7-openssl-1.0.patch, ruby-1.8.7-rb_gc_guard_ptr-optimization.patch + +* Wed Jun 23 2010 Mohammed Morsi - 1.8.7.249-5 +- Various fixes + +* Wed Jun 23 2010 Mohammed Morsi - 1.8.7.249-4 +- Fixed incorrect paths in 1.8.7 rpm + +* Tue Jun 22 2010 Mohammed Morsi - 1.8.7.249-3 +- Integrated Jim Meyering's feedback and changes in to: +- remove trailing blanks +- placate rpmlint +- ruby_* definitions: do not use trailing slashes in directory names +- _normalized_cpu: simplify definition + +* Mon Jun 21 2010 Mohammed Morsi - 1.8.7.249-2 +- Integrate mtasaka's feedback and changes +- patch101 ruby_1_8_7-rb_gc_guard_ptr-optimization.patch + +* Tue Jun 15 2010 Mohammed Morsi - 1.8.7.249-1 +- Initial Ruby 1.8.7 specfile + * Wed May 19 2010 Mamoru Tasaka - 1.8.6.399-5 - Retry for bug 559158, Simplify the OpenSSL::Digest class pull more change commits from ruby_1_8 branch @@ -709,7 +613,7 @@ rm -rf $RPM_BUILD_ROOT * Thu Jul 23 2009 Mamoru Tasaka - 1.8.6.369-2 - Make sure that readline.so is linked against readline 5 because - Ruby is under GPLv2 + Ruby is under GPLv2 * Sat Jun 20 2009 Jeroen van Meeuwen - 1.8.6.369-1 - New patchlevel fixing CVE-2009-1904 diff --git a/ruby_1_8_7-gc-open4_096segv.patch b/ruby_1_8_7-gc-open4_096segv.patch deleted file mode 100644 index 4514022..0000000 --- a/ruby_1_8_7-gc-open4_096segv.patch +++ /dev/null @@ -1,351 +0,0 @@ -Index: ruby_1_8_7/marshal.c -=================================================================== ---- ruby_1_8_7/marshal.c (revision 26075) -+++ ruby_1_8_7/marshal.c (revision 26076) -@@ -85,12 +85,10 @@ - static ID s_getc, s_read, s_write, s_binmode; - - struct dump_arg { -- VALUE obj; - VALUE str, dest; - st_table *symbols; - st_table *data; - int taint; -- VALUE wrapper; - }; - - struct dump_call_arg { -@@ -104,22 +102,32 @@ - struct dump_arg *arg; - ID sym; - { -- if (!DATA_PTR(arg->wrapper)) { -+ if (!arg->symbols) { - rb_raise(rb_eRuntimeError, "Marshal.dump reentered at %s", - rb_id2name(sym)); - } - } - -+static void clear_dump_arg _((struct dump_arg *arg)); -+ - static void - mark_dump_arg(ptr) - void *ptr; - { - struct dump_arg *p = ptr; -- if (!ptr) -+ if (!p->symbols) - return; - rb_mark_set(p->data); - } - -+static void -+free_dump_arg(ptr) -+ void *ptr; -+{ -+ clear_dump_arg(ptr); -+ xfree(ptr); -+} -+ - static VALUE - class2path(klass) - VALUE klass; -@@ -699,32 +707,17 @@ - } - } - --static VALUE --dump(arg) -- struct dump_call_arg *arg; --{ -- w_object(arg->obj, arg->arg, arg->limit); -- if (arg->arg->dest) { -- rb_io_write(arg->arg->dest, arg->arg->str); -- rb_str_resize(arg->arg->str, 0); -- } -- return 0; --} -- --static VALUE --dump_ensure(arg) -+static void -+clear_dump_arg(arg) - struct dump_arg *arg; - { -- if (!DATA_PTR(arg->wrapper)) return 0; -+ if (!arg->symbols) return; - st_free_table(arg->symbols); -+ arg->symbols = 0; - st_free_table(arg->data); -- DATA_PTR(arg->wrapper) = 0; -- arg->wrapper = 0; - if (arg->taint) { - OBJ_TAINT(arg->str); - } -- -- return 0; - } - - /* -@@ -760,8 +753,8 @@ - { - VALUE obj, port, a1, a2; - int limit = -1; -- struct dump_arg arg; -- struct dump_call_arg c_arg; -+ struct dump_arg *arg; -+ VALUE wrapper; - - port = Qnil; - rb_scan_args(argc, argv, "12", &obj, &a1, &a2); -@@ -775,37 +768,40 @@ - else if (NIL_P(a1)) goto type_error; - else port = a1; - } -- arg.dest = 0; -- arg.symbols = st_init_numtable(); -- arg.data = st_init_numtable(); -- arg.taint = Qfalse; -- arg.str = rb_str_buf_new(0); -- RBASIC(arg.str)->klass = 0; -- arg.wrapper = Data_Wrap_Struct(rb_cData, mark_dump_arg, 0, &arg); -+ wrapper = Data_Make_Struct(rb_cData, struct dump_arg, mark_dump_arg, free_dump_arg, arg); -+ arg->dest = 0; -+ arg->symbols = st_init_numtable(); -+ arg->data = st_init_numtable(); -+ arg->taint = Qfalse; -+ arg->str = rb_str_buf_new(0); -+ RBASIC(arg->str)->klass = 0; - if (!NIL_P(port)) { - if (!rb_respond_to(port, s_write)) { - type_error: - rb_raise(rb_eTypeError, "instance of IO needed"); - } -- arg.dest = port; -+ arg->dest = port; - if (rb_respond_to(port, s_binmode)) { - rb_funcall2(port, s_binmode, 0, 0); -- check_dump_arg(&arg, s_binmode); -+ check_dump_arg(arg, s_binmode); - } - } - else { -- port = arg.str; -+ port = arg->str; - } - -- c_arg.obj = obj; -- c_arg.arg = &arg; -- c_arg.limit = limit; -+ w_byte(MARSHAL_MAJOR, arg); -+ w_byte(MARSHAL_MINOR, arg); - -- w_byte(MARSHAL_MAJOR, &arg); -- w_byte(MARSHAL_MINOR, &arg); -+ w_object(obj, arg, limit); -+ if (arg->dest) { -+ rb_io_write(arg->dest, arg->str); -+ rb_str_resize(arg->str, 0); -+ } - -- rb_ensure(dump, (VALUE)&c_arg, dump_ensure, (VALUE)&arg); -- RBASIC(arg.str)->klass = rb_cString; -+ RBASIC(arg->str)->klass = rb_cString; -+ clear_dump_arg(arg); -+ RB_GC_GUARD(wrapper); - - return port; - } -@@ -817,7 +813,6 @@ - st_table *data; - VALUE proc; - int taint; -- VALUE wrapper; - }; - - static void -@@ -825,22 +820,31 @@ - struct load_arg *arg; - ID sym; - { -- if (!DATA_PTR(arg->wrapper)) { -+ if (!arg->symbols) { - rb_raise(rb_eRuntimeError, "Marshal.load reentered at %s", - rb_id2name(sym)); - } - } - -+static void clear_load_arg _((struct load_arg *arg)); -+ - static void - mark_load_arg(ptr) - void *ptr; - { - struct load_arg *p = ptr; -- if (!ptr) -+ if (!p->symbols) - return; - rb_mark_tbl(p->data); - } - -+static void -+free_load_arg(void *ptr) -+{ -+ clear_load_arg(ptr); -+ xfree(ptr); -+} -+ - static VALUE r_object _((struct load_arg *arg)); - - static int -@@ -1415,23 +1419,14 @@ - return r_object0(arg, arg->proc, 0, Qnil); - } - --static VALUE --load(arg) -+static void -+clear_load_arg(arg) - struct load_arg *arg; - { -- return r_object(arg); --} -- --static VALUE --load_ensure(arg) -- struct load_arg *arg; --{ -- if (!DATA_PTR(arg->wrapper)) return 0; -+ if (!arg->symbols) return; - st_free_table(arg->symbols); -+ arg->symbols = 0; - st_free_table(arg->data); -- DATA_PTR(arg->wrapper) = 0; -- arg->wrapper = 0; -- return 0; - } - - /* -@@ -1451,35 +1446,37 @@ - VALUE *argv; - { - VALUE port, proc; -- int major, minor; -- VALUE v; -- struct load_arg arg; -+ int major, minor, taint = Qfalse; -+ VALUE v, wrapper; -+ struct load_arg *arg; - - rb_scan_args(argc, argv, "11", &port, &proc); - v = rb_check_string_type(port); - if (!NIL_P(v)) { -- arg.taint = OBJ_TAINTED(port); /* original taintedness */ -+ taint = OBJ_TAINTED(port); /* original taintedness */ - port = v; - } - else if (rb_respond_to(port, s_getc) && rb_respond_to(port, s_read)) { - if (rb_respond_to(port, s_binmode)) { - rb_funcall2(port, s_binmode, 0, 0); - } -- arg.taint = Qtrue; -+ taint = Qtrue; - } - else { - rb_raise(rb_eTypeError, "instance of IO needed"); - } -- arg.src = port; -- arg.offset = 0; -- arg.symbols = st_init_numtable(); -- arg.data = st_init_numtable(); -- arg.proc = 0; -- arg.wrapper = Data_Wrap_Struct(rb_cData, mark_load_arg, 0, &arg); -+ wrapper = Data_Make_Struct(rb_cData, struct load_arg, mark_load_arg, free_load_arg, arg); -+ arg->src = port; -+ arg->offset = 0; -+ arg->symbols = st_init_numtable(); -+ arg->data = st_init_numtable(); -+ arg->proc = 0; -+ arg->taint = taint; - -- major = r_byte(&arg); -- minor = r_byte(&arg); -+ major = r_byte(arg); -+ minor = r_byte(arg); - if (major != MARSHAL_MAJOR || minor > MARSHAL_MINOR) { -+ clear_load_arg(arg); - rb_raise(rb_eTypeError, "incompatible marshal file format (can't be read)\n\ - \tformat version %d.%d required; %d.%d given", - MARSHAL_MAJOR, MARSHAL_MINOR, major, minor); -@@ -1490,8 +1487,10 @@ - MARSHAL_MAJOR, MARSHAL_MINOR, major, minor); - } - -- if (!NIL_P(proc)) arg.proc = proc; -- v = rb_ensure(load, (VALUE)&arg, load_ensure, (VALUE)&arg); -+ if (!NIL_P(proc)) arg->proc = proc; -+ v = r_object(arg); -+ clear_load_arg(arg); -+ RB_GC_GUARD(wrapper); - - return v; - } -Index: ruby_1_8_7/test/ruby/test_marshal.rb -=================================================================== ---- ruby_1_8_7/test/ruby/test_marshal.rb (revision 26075) -+++ ruby_1_8_7/test/ruby/test_marshal.rb (revision 26076) -@@ -71,4 +71,41 @@ - } - assert_equal("marshal data too short", e.message) - end -+ -+ class DumpTest -+ def marshal_dump -+ loop { Thread.pass } -+ end -+ end -+ -+ class LoadTest -+ def marshal_dump -+ nil -+ end -+ def marshal_load(obj) -+ loop { Thread.pass } -+ end -+ end -+ -+ def test_context_switch -+ o = DumpTest.new -+ Thread.new { Marshal.dump(o) } -+ GC.start -+ assert(true, '[ruby-dev:39425]') -+ -+ o = LoadTest.new -+ m = Marshal.dump(o) -+ Thread.new { Marshal.load(m) } -+ GC.start -+ assert(true, '[ruby-dev:39425]') -+ end -+ -+ def test_taint -+ x = Object.new -+ x.taint -+ s = Marshal.dump(x) -+ assert_equal(true, s.tainted?) -+ y = Marshal.load(s) -+ assert_equal(true, y.tainted?) -+ end - end -Index: ruby_1_8_7/ruby.h -=================================================================== ---- ruby_1_8_7/ruby.h (revision 16014) -+++ ruby_1_8_7/ruby.h (revision 16015) -@@ -224,6 +224,8 @@ - - #define TYPE(x) rb_type((VALUE)(x)) - -+#define RB_GC_GUARD(v) (*(volatile VALUE *)&(v)) -+ - void rb_check_type _((VALUE,int)); - #define Check_Type(v,t) rb_check_type((VALUE)(v),t) - diff --git a/sources b/sources index b1ee168..bc9abd7 100644 --- a/sources +++ b/sources @@ -1,6 +1,2 @@ -f26cefbc8ab6728650ab9ae773d22bcb ruby-1.8.6-p388.tar.bz2 -b6dd396f513efeb7864685c840f9643a ruby-refm-rdp-1.8.2-ja-html.tar.gz -634c25b14e19925d10af3720d72e8741 rubyfaq-990927.tar.gz -4fcec898f51d8371cc42d0a013940469 rubyfaq-jp-990927.tar.gz -f77c307cb72fb8808b0e85af5d05cefc ruby-1.8.6-p399.tar.bz2 -6a8313c73087513f24e52d8cee5b3804 ruby-1.8-rev27738_trunk-ext_tk.tar.gz +244439a87d75ab24170a9c2b451ce351 ruby-1.8.7-p299.tar.bz2 +b49ba42587b06e5f23501456e29a6d18 ruby-rev415a3ef9ab82c65a7abc-ext_tk.tar.gz