From 43f0bad6cec214c23ee25e7a13d719f50f0a1550 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Wed, 15 Apr 2009 05:31:13 +0000 Subject: [PATCH 01/18] Initialize branch F-11 for ruby --- branch | 1 + 1 file changed, 1 insertion(+) create mode 100644 branch diff --git a/branch b/branch new file mode 100644 index 0000000..25c7708 --- /dev/null +++ b/branch @@ -0,0 +1 @@ +F-11 From 92d5fbdb7de21620c8cb88c14c9994b71d042eac Mon Sep 17 00:00:00 2001 From: Mamoru Tasaka Date: Wed, 20 May 2009 23:36:21 +0000 Subject: [PATCH 02/18] Fix wrong macros definition --- ruby.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruby.spec b/ruby.spec index 67fa3e5..c3796b3 100644 --- a/ruby.spec +++ b/ruby.spec @@ -12,7 +12,7 @@ # emacs sitelisp directory %{!?_emacs_sitelispdir: %global _emacs_sitelispdir %{_datadir}/emacs/site-lisp} -%{!?_emacs_sitestartdir: %global _emacs_sitelispdir %{_datadir}/emacs/site-lisp/site-start.d} +%{!?_emacs_sitestartdir: %global _emacs_sitestartdir %{_datadir}/emacs/site-lisp/site-start.d} Name: ruby Version: %{rubyver}%{?dotpatchlevel} From bca35bc20fdec9305324e6a9c4a7ea760cf63999 Mon Sep 17 00:00:00 2001 From: Jeroen van Meeuwen Date: Sun, 31 May 2009 08:40:46 +0000 Subject: [PATCH 03/18] 1.8.6.368-1 --- .cvsignore | 5 ++--- import.log | 1 + ruby-1.8.6-p287-remove-ssl-rand-range.patch | 13 ------------- ruby-1.8.6.111-gcc43.patch | 16 ---------------- ruby.spec | 14 +++++++++----- sources | 5 ++--- 6 files changed, 14 insertions(+), 40 deletions(-) delete mode 100644 ruby-1.8.6.111-gcc43.patch diff --git a/.cvsignore b/.cvsignore index 05533e8..36ef766 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,5 +1,4 @@ -ruby-1.8.6-p287.tar.bz2 -ruby-refm-rdp-1.8.1-ja-html.tar.gz +ruby-refm-rdp-1.8.2-ja-html.tar.gz rubyfaq-990927.tar.gz rubyfaq-jp-990927.tar.gz -ruby-refm-rdp-1.8.2-ja-html.tar.gz +ruby-1.8.6-p368.tar.bz2 diff --git a/import.log b/import.log index a10a94e..3118f22 100644 --- a/import.log +++ b/import.log @@ -1,3 +1,4 @@ ruby-1_8_6_287-4_fc10:HEAD:ruby-1.8.6.287-4.fc10.src.rpm:1237096558 ruby-1_8_6_287-5_fc10:HEAD:ruby-1.8.6.287-5.fc10.src.rpm:1237096677 ruby-1_8_6_287-7_fc11:HEAD:ruby-1.8.6.287-7.fc11.src.rpm:1237351812 +ruby-1_8_6_368-1_fc11:F-11:ruby-1.8.6.368-1.fc11.src.rpm:1243759224 diff --git a/ruby-1.8.6-p287-remove-ssl-rand-range.patch b/ruby-1.8.6-p287-remove-ssl-rand-range.patch index 75bef4e..705f3d3 100644 --- a/ruby-1.8.6-p287-remove-ssl-rand-range.patch +++ b/ruby-1.8.6-p287-remove-ssl-rand-range.patch @@ -98,16 +98,3 @@ diff -ur ruby-1.8.6-p287.orig/ext/openssl/openssl_missing.c ruby-1.8.6-p287/ext/ if (key) { i = strlen(key); i = (i > num) ? num : i; -diff -ur ruby-1.8.6-p287.orig/ext/openssl/openssl_missing.h ruby-1.8.6-p287/ext/openssl/openssl_missing.h ---- ruby-1.8.6-p287.orig/ext/openssl/openssl_missing.h 2008-08-04 06:43:34.000000000 +0200 -+++ ruby-1.8.6-p287/ext/openssl/openssl_missing.h 2009-03-15 05:33:56.000000000 +0100 -@@ -120,8 +120,6 @@ - int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx); - int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx); - int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx); --int BN_rand_range(BIGNUM *r, BIGNUM *range); --int BN_pseudo_rand_range(BIGNUM *r, BIGNUM *range); - char *CONF_get1_default_config_file(void); - int PEM_def_callback(char *buf, int num, int w, void *key); - -Only in ruby-1.8.6-p287/ext/openssl: .openssl_missing.h.swp diff --git a/ruby-1.8.6.111-gcc43.patch b/ruby-1.8.6.111-gcc43.patch deleted file mode 100644 index 9e1b297..0000000 --- a/ruby-1.8.6.111-gcc43.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -pruN ruby-1.8.6-p111.orig/ext/socket/socket.c ruby-1.8.6-p111/ext/socket/socket.c ---- ruby-1.8.6-p111.orig/ext/socket/socket.c 2007-05-23 00:08:43.000000000 +0900 -+++ ruby-1.8.6-p111/ext/socket/socket.c 2008-02-19 11:24:22.000000000 +0900 -@@ -893,10 +893,10 @@ port_str(port, pbuf, len) - } - - #ifndef NI_MAXHOST --# define 1025 -+# define NI_MAXHOST 1025 - #endif - #ifndef NI_MAXSERV --# define 32 -+# define NI_MAXSERV 32 - #endif - - static struct addrinfo* diff --git a/ruby.spec b/ruby.spec index c3796b3..c0e342f 100644 --- a/ruby.spec +++ b/ruby.spec @@ -1,6 +1,6 @@ %define rubyxver 1.8 %define rubyver 1.8.6 -%define _patchlevel 287 +%define _patchlevel 368 %define dotpatchlevel %{?_patchlevel:.%{_patchlevel}} %define patchlevel %{?_patchlevel:-p%{_patchlevel}} %define arcver %{rubyver}%{?patchlevel} @@ -16,7 +16,7 @@ Name: ruby Version: %{rubyver}%{?dotpatchlevel} -Release: 8%{?dist} +Release: 1%{?dist} License: Ruby or GPLv2 URL: http://www.ruby-lang.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -38,7 +38,8 @@ Patch20: ruby-rubyprefix.patch Patch21: ruby-deprecated-sitelib-search-path.patch Patch22: ruby-deprecated-search-path.patch Patch23: ruby-multilib.patch -Patch25: ruby-1.8.6.111-gcc43.patch +# Needed in 1.8.6-p287, no longer needed in 1.8.6-p368? +#Patch25: ruby-1.8.6.111-gcc43.patch Patch26: ruby-1.8.6-rexml-CVE-2008-3790.patch Patch27: ruby-1.8.6-p287-CVE-2008-5189.patch Patch28: ruby-1.8.6-p287-remove-ssl-rand-range.patch @@ -167,8 +168,8 @@ pushd %{name}-%{arcver} %patch22 -p1 %patch23 -p1 %endif -%patch25 -p1 -%patch26 -p1 +#%patch25 -p1 +#%patch26 -p1 %patch27 -p0 %patch28 -p1 %patch29 -p1 @@ -530,6 +531,9 @@ rm -rf $RPM_BUILD_ROOT %{_emacs_sitestartdir}/ruby-mode-init.el %changelog +* Sun May 31 2009 Jeroen van Meeuwen - 1.8.6.368-1 +- New upstream release (p368) + * Sat Apr 11 2009 Mamoru Tasaka - 1.8.6.287-8 - Merge Review fix (#226381) diff --git a/sources b/sources index 19d9781..63ec757 100644 --- a/sources +++ b/sources @@ -1,5 +1,4 @@ -80b5f3db12531d36e6c81fac6d05dda9 ruby-1.8.6-p287.tar.bz2 -d65e3a216d6d345a2a6f1aa8758c2f75 ruby-refm-rdp-1.8.1-ja-html.tar.gz +b6dd396f513efeb7864685c840f9643a ruby-refm-rdp-1.8.2-ja-html.tar.gz 634c25b14e19925d10af3720d72e8741 rubyfaq-990927.tar.gz 4fcec898f51d8371cc42d0a013940469 rubyfaq-jp-990927.tar.gz -b6dd396f513efeb7864685c840f9643a ruby-refm-rdp-1.8.2-ja-html.tar.gz +623447c6d8c973193aae565a5538ccfc ruby-1.8.6-p368.tar.bz2 From ac482417102838d536cdaece7acf34ef6a849ba6 Mon Sep 17 00:00:00 2001 From: Jeroen van Meeuwen Date: Sat, 20 Jun 2009 17:53:14 +0000 Subject: [PATCH 04/18] 1.8.6.368-2 --- .cvsignore | 2 +- import.log | 1 + ruby.spec | 11 +++++++++-- sources | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.cvsignore b/.cvsignore index 36ef766..1f1c551 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,4 +1,4 @@ +ruby-1.8.6-p368.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-p368.tar.bz2 diff --git a/import.log b/import.log index 3118f22..129cdc2 100644 --- a/import.log +++ b/import.log @@ -2,3 +2,4 @@ ruby-1_8_6_287-4_fc10:HEAD:ruby-1.8.6.287-4.fc10.src.rpm:1237096558 ruby-1_8_6_287-5_fc10:HEAD:ruby-1.8.6.287-5.fc10.src.rpm:1237096677 ruby-1_8_6_287-7_fc11:HEAD:ruby-1.8.6.287-7.fc11.src.rpm:1237351812 ruby-1_8_6_368-1_fc11:F-11:ruby-1.8.6.368-1.fc11.src.rpm:1243759224 +ruby-1_8_6_368-2_fc11:F-11:ruby-1.8.6.368-2.fc11.src.rpm:1245520335 diff --git a/ruby.spec b/ruby.spec index c0e342f..88901d0 100644 --- a/ruby.spec +++ b/ruby.spec @@ -16,7 +16,7 @@ Name: ruby Version: %{rubyver}%{?dotpatchlevel} -Release: 1%{?dist} +Release: 2%{?dist} License: Ruby or GPLv2 URL: http://www.ruby-lang.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -130,7 +130,7 @@ Manuals and FAQs for the object-oriented scripting language Ruby. %package mode -Summary: Emacs Lisp ruby-mode for the scripting language Ruby +Summary: Emacs Lisp for the scripting language Ruby Group: Applications/Editors Requires: emacs-common @@ -405,8 +405,12 @@ rm -rf $RPM_BUILD_ROOT %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 %ifarch ppc64 s390x sparc64 x86_64 %dir %{_libdir}/ruby %dir %{_libdir}/ruby/%{rubyxver} @@ -531,6 +535,9 @@ rm -rf $RPM_BUILD_ROOT %{_emacs_sitestartdir}/ruby-mode-init.el %changelog +* Sat Jun 20 2009 Jeroen van Meeuwen - 1.8.6.368-2 +- Fix directory on ARM (#506233, Kedar Sovani) + * Sun May 31 2009 Jeroen van Meeuwen - 1.8.6.368-1 - New upstream release (p368) diff --git a/sources b/sources index 63ec757..62029b4 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ +623447c6d8c973193aae565a5538ccfc ruby-1.8.6-p368.tar.bz2 b6dd396f513efeb7864685c840f9643a ruby-refm-rdp-1.8.2-ja-html.tar.gz 634c25b14e19925d10af3720d72e8741 rubyfaq-990927.tar.gz 4fcec898f51d8371cc42d0a013940469 rubyfaq-jp-990927.tar.gz -623447c6d8c973193aae565a5538ccfc ruby-1.8.6-p368.tar.bz2 From 6442d2b1c2cd6fcf1e89a93c6db2e96544e72e8f Mon Sep 17 00:00:00 2001 From: Jeroen van Meeuwen Date: Tue, 23 Jun 2009 12:40:23 +0000 Subject: [PATCH 05/18] 1.8.6.369-1 --- .cvsignore | 2 +- import.log | 1 + ruby.spec | 7 ++++--- sources | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.cvsignore b/.cvsignore index 1f1c551..9be1be4 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,4 +1,4 @@ -ruby-1.8.6-p368.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-p369.tar.bz2 diff --git a/import.log b/import.log index 129cdc2..6c75724 100644 --- a/import.log +++ b/import.log @@ -3,3 +3,4 @@ ruby-1_8_6_287-5_fc10:HEAD:ruby-1.8.6.287-5.fc10.src.rpm:1237096677 ruby-1_8_6_287-7_fc11:HEAD:ruby-1.8.6.287-7.fc11.src.rpm:1237351812 ruby-1_8_6_368-1_fc11:F-11:ruby-1.8.6.368-1.fc11.src.rpm:1243759224 ruby-1_8_6_368-2_fc11:F-11:ruby-1.8.6.368-2.fc11.src.rpm:1245520335 +ruby-1_8_6_369-1_fc11:F-11:ruby-1.8.6.369-1.fc11.src.rpm:1245760801 diff --git a/ruby.spec b/ruby.spec index 88901d0..bed6afe 100644 --- a/ruby.spec +++ b/ruby.spec @@ -1,6 +1,6 @@ %define rubyxver 1.8 %define rubyver 1.8.6 -%define _patchlevel 368 +%define _patchlevel 369 %define dotpatchlevel %{?_patchlevel:.%{_patchlevel}} %define patchlevel %{?_patchlevel:-p%{_patchlevel}} %define arcver %{rubyver}%{?patchlevel} @@ -16,7 +16,7 @@ Name: ruby Version: %{rubyver}%{?dotpatchlevel} -Release: 2%{?dist} +Release: 1%{?dist} License: Ruby or GPLv2 URL: http://www.ruby-lang.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -535,7 +535,8 @@ rm -rf $RPM_BUILD_ROOT %{_emacs_sitestartdir}/ruby-mode-init.el %changelog -* Sat Jun 20 2009 Jeroen van Meeuwen - 1.8.6.368-2 +* Sat Jun 20 2009 Jeroen van Meeuwen - 1.8.6.369-1 +- New patchlevel fixing CVE-2009-1904 - Fix directory on ARM (#506233, Kedar Sovani) * Sun May 31 2009 Jeroen van Meeuwen - 1.8.6.368-1 diff --git a/sources b/sources index 62029b4..34e5163 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ -623447c6d8c973193aae565a5538ccfc ruby-1.8.6-p368.tar.bz2 b6dd396f513efeb7864685c840f9643a ruby-refm-rdp-1.8.2-ja-html.tar.gz 634c25b14e19925d10af3720d72e8741 rubyfaq-990927.tar.gz 4fcec898f51d8371cc42d0a013940469 rubyfaq-jp-990927.tar.gz +c3c1f3dd0dfbd2e17a04e59c2f12cfc8 ruby-1.8.6-p369.tar.bz2 From c250b79137ad2b4b9db7e9822ca27679ee252f08 Mon Sep 17 00:00:00 2001 From: Mamoru Tasaka Date: Tue, 13 Oct 2009 18:26:15 +0000 Subject: [PATCH 06/18] - Fix the search path of ri command for ri manuals installed with gem (bug 528787) --- ruby-1.8.6-p369-ri-gem_multipath.patch | 55 ++++++++++++++++++++++++++ ruby.spec | 8 +++- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 ruby-1.8.6-p369-ri-gem_multipath.patch diff --git a/ruby-1.8.6-p369-ri-gem_multipath.patch b/ruby-1.8.6-p369-ri-gem_multipath.patch new file mode 100644 index 0000000..be66fad --- /dev/null +++ b/ruby-1.8.6-p369-ri-gem_multipath.patch @@ -0,0 +1,55 @@ +--- ruby-1.8.6-p369/lib/rdoc/ri/ri_options.rb.gemmulti 2007-02-13 08:01:19.000000000 +0900 ++++ ruby-1.8.6-p369/lib/rdoc/ri/ri_options.rb 2009-10-14 01:08:42.000000000 +0900 +@@ -63,7 +63,7 @@ + + [ "--gems", nil, nil, + "Include documentation from Rubygems:\n " + +- (RI::Paths::GEMDIRS ? "#{Gem.path}/doc/*/ri" : ++ (RI::Paths::GEMDIRS ? ( tmppath=""; Gem.path.each {|path| tmppath += "#{path}/doc/*/ri "}; tmppath) : + "No Rubygems ri found.") ], + + [ "--format", "-f", "", +@@ -136,7 +136,11 @@ + RI::Paths::HOMEDIR + ] + +- directories << "#{Gem.path}/doc/*/ri" if RI::Paths::GEMDIRS ++ if RI::Paths::GEMDIRS ++ Gem.path.each {|gempath| ++ directories << "#{gempath}/doc/*/ri" ++ } ++ end + + directories = directories.join("\n ") + +--- ruby-1.8.6-p369/lib/rdoc/ri/ri_paths.rb.gemmulti 2007-02-13 08:01:19.000000000 +0900 ++++ ruby-1.8.6-p369/lib/rdoc/ri/ri_paths.rb 2009-10-13 19:58:07.000000000 +0900 +@@ -43,9 +43,14 @@ + PATH = [ SYSDIR, SITEDIR, HOMEDIR ].find_all {|p| p && File.directory?(p)} + + begin +- require 'rubygems' +- GEMDIRS = Dir["#{Gem.path}/doc/*/ri"] +- GEMDIRS.each { |path| RI::Paths::PATH << path } ++ require 'rubygems' ++ gemdirs = [] ++ Gem.path.each{ |gempath| ++ ripath = Dir["#{gempath}/doc/*/ri"] ++ ripath.each { |path| RI::Paths::PATH << path } ++ gemdirs << gempath ++ } ++ GEMDIRS = gemdirs + rescue LoadError + GEMDIRS = nil + end +@@ -71,7 +76,9 @@ + path << RI::Paths::SYSDIR if use_system + path << RI::Paths::SITEDIR if use_site + path << RI::Paths::HOMEDIR if use_home +- path << RI::Paths::GEMDIRS if use_gems ++ if use_gems ++ RI::Paths::GEMDIRS.each {|gemdirs| path << gemdirs } ++ end + + return path.flatten.compact + end diff --git a/ruby.spec b/ruby.spec index bed6afe..b470545 100644 --- a/ruby.spec +++ b/ruby.spec @@ -16,7 +16,7 @@ Name: ruby Version: %{rubyver}%{?dotpatchlevel} -Release: 1%{?dist} +Release: 2%{?dist} License: Ruby or GPLv2 URL: http://www.ruby-lang.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -44,6 +44,7 @@ Patch26: ruby-1.8.6-rexml-CVE-2008-3790.patch Patch27: ruby-1.8.6-p287-CVE-2008-5189.patch Patch28: ruby-1.8.6-p287-remove-ssl-rand-range.patch Patch29: ruby-always-use-i386.patch +Patch31: ruby-1.8.6-p369-ri-gem_multipath.patch Summary: An interpreter of object-oriented scripting language Group: Development/Languages @@ -173,6 +174,7 @@ pushd %{name}-%{arcver} %patch27 -p0 %patch28 -p1 %patch29 -p1 +%patch31 -p1 popd %build @@ -535,6 +537,10 @@ rm -rf $RPM_BUILD_ROOT %{_emacs_sitestartdir}/ruby-mode-init.el %changelog +* Wed Oct 14 2009 Mamoru Tasaka - 1.8.6.369-2 +- Fix the search path of ri command for ri manuals installed with gem + (bug 528787) + * Sat Jun 20 2009 Jeroen van Meeuwen - 1.8.6.369-1 - New patchlevel fixing CVE-2009-1904 - Fix directory on ARM (#506233, Kedar Sovani) From 04a81668f12c7556c3a1d0b6abbd4c87b6e2e73b Mon Sep 17 00:00:00 2001 From: Mamoru Tasaka Date: Wed, 14 Oct 2009 15:37:17 +0000 Subject: [PATCH 07/18] - Much better idea for Patch31 provided by Akira TAGOH --- ruby-1.8.6-p369-ri-gem_multipath.patch | 34 ++++++-------------------- ruby.spec | 5 +++- 2 files changed, 11 insertions(+), 28 deletions(-) diff --git a/ruby-1.8.6-p369-ri-gem_multipath.patch b/ruby-1.8.6-p369-ri-gem_multipath.patch index be66fad..e5b5872 100644 --- a/ruby-1.8.6-p369-ri-gem_multipath.patch +++ b/ruby-1.8.6-p369-ri-gem_multipath.patch @@ -1,11 +1,11 @@ --- ruby-1.8.6-p369/lib/rdoc/ri/ri_options.rb.gemmulti 2007-02-13 08:01:19.000000000 +0900 -+++ ruby-1.8.6-p369/lib/rdoc/ri/ri_options.rb 2009-10-14 01:08:42.000000000 +0900 ++++ ruby-1.8.6-p369/lib/rdoc/ri/ri_options.rb 2009-10-14 23:51:09.000000000 +0900 @@ -63,7 +63,7 @@ [ "--gems", nil, nil, "Include documentation from Rubygems:\n " + - (RI::Paths::GEMDIRS ? "#{Gem.path}/doc/*/ri" : -+ (RI::Paths::GEMDIRS ? ( tmppath=""; Gem.path.each {|path| tmppath += "#{path}/doc/*/ri "}; tmppath) : ++ (RI::Paths::GEMDIRS ? Gem.path.map {|path| "#{path}/doc/*/ri" }.join(', ') : "No Rubygems ri found.") ], [ "--format", "-f", "", @@ -23,33 +23,13 @@ directories = directories.join("\n ") --- ruby-1.8.6-p369/lib/rdoc/ri/ri_paths.rb.gemmulti 2007-02-13 08:01:19.000000000 +0900 -+++ ruby-1.8.6-p369/lib/rdoc/ri/ri_paths.rb 2009-10-13 19:58:07.000000000 +0900 -@@ -43,9 +43,14 @@ - PATH = [ SYSDIR, SITEDIR, HOMEDIR ].find_all {|p| p && File.directory?(p)} ++++ ruby-1.8.6-p369/lib/rdoc/ri/ri_paths.rb 2009-10-15 00:02:05.000000000 +0900 +@@ -44,7 +44,7 @@ begin -- require 'rubygems' + require 'rubygems' - GEMDIRS = Dir["#{Gem.path}/doc/*/ri"] -- GEMDIRS.each { |path| RI::Paths::PATH << path } -+ require 'rubygems' -+ gemdirs = [] -+ Gem.path.each{ |gempath| -+ ripath = Dir["#{gempath}/doc/*/ri"] -+ ripath.each { |path| RI::Paths::PATH << path } -+ gemdirs << gempath -+ } -+ GEMDIRS = gemdirs ++ GEMDIRS = Gem.path.map {|path| Dir["#{path}/doc/*/ri"]}.flatten + GEMDIRS.each { |path| RI::Paths::PATH << path } rescue LoadError GEMDIRS = nil - end -@@ -71,7 +76,9 @@ - path << RI::Paths::SYSDIR if use_system - path << RI::Paths::SITEDIR if use_site - path << RI::Paths::HOMEDIR if use_home -- path << RI::Paths::GEMDIRS if use_gems -+ if use_gems -+ RI::Paths::GEMDIRS.each {|gemdirs| path << gemdirs } -+ end - - return path.flatten.compact - end diff --git a/ruby.spec b/ruby.spec index b470545..eacc9ae 100644 --- a/ruby.spec +++ b/ruby.spec @@ -16,7 +16,7 @@ Name: ruby Version: %{rubyver}%{?dotpatchlevel} -Release: 2%{?dist} +Release: 3%{?dist} License: Ruby or GPLv2 URL: http://www.ruby-lang.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -537,6 +537,9 @@ rm -rf $RPM_BUILD_ROOT %{_emacs_sitestartdir}/ruby-mode-init.el %changelog +* Wed Oct 14 2009 Mamoru Tasaka - 1.8.6.369-3 +- Much better idea for Patch31 provided by Akira TAGOH + * Wed Oct 14 2009 Mamoru Tasaka - 1.8.6.369-2 - Fix the search path of ri command for ri manuals installed with gem (bug 528787) From 70c675d6637331655fcca3eb5cb9cb4a0c6650cd Mon Sep 17 00:00:00 2001 From: Jeroen van Meeuwen Date: Thu, 22 Oct 2009 15:34:22 +0000 Subject: [PATCH 08/18] 1.8.6.383-1.fc11 --- .cvsignore | 2 +- import.log | 1 + ruby-1.8.6-p369-ri-gem_multipath.patch | 35 ------------------- ....patch => ruby-1.8.6-p383-rubyprefix.patch | 33 +++++++++-------- ruby.spec | 15 ++------ sources | 2 +- 6 files changed, 24 insertions(+), 64 deletions(-) delete mode 100644 ruby-1.8.6-p369-ri-gem_multipath.patch rename ruby-rubyprefix.patch => ruby-1.8.6-p383-rubyprefix.patch (76%) diff --git a/.cvsignore b/.cvsignore index 9be1be4..dd58fe3 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,4 +1,4 @@ ruby-refm-rdp-1.8.2-ja-html.tar.gz rubyfaq-990927.tar.gz rubyfaq-jp-990927.tar.gz -ruby-1.8.6-p369.tar.bz2 +ruby-1.8.6-p383.tar.bz2 diff --git a/import.log b/import.log index 6c75724..a105239 100644 --- a/import.log +++ b/import.log @@ -4,3 +4,4 @@ ruby-1_8_6_287-7_fc11:HEAD:ruby-1.8.6.287-7.fc11.src.rpm:1237351812 ruby-1_8_6_368-1_fc11:F-11:ruby-1.8.6.368-1.fc11.src.rpm:1243759224 ruby-1_8_6_368-2_fc11:F-11:ruby-1.8.6.368-2.fc11.src.rpm:1245520335 ruby-1_8_6_369-1_fc11:F-11:ruby-1.8.6.369-1.fc11.src.rpm:1245760801 +ruby-1_8_6_383-1_fc11:F-11:ruby-1.8.6.383-1.fc11.src.rpm:1256225647 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 e5b5872..0000000 --- a/ruby-1.8.6-p369-ri-gem_multipath.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- ruby-1.8.6-p369/lib/rdoc/ri/ri_options.rb.gemmulti 2007-02-13 08:01:19.000000000 +0900 -+++ ruby-1.8.6-p369/lib/rdoc/ri/ri_options.rb 2009-10-14 23:51:09.000000000 +0900 -@@ -63,7 +63,7 @@ - - [ "--gems", nil, nil, - "Include documentation from Rubygems:\n " + -- (RI::Paths::GEMDIRS ? "#{Gem.path}/doc/*/ri" : -+ (RI::Paths::GEMDIRS ? Gem.path.map {|path| "#{path}/doc/*/ri" }.join(', ') : - "No Rubygems ri found.") ], - - [ "--format", "-f", "", -@@ -136,7 +136,11 @@ - RI::Paths::HOMEDIR - ] - -- directories << "#{Gem.path}/doc/*/ri" if RI::Paths::GEMDIRS -+ if RI::Paths::GEMDIRS -+ Gem.path.each {|gempath| -+ directories << "#{gempath}/doc/*/ri" -+ } -+ end - - directories = directories.join("\n ") - ---- ruby-1.8.6-p369/lib/rdoc/ri/ri_paths.rb.gemmulti 2007-02-13 08:01:19.000000000 +0900 -+++ ruby-1.8.6-p369/lib/rdoc/ri/ri_paths.rb 2009-10-15 00:02:05.000000000 +0900 -@@ -44,7 +44,7 @@ - - begin - require 'rubygems' -- GEMDIRS = Dir["#{Gem.path}/doc/*/ri"] -+ GEMDIRS = Gem.path.map {|path| Dir["#{path}/doc/*/ri"]}.flatten - GEMDIRS.each { |path| RI::Paths::PATH << path } - rescue LoadError - GEMDIRS = nil diff --git a/ruby-rubyprefix.patch b/ruby-1.8.6-p383-rubyprefix.patch similarity index 76% rename from ruby-rubyprefix.patch rename to ruby-1.8.6-p383-rubyprefix.patch index 8d1bd0c..1f0fa43 100644 --- a/ruby-rubyprefix.patch +++ b/ruby-1.8.6-p383-rubyprefix.patch @@ -1,7 +1,7 @@ -diff -pruN ruby-1.8.6-p287.orig/configure.in ruby-1.8.6-p287/configure.in ---- ruby-1.8.6-p287.orig/configure.in 2008-07-13 00:03:28.000000000 +0900 -+++ ruby-1.8.6-p287/configure.in 2008-08-14 01:08:00.000000000 +0900 -@@ -1608,6 +1608,13 @@ case "$target_os" in +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 @@ -15,12 +15,12 @@ diff -pruN ruby-1.8.6-p287.orig/configure.in ruby-1.8.6-p287/configure.in case "$target_os" in cygwin*|mingw*|*djgpp*|os2-emx*) RUBY_LIB_PREFIX="/lib/ruby" -@@ -1616,20 +1623,29 @@ case "$target_os" in - RUBY_LIB_PREFIX="${prefix}/lib/ruby" +@@ -1621,20 +1628,30 @@ + RUBY_LIB_PREFIX="`eval "echo ${libdir}"`/ruby" ;; esac +else -+ RUBY_LIB_PREFIX="${with_ruby_prefix}/ruby" ++ RUBY_LIB_PREFIX="${with_ruby_prefix}/ruby" +fi RUBY_LIB_PATH="${RUBY_LIB_PREFIX}/${MAJOR}.${MINOR}" +RUBY_LIB_PATH2="${libdir}/ruby/${MAJOR}.${MINOR}" @@ -28,12 +28,13 @@ diff -pruN ruby-1.8.6-p287.orig/configure.in ruby-1.8.6-p287/configure.in AC_ARG_WITH(sitedir, [ --with-sitedir=DIR site libraries in DIR [PREFIX/lib/ruby/site_ruby]], [sitedir=$withval], - [sitedir='${prefix}/lib/ruby/site_ruby']) + [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\(/.*\)"`" || @@ -47,7 +48,7 @@ diff -pruN ruby-1.8.6-p287.orig/configure.in ruby-1.8.6-p287/configure.in RUBY_SITE_LIB_PATH2="${RUBY_SITE_LIB_PATH}/${MAJOR}.${MINOR}" AC_DEFINE_UNQUOTED(RUBY_LIB, "${RUBY_LIB_PATH}") -@@ -1639,6 +1655,7 @@ AC_DEFINE_UNQUOTED(RUBY_SITE_LIB2, "${RU +@@ -1644,6 +1661,7 @@ AC_SUBST(arch)dnl AC_SUBST(sitearch)dnl AC_SUBST(sitedir)dnl @@ -55,7 +56,7 @@ diff -pruN ruby-1.8.6-p287.orig/configure.in ruby-1.8.6-p287/configure.in configure_args=$ac_configure_args AC_SUBST(configure_args)dnl -@@ -1647,7 +1664,7 @@ if test "$fat_binary" != no ; then +@@ -1652,7 +1670,7 @@ arch="fat-${target_os}" AC_DEFINE_UNQUOTED(RUBY_THIN_ARCHLIB, @@ -64,7 +65,7 @@ diff -pruN ruby-1.8.6-p287.orig/configure.in ruby-1.8.6-p287/configure.in AC_DEFINE_UNQUOTED(RUBY_SITE_THIN_ARCHLIB, "${RUBY_SITE_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}") -@@ -1662,8 +1679,8 @@ case "$target_os" in +@@ -1667,8 +1685,8 @@ *) sitearch="${arch}" ;; esac @@ -75,10 +76,12 @@ diff -pruN ruby-1.8.6-p287.orig/configure.in ruby-1.8.6-p287/configure.in AC_ARG_WITH(search-path, [ --with-search-path=DIR specify the additional search path], -diff -pruN ruby-1.8.6-p287.orig/mkconfig.rb ruby-1.8.6-p287/mkconfig.rb ---- ruby-1.8.6-p287.orig/mkconfig.rb 2008-06-08 01:37:10.000000000 +0900 -+++ ruby-1.8.6-p287/mkconfig.rb 2008-08-14 01:08:00.000000000 +0900 -@@ -139,10 +139,10 @@ print(*v_fast) +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 < - 1.8.6.369-3 -- Much better idea for Patch31 provided by Akira TAGOH - -* Wed Oct 14 2009 Mamoru Tasaka - 1.8.6.369-2 -- Fix the search path of ri command for ri manuals installed with gem - (bug 528787) - * Sat Jun 20 2009 Jeroen van Meeuwen - 1.8.6.369-1 - New patchlevel fixing CVE-2009-1904 - Fix directory on ARM (#506233, Kedar Sovani) diff --git a/sources b/sources index 34e5163..a667a08 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ b6dd396f513efeb7864685c840f9643a ruby-refm-rdp-1.8.2-ja-html.tar.gz 634c25b14e19925d10af3720d72e8741 rubyfaq-990927.tar.gz 4fcec898f51d8371cc42d0a013940469 rubyfaq-jp-990927.tar.gz -c3c1f3dd0dfbd2e17a04e59c2f12cfc8 ruby-1.8.6-p369.tar.bz2 +a48703cd982b9f0e3002700a50b0e88e ruby-1.8.6-p383.tar.bz2 From 9b010465398890f0978a1c8bb447b5fb2b5b4ead Mon Sep 17 00:00:00 2001 From: Mamoru Tasaka Date: Fri, 23 Oct 2009 17:37:43 +0000 Subject: [PATCH 09/18] - Restore the previous changes --- ruby-1.8.6-p369-ri-gem_multipath.patch | 35 ++++++++++++++++++++++++++ ruby.spec | 17 ++++++++++++- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 ruby-1.8.6-p369-ri-gem_multipath.patch diff --git a/ruby-1.8.6-p369-ri-gem_multipath.patch b/ruby-1.8.6-p369-ri-gem_multipath.patch new file mode 100644 index 0000000..e5b5872 --- /dev/null +++ b/ruby-1.8.6-p369-ri-gem_multipath.patch @@ -0,0 +1,35 @@ +--- ruby-1.8.6-p369/lib/rdoc/ri/ri_options.rb.gemmulti 2007-02-13 08:01:19.000000000 +0900 ++++ ruby-1.8.6-p369/lib/rdoc/ri/ri_options.rb 2009-10-14 23:51:09.000000000 +0900 +@@ -63,7 +63,7 @@ + + [ "--gems", nil, nil, + "Include documentation from Rubygems:\n " + +- (RI::Paths::GEMDIRS ? "#{Gem.path}/doc/*/ri" : ++ (RI::Paths::GEMDIRS ? Gem.path.map {|path| "#{path}/doc/*/ri" }.join(', ') : + "No Rubygems ri found.") ], + + [ "--format", "-f", "", +@@ -136,7 +136,11 @@ + RI::Paths::HOMEDIR + ] + +- directories << "#{Gem.path}/doc/*/ri" if RI::Paths::GEMDIRS ++ if RI::Paths::GEMDIRS ++ Gem.path.each {|gempath| ++ directories << "#{gempath}/doc/*/ri" ++ } ++ end + + directories = directories.join("\n ") + +--- ruby-1.8.6-p369/lib/rdoc/ri/ri_paths.rb.gemmulti 2007-02-13 08:01:19.000000000 +0900 ++++ ruby-1.8.6-p369/lib/rdoc/ri/ri_paths.rb 2009-10-15 00:02:05.000000000 +0900 +@@ -44,7 +44,7 @@ + + begin + require 'rubygems' +- GEMDIRS = Dir["#{Gem.path}/doc/*/ri"] ++ GEMDIRS = Gem.path.map {|path| Dir["#{path}/doc/*/ri"]}.flatten + GEMDIRS.each { |path| RI::Paths::PATH << path } + rescue LoadError + GEMDIRS = nil diff --git a/ruby.spec b/ruby.spec index 8f1dec5..d30be66 100644 --- a/ruby.spec +++ b/ruby.spec @@ -16,7 +16,7 @@ Name: ruby Version: %{rubyver}%{?dotpatchlevel} -Release: 1%{?dist} +Release: 2%{?dist} License: Ruby or GPLv2 URL: http://www.ruby-lang.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -44,6 +44,7 @@ Patch26: ruby-1.8.6-rexml-CVE-2008-3790.patch Patch27: ruby-1.8.6-p287-CVE-2008-5189.patch Patch28: ruby-1.8.6-p287-remove-ssl-rand-range.patch Patch29: ruby-always-use-i386.patch +Patch31: ruby-1.8.6-p369-ri-gem_multipath.patch Summary: An interpreter of object-oriented scripting language Group: Development/Languages @@ -173,6 +174,7 @@ pushd %{name}-%{arcver} %patch27 -p0 %patch28 -p1 %patch29 -p1 +%patch31 -p1 popd %build @@ -535,6 +537,19 @@ rm -rf $RPM_BUILD_ROOT %{_emacs_sitestartdir}/ruby-mode-init.el %changelog +* Sat Oct 24 2009 Mamoru Tasaka - 1.8.6.383-2 +- Restore the previous changes + +* Sat Oct 24 2009 Jeroen van Meeuwen - 1.8.6.383-1 +- Update to 1.8.6 patchlevel 383 (bug 520063) + +* Wed Oct 14 2009 Mamoru Tasaka - 1.8.6.369-3 +- Much better idea for Patch31 provided by Akira TAGOH + +* Wed Oct 14 2009 Mamoru Tasaka - 1.8.6.369-2 +- Fix the search path of ri command for ri manuals installed with gem + (bug 528787) + * Sat Jun 20 2009 Jeroen van Meeuwen - 1.8.6.369-1 - New patchlevel fixing CVE-2009-1904 - Fix directory on ARM (#506233, Kedar Sovani) From de154d4802570090ff95c8fec4c097979471d72b Mon Sep 17 00:00:00 2001 From: Mamoru Tasaka Date: Sun, 25 Oct 2009 15:16:49 +0000 Subject: [PATCH 10/18] - Patch so that irb saves its history (bug 518584, ruby issue 1556) --- ruby-1.8head-irb-save-history.patch | 111 ++++++++++++++++++++++++++++ ruby.spec | 8 +- 2 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 ruby-1.8head-irb-save-history.patch diff --git a/ruby-1.8head-irb-save-history.patch b/ruby-1.8head-irb-save-history.patch new file mode 100644 index 0000000..9349016 --- /dev/null +++ b/ruby-1.8head-irb-save-history.patch @@ -0,0 +1,111 @@ +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.spec b/ruby.spec index d30be66..98fcb0b 100644 --- a/ruby.spec +++ b/ruby.spec @@ -16,7 +16,7 @@ Name: ruby Version: %{rubyver}%{?dotpatchlevel} -Release: 2%{?dist} +Release: 3%{?dist} License: Ruby or GPLv2 URL: http://www.ruby-lang.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -45,6 +45,8 @@ Patch27: ruby-1.8.6-p287-CVE-2008-5189.patch Patch28: ruby-1.8.6-p287-remove-ssl-rand-range.patch Patch29: ruby-always-use-i386.patch Patch31: ruby-1.8.6-p369-ri-gem_multipath.patch +# Patch from ruby_1_8 branch +Patch32: ruby-1.8head-irb-save-history.patch Summary: An interpreter of object-oriented scripting language Group: Development/Languages @@ -175,6 +177,7 @@ pushd %{name}-%{arcver} %patch28 -p1 %patch29 -p1 %patch31 -p1 +%patch32 -p0 popd %build @@ -537,6 +540,9 @@ rm -rf $RPM_BUILD_ROOT %{_emacs_sitestartdir}/ruby-mode-init.el %changelog +* Sun Oct 25 2009 Mamoru Tasaka - 1.8.6.383-3 +- Patch so that irb saves its history (bug 518584, ruby issue 1556) + * Sat Oct 24 2009 Mamoru Tasaka - 1.8.6.383-2 - Restore the previous changes From 0626aac23a42bdcba1223ef9625d55f1f2e4cc5b Mon Sep 17 00:00:00 2001 From: Mamoru Tasaka Date: Thu, 29 Oct 2009 17:06:17 +0000 Subject: [PATCH 11/18] - Use bison to regenerate parse.c to keep the original format of error messages (bug 530275 comment 4) --- ruby.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ruby.spec b/ruby.spec index 98fcb0b..f155269 100644 --- a/ruby.spec +++ b/ruby.spec @@ -16,11 +16,13 @@ Name: ruby Version: %{rubyver}%{?dotpatchlevel} -Release: 3%{?dist} +Release: 4%{?dist} License: Ruby or GPLv2 URL: http://www.ruby-lang.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: readline readline-devel 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: bison BuildRequires: emacs Source0: ftp://ftp.ruby-lang.org/pub/%{name}/%{rubyxver}/%{name}-%{arcver}.tar.bz2 @@ -540,6 +542,10 @@ rm -rf $RPM_BUILD_ROOT %{_emacs_sitestartdir}/ruby-mode-init.el %changelog +* Thu Oct 29 2009 Mamoru Tasaka - 1.8.6.383-4 +- Use bison to regenerate parse.c to keep the original format of error + messages (bug 530275 comment 4) + * Sun Oct 25 2009 Mamoru Tasaka - 1.8.6.383-3 - Patch so that irb saves its history (bug 518584, ruby issue 1556) From f6e0b7bfc3a0a38463746a63f7d58a5eb6f900af Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 26 Nov 2009 01:30:24 +0000 Subject: [PATCH 12/18] Fix typo that causes a failure to update the common directory. (releng #2781) --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d363f5c..9141959 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ # Makefile for source rpm: ruby -# $Id: Makefile,v 1.1 2004/09/09 11:54:27 cvsdist Exp $ +# $Id: Makefile,v 1.2 2007/10/15 19:21:20 notting Exp $ NAME := ruby SPECFILE = $(firstword $(wildcard *.spec)) define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done endef MAKEFILE_COMMON := $(shell $(find-makefile-common)) From bbb75e646f6804154cab2c290ae599be7cfcb133 Mon Sep 17 00:00:00 2001 From: Mamoru Tasaka Date: Tue, 12 Jan 2010 19:11:19 +0000 Subject: [PATCH 13/18] - CVE-2009-4492 ruby WEBrick log escape sequence (bug 554485) --- ruby-1.8.6-p383-mkmf-use-shared.patch | 11 +++ ruby-1.8.6.x-CVE-2009-4492.patch | 134 ++++++++++++++++++++++++++ ruby.spec | 38 +++++++- 3 files changed, 179 insertions(+), 4 deletions(-) create mode 100644 ruby-1.8.6-p383-mkmf-use-shared.patch create mode 100644 ruby-1.8.6.x-CVE-2009-4492.patch diff --git a/ruby-1.8.6-p383-mkmf-use-shared.patch b/ruby-1.8.6-p383-mkmf-use-shared.patch new file mode 100644 index 0000000..fb0e6a5 --- /dev/null +++ b/ruby-1.8.6-p383-mkmf-use-shared.patch @@ -0,0 +1,11 @@ +--- 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.x-CVE-2009-4492.patch b/ruby-1.8.6.x-CVE-2009-4492.patch new file mode 100644 index 0000000..00fa053 --- /dev/null +++ b/ruby-1.8.6.x-CVE-2009-4492.patch @@ -0,0 +1,134 @@ +Index: lib/webrick/httpstatus.rb +=================================================================== +--- lib/webrick/httpstatus.rb (revision 26273) ++++ lib/webrick/httpstatus.rb (revision 26274) +@@ -12,7 +12,17 @@ + + module HTTPStatus + +- class Status < StandardError; end ++ class Status < StandardError ++ def initialize(message=self.class, *rest) ++ super(AccessLog.escape(message), *rest) ++ end ++ class << self ++ attr_reader :code, :reason_phrase ++ end ++ def code() self::class::code end ++ def reason_phrase() self::class::reason_phrase end ++ alias to_i code ++ end + class Info < Status; end + class Success < Status; end + class Redirect < Status; end +@@ -68,6 +78,7 @@ + CodeToError = {} + + StatusMessage.each{|code, message| ++ message.freeze + var_name = message.gsub(/[ \-]/,'_').upcase + err_name = message.gsub(/[ \-]/,'') + +@@ -79,18 +90,12 @@ + when 500...600; parent = ServerError + end + +- eval %- +- RC_#{var_name} = #{code} +- class #{err_name} < #{parent} +- def self.code() RC_#{var_name} end +- def self.reason_phrase() StatusMessage[code] end +- def code() self::class::code end +- def reason_phrase() self::class::reason_phrase end +- alias to_i code +- end +- - +- +- CodeToError[code] = const_get(err_name) ++ const_set("RC_#{var_name}", code) ++ err_class = Class.new(parent) ++ err_class.instance_variable_set(:@code, code) ++ err_class.instance_variable_set(:@reason_phrase, message) ++ const_set(err_name, err_class) ++ CodeToError[code] = err_class + } + + def reason_phrase(code) +Index: lib/webrick/httprequest.rb +=================================================================== +--- lib/webrick/httprequest.rb (revision 26273) ++++ lib/webrick/httprequest.rb (revision 26274) +@@ -242,11 +242,7 @@ + @raw_header << line + end + end +- begin +- @header = HTTPUtils::parse_header(@raw_header) +- rescue => ex +- raise HTTPStatus::BadRequest, ex.message +- end ++ @header = HTTPUtils::parse_header(@raw_header.join) + end + + def parse_uri(str, scheme="http") +Index: lib/webrick/httpresponse.rb +=================================================================== +--- lib/webrick/httpresponse.rb (revision 26273) ++++ lib/webrick/httpresponse.rb (revision 26274) +@@ -132,7 +132,7 @@ + end + end + +- # Determin the message length (RFC2616 -- 4.4 Message Length) ++ # Determine the message length (RFC2616 -- 4.4 Message Length) + if @status == 304 || @status == 204 || HTTPStatus::info?(@status) + @header.delete('content-length') + @body = "" +Index: lib/webrick/httputils.rb +=================================================================== +--- lib/webrick/httputils.rb (revision 26273) ++++ lib/webrick/httputils.rb (revision 26274) +@@ -128,11 +128,11 @@ + when /^\s+(.*?)\s*\z/om + value = $1 + unless field +- raise "bad header '#{line.inspect}'." ++ raise HTTPStatus::BadRequest, "bad header '#{line}'." + end + header[field][-1] << " " << value + else +- raise "bad header '#{line.inspect}'." ++ raise HTTPStatus::BadRequest, "bad header '#{line}'." + end + } + header.each{|key, values| +Index: lib/webrick/accesslog.rb +=================================================================== +--- lib/webrick/accesslog.rb (revision 26273) ++++ lib/webrick/accesslog.rb (revision 26274) +@@ -53,15 +53,23 @@ + when ?e, ?i, ?n, ?o + raise AccessLogError, + "parameter is required for \"#{spec}\"" unless param +- params[spec][param] || "-" ++ param = params[spec][param] ? escape(param) : "-" + when ?t + params[spec].strftime(param || CLF_TIME_FORMAT) + when ?% + "%" + else +- params[spec] ++ escape(params[spec].to_s) + end + } + end ++ ++ def escape(data) ++ if data.tainted? ++ data.gsub(/[[:cntrl:]\\]+/) {$&.dump[1...-1]}.untaint ++ else ++ data ++ end ++ end + end + end diff --git a/ruby.spec b/ruby.spec index f155269..ab64ef8 100644 --- a/ruby.spec +++ b/ruby.spec @@ -16,7 +16,7 @@ Name: ruby Version: %{rubyver}%{?dotpatchlevel} -Release: 4%{?dist} +Release: 6%{?dist} License: Ruby or GPLv2 URL: http://www.ruby-lang.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -47,8 +47,11 @@ Patch27: ruby-1.8.6-p287-CVE-2008-5189.patch Patch28: ruby-1.8.6-p287-remove-ssl-rand-range.patch Patch29: ruby-always-use-i386.patch Patch31: ruby-1.8.6-p369-ri-gem_multipath.patch -# Patch from ruby_1_8 branch +# Patch32 from ruby_1_8 branch Patch32: ruby-1.8head-irb-save-history.patch +Patch33: ruby-1.8.6-p383-mkmf-use-shared.patch +# Patch34 already applied in 1.8.6p388 +Patch34: ruby-1.8.6.x-CVE-2009-4492.patch Summary: An interpreter of object-oriented scripting language Group: Development/Languages @@ -79,12 +82,20 @@ This package includes the libruby, necessary to run Ruby. Summary: A Ruby development environment Group: Development/Languages Requires: %{name}-libs = %{version}-%{release} -Provides: %{name}-libs-static = %{version}-%{release} +#Provides: %{name}-libs-static = %{version}-%{release} %description devel Header files and libraries for building a extension library for the Ruby or an application embedded Ruby. +%package static +Summary: Static libraries for Ruby development environment +Group: Development/Languages +Requires: %{name}-devel = %{version}-%{release} + +%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 @@ -180,6 +191,8 @@ pushd %{name}-%{arcver} %patch29 -p1 %patch31 -p1 %patch32 -p0 +%patch33 -p1 +%patch34 -p0 popd %build @@ -206,6 +219,11 @@ export CFLAGS --disable-rpath \ --with-ruby-prefix=%{_prefix}/lib +# 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} %ifarch ia64 # Miscompilation? Buggy code? @@ -397,9 +415,13 @@ rm -rf $RPM_BUILD_ROOT %doc %{name}-%{arcver}/README.EXT %lang(ja) %doc %{name}-%{arcver}/README.EXT.ja %{_libdir}/libruby.so -%{_libdir}/libruby-static.a +#%%{_libdir}/libruby-static.a %{_libdir}/ruby/%{rubyxver}/*/*.h +%files static +%defattr(-, root, root, -) +%{_libdir}/libruby-static.a + %files libs %defattr(-, root, root, -) %doc %{name}-%{arcver}/README @@ -542,6 +564,14 @@ rm -rf $RPM_BUILD_ROOT %{_emacs_sitestartdir}/ruby-mode-init.el %changelog +* Wed Jan 13 2010 Mamoru Tasaka - 1.8.6.383-6 +- CVE-2009-4492 ruby WEBrick log escape sequence (bug 554485) + +* Wed Dec 9 2009 Mamoru Tasaka - 1.8.6.383-5 +- Change mkmf.rb to use LIBRUBYARG_SHARED so that have_library() works + without libruby-static.a (bug 428384) +- And move libruby-static.a to -static subpackage + * Thu Oct 29 2009 Mamoru Tasaka - 1.8.6.383-4 - Use bison to regenerate parse.c to keep the original format of error messages (bug 530275 comment 4) From 581a67640d7e6b5fa17d211ff1c13d8575563228 Mon Sep 17 00:00:00 2001 From: Jeroen van Meeuwen Date: Thu, 21 Jan 2010 00:14:11 +0000 Subject: [PATCH 14/18] 1.8.6.388-6 --- .cvsignore | 2 +- import.log | 1 + ruby-1.8.6.x-CVE-2009-4492.patch | 134 ----------------------- ruby-openssl-1.0.patch | 176 +++++++++++++++++++++++++++++++ ruby.spec | 35 ++++-- sources | 2 +- 6 files changed, 204 insertions(+), 146 deletions(-) delete mode 100644 ruby-1.8.6.x-CVE-2009-4492.patch create mode 100644 ruby-openssl-1.0.patch diff --git a/.cvsignore b/.cvsignore index dd58fe3..abc7fa1 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,4 +1,4 @@ ruby-refm-rdp-1.8.2-ja-html.tar.gz rubyfaq-990927.tar.gz rubyfaq-jp-990927.tar.gz -ruby-1.8.6-p383.tar.bz2 +ruby-1.8.6-p388.tar.bz2 diff --git a/import.log b/import.log index a105239..85f601f 100644 --- a/import.log +++ b/import.log @@ -5,3 +5,4 @@ ruby-1_8_6_368-1_fc11:F-11:ruby-1.8.6.368-1.fc11.src.rpm:1243759224 ruby-1_8_6_368-2_fc11:F-11:ruby-1.8.6.368-2.fc11.src.rpm:1245520335 ruby-1_8_6_369-1_fc11:F-11:ruby-1.8.6.369-1.fc11.src.rpm:1245760801 ruby-1_8_6_383-1_fc11:F-11:ruby-1.8.6.383-1.fc11.src.rpm:1256225647 +ruby-1_8_6_388-6_fc12:F-11:ruby-1.8.6.388-6.fc12.src.rpm:1264032783 diff --git a/ruby-1.8.6.x-CVE-2009-4492.patch b/ruby-1.8.6.x-CVE-2009-4492.patch deleted file mode 100644 index 00fa053..0000000 --- a/ruby-1.8.6.x-CVE-2009-4492.patch +++ /dev/null @@ -1,134 +0,0 @@ -Index: lib/webrick/httpstatus.rb -=================================================================== ---- lib/webrick/httpstatus.rb (revision 26273) -+++ lib/webrick/httpstatus.rb (revision 26274) -@@ -12,7 +12,17 @@ - - module HTTPStatus - -- class Status < StandardError; end -+ class Status < StandardError -+ def initialize(message=self.class, *rest) -+ super(AccessLog.escape(message), *rest) -+ end -+ class << self -+ attr_reader :code, :reason_phrase -+ end -+ def code() self::class::code end -+ def reason_phrase() self::class::reason_phrase end -+ alias to_i code -+ end - class Info < Status; end - class Success < Status; end - class Redirect < Status; end -@@ -68,6 +78,7 @@ - CodeToError = {} - - StatusMessage.each{|code, message| -+ message.freeze - var_name = message.gsub(/[ \-]/,'_').upcase - err_name = message.gsub(/[ \-]/,'') - -@@ -79,18 +90,12 @@ - when 500...600; parent = ServerError - end - -- eval %- -- RC_#{var_name} = #{code} -- class #{err_name} < #{parent} -- def self.code() RC_#{var_name} end -- def self.reason_phrase() StatusMessage[code] end -- def code() self::class::code end -- def reason_phrase() self::class::reason_phrase end -- alias to_i code -- end -- - -- -- CodeToError[code] = const_get(err_name) -+ const_set("RC_#{var_name}", code) -+ err_class = Class.new(parent) -+ err_class.instance_variable_set(:@code, code) -+ err_class.instance_variable_set(:@reason_phrase, message) -+ const_set(err_name, err_class) -+ CodeToError[code] = err_class - } - - def reason_phrase(code) -Index: lib/webrick/httprequest.rb -=================================================================== ---- lib/webrick/httprequest.rb (revision 26273) -+++ lib/webrick/httprequest.rb (revision 26274) -@@ -242,11 +242,7 @@ - @raw_header << line - end - end -- begin -- @header = HTTPUtils::parse_header(@raw_header) -- rescue => ex -- raise HTTPStatus::BadRequest, ex.message -- end -+ @header = HTTPUtils::parse_header(@raw_header.join) - end - - def parse_uri(str, scheme="http") -Index: lib/webrick/httpresponse.rb -=================================================================== ---- lib/webrick/httpresponse.rb (revision 26273) -+++ lib/webrick/httpresponse.rb (revision 26274) -@@ -132,7 +132,7 @@ - end - end - -- # Determin the message length (RFC2616 -- 4.4 Message Length) -+ # Determine the message length (RFC2616 -- 4.4 Message Length) - if @status == 304 || @status == 204 || HTTPStatus::info?(@status) - @header.delete('content-length') - @body = "" -Index: lib/webrick/httputils.rb -=================================================================== ---- lib/webrick/httputils.rb (revision 26273) -+++ lib/webrick/httputils.rb (revision 26274) -@@ -128,11 +128,11 @@ - when /^\s+(.*?)\s*\z/om - value = $1 - unless field -- raise "bad header '#{line.inspect}'." -+ raise HTTPStatus::BadRequest, "bad header '#{line}'." - end - header[field][-1] << " " << value - else -- raise "bad header '#{line.inspect}'." -+ raise HTTPStatus::BadRequest, "bad header '#{line}'." - end - } - header.each{|key, values| -Index: lib/webrick/accesslog.rb -=================================================================== ---- lib/webrick/accesslog.rb (revision 26273) -+++ lib/webrick/accesslog.rb (revision 26274) -@@ -53,15 +53,23 @@ - when ?e, ?i, ?n, ?o - raise AccessLogError, - "parameter is required for \"#{spec}\"" unless param -- params[spec][param] || "-" -+ param = params[spec][param] ? escape(param) : "-" - when ?t - params[spec].strftime(param || CLF_TIME_FORMAT) - when ?% - "%" - else -- params[spec] -+ escape(params[spec].to_s) - end - } - end -+ -+ def escape(data) -+ if data.tainted? -+ data.gsub(/[[:cntrl:]\\]+/) {$&.dump[1...-1]}.untaint -+ else -+ data -+ end -+ end - end - end diff --git a/ruby-openssl-1.0.patch b/ruby-openssl-1.0.patch new file mode 100644 index 0000000..508fd75 --- /dev/null +++ b/ruby-openssl-1.0.patch @@ -0,0 +1,176 @@ +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 ab64ef8..e947c4c 100644 --- a/ruby.spec +++ b/ruby.spec @@ -1,6 +1,6 @@ %define rubyxver 1.8 %define rubyver 1.8.6 -%define _patchlevel 383 +%define _patchlevel 388 %define dotpatchlevel %{?_patchlevel:.%{_patchlevel}} %define patchlevel %{?_patchlevel:-p%{_patchlevel}} %define arcver %{rubyver}%{?patchlevel} @@ -20,7 +20,12 @@ Release: 6%{?dist} License: Ruby or GPLv2 URL: http://www.ruby-lang.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: readline readline-devel ncurses ncurses-devel gdbm gdbm-devel glibc-devel tcl-devel tk-devel libX11-devel autoconf gcc unzip openssl-devel db4-devel byacc +%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: bison BuildRequires: emacs @@ -46,12 +51,11 @@ Patch26: ruby-1.8.6-rexml-CVE-2008-3790.patch Patch27: ruby-1.8.6-p287-CVE-2008-5189.patch Patch28: ruby-1.8.6-p287-remove-ssl-rand-range.patch Patch29: ruby-always-use-i386.patch +Patch30: ruby-openssl-1.0.patch Patch31: ruby-1.8.6-p369-ri-gem_multipath.patch # Patch32 from ruby_1_8 branch Patch32: ruby-1.8head-irb-save-history.patch Patch33: ruby-1.8.6-p383-mkmf-use-shared.patch -# Patch34 already applied in 1.8.6p388 -Patch34: ruby-1.8.6.x-CVE-2009-4492.patch Summary: An interpreter of object-oriented scripting language Group: Development/Languages @@ -189,10 +193,10 @@ pushd %{name}-%{arcver} %patch27 -p0 %patch28 -p1 %patch29 -p1 +%patch30 -p2 %patch31 -p1 %patch32 -p0 %patch33 -p1 -%patch34 -p0 popd %build @@ -217,6 +221,10 @@ export CFLAGS --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 # For example ext/socket/extconf.rb uses try_run (for getaddrinfo test), @@ -564,6 +572,9 @@ rm -rf $RPM_BUILD_ROOT %{_emacs_sitestartdir}/ruby-mode-init.el %changelog +* Mon Jan 18 2010 Akira TAGOH +- Add conditional for RHEL. + * Wed Jan 13 2010 Mamoru Tasaka - 1.8.6.383-6 - CVE-2009-4492 ruby WEBrick log escape sequence (bug 554485) @@ -580,18 +591,22 @@ rm -rf $RPM_BUILD_ROOT - Patch so that irb saves its history (bug 518584, ruby issue 1556) * Sat Oct 24 2009 Mamoru Tasaka - 1.8.6.383-2 -- Restore the previous changes - -* Sat Oct 24 2009 Jeroen van Meeuwen - 1.8.6.383-1 - Update to 1.8.6 patchlevel 383 (bug 520063) -* Wed Oct 14 2009 Mamoru Tasaka - 1.8.6.369-3 +* Wed Oct 14 2009 Mamoru Tasaka - 1.8.6.369-5 - Much better idea for Patch31 provided by Akira TAGOH -* Wed Oct 14 2009 Mamoru Tasaka - 1.8.6.369-2 +* Wed Oct 14 2009 Mamoru Tasaka - 1.8.6.369-4 - Fix the search path of ri command for ri manuals installed with gem (bug 528787) +* Wed Aug 26 2009 Tomas Mraz - 1.8.6.369-3 +- Rebuild against new openssl + +* 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 + * Sat Jun 20 2009 Jeroen van Meeuwen - 1.8.6.369-1 - New patchlevel fixing CVE-2009-1904 - Fix directory on ARM (#506233, Kedar Sovani) diff --git a/sources b/sources index a667a08..d9a2f79 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ b6dd396f513efeb7864685c840f9643a ruby-refm-rdp-1.8.2-ja-html.tar.gz 634c25b14e19925d10af3720d72e8741 rubyfaq-990927.tar.gz 4fcec898f51d8371cc42d0a013940469 rubyfaq-jp-990927.tar.gz -a48703cd982b9f0e3002700a50b0e88e ruby-1.8.6-p383.tar.bz2 +f26cefbc8ab6728650ab9ae773d22bcb ruby-1.8.6-p388.tar.bz2 From b75ade43dabf19f7571178cc99a57fe16ed41b28 Mon Sep 17 00:00:00 2001 From: Jeroen van Meeuwen Date: Wed, 27 Jan 2010 12:39:02 +0000 Subject: [PATCH 15/18] 1.8.6.388-7 --- .cvsignore | 2 +- import.log | 1 + ruby.spec | 8 ++++++-- sources | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.cvsignore b/.cvsignore index abc7fa1..237576f 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,4 +1,4 @@ +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-p388.tar.bz2 diff --git a/import.log b/import.log index 85f601f..eaff536 100644 --- a/import.log +++ b/import.log @@ -6,3 +6,4 @@ ruby-1_8_6_368-2_fc11:F-11:ruby-1.8.6.368-2.fc11.src.rpm:1245520335 ruby-1_8_6_369-1_fc11:F-11:ruby-1.8.6.369-1.fc11.src.rpm:1245760801 ruby-1_8_6_383-1_fc11:F-11:ruby-1.8.6.383-1.fc11.src.rpm:1256225647 ruby-1_8_6_388-6_fc12:F-11:ruby-1.8.6.388-6.fc12.src.rpm:1264032783 +ruby-1_8_6_388-7_fc12:F-11:ruby-1.8.6.388-7.fc12.src.rpm:1264595869 diff --git a/ruby.spec b/ruby.spec index e947c4c..541f5af 100644 --- a/ruby.spec +++ b/ruby.spec @@ -16,7 +16,7 @@ Name: ruby Version: %{rubyver}%{?dotpatchlevel} -Release: 6%{?dist} +Release: 7%{?dist} License: Ruby or GPLv2 URL: http://www.ruby-lang.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -572,7 +572,11 @@ rm -rf $RPM_BUILD_ROOT %{_emacs_sitestartdir}/ruby-mode-init.el %changelog -* Mon Jan 18 2010 Akira TAGOH +* Wed Jan 27 2010 Jeroen van Meeuwen - 1.8.6.388-7 +- Make sure that Red Hat people version their changelog entries +- This is actually release #1, but now needs to be release #7 + +* Mon Jan 18 2010 Akira TAGOH - 1.8.6.388-1 - Add conditional for RHEL. * Wed Jan 13 2010 Mamoru Tasaka - 1.8.6.383-6 diff --git a/sources b/sources index d9a2f79..402aa20 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ +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 -f26cefbc8ab6728650ab9ae773d22bcb ruby-1.8.6-p388.tar.bz2 From 0a36cfbd1beafd916e46415ac1710185449ab79a Mon Sep 17 00:00:00 2001 From: Jeroen van Meeuwen Date: Wed, 27 Jan 2010 14:17:08 +0000 Subject: [PATCH 16/18] 1.8.6.388-8 --- import.log | 1 + ruby-1.8.6-simplify-openssl-digest.patch | 239 +++++++++++++++++++++++ ruby.spec | 10 +- 3 files changed, 248 insertions(+), 2 deletions(-) create mode 100644 ruby-1.8.6-simplify-openssl-digest.patch diff --git a/import.log b/import.log index eaff536..cb9fb58 100644 --- a/import.log +++ b/import.log @@ -7,3 +7,4 @@ ruby-1_8_6_369-1_fc11:F-11:ruby-1.8.6.369-1.fc11.src.rpm:1245760801 ruby-1_8_6_383-1_fc11:F-11:ruby-1.8.6.383-1.fc11.src.rpm:1256225647 ruby-1_8_6_388-6_fc12:F-11:ruby-1.8.6.388-6.fc12.src.rpm:1264032783 ruby-1_8_6_388-7_fc12:F-11:ruby-1.8.6.388-7.fc12.src.rpm:1264595869 +ruby-1_8_6_388-8_fc12:F-11:ruby-1.8.6.388-8.fc12.src.rpm:1264601759 diff --git a/ruby-1.8.6-simplify-openssl-digest.patch b/ruby-1.8.6-simplify-openssl-digest.patch new file mode 100644 index 0000000..2636538 --- /dev/null +++ b/ruby-1.8.6-simplify-openssl-digest.patch @@ -0,0 +1,239 @@ +diff --git a/ext/openssl/lib/openssl/digest.rb b/ext/openssl/lib/openssl/digest.rb +index b3e4484..4810f01 100644 +--- a/ext/openssl/lib/openssl/digest.rb ++++ b/ext/openssl/lib/openssl/digest.rb +@@ -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 @@ module OpenSSL + 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 + +diff --git a/ext/openssl/ossl_digest.c b/ext/openssl/ossl_digest.c +index 4096b09..b0308f0 100644 +--- a/ext/openssl/ossl_digest.c ++++ b/ext/openssl/ossl_digest.c +@@ -40,7 +40,7 @@ GetDigestPtr(VALUE obj) + + SafeGetDigest(obj, ctx); + +- return EVP_MD_CTX_md(ctx); /*== ctx->digest*/ ++ return EVP_MD_CTX_md(ctx); + } + + VALUE +@@ -51,7 +51,6 @@ ossl_digest_new(const EVP_MD *md) + + ret = ossl_digest_alloc(cDigest); + GetDigest(ret, ctx); +- EVP_MD_CTX_init(ctx); + EVP_DigestInit_ex(ctx, md, NULL); + + return ret; +@@ -69,9 +68,8 @@ ossl_digest_alloc(VALUE klass) + 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; + } + +@@ -86,14 +84,9 @@ ossl_digest_initialize(int argc, VALUE *argv, VALUE self) + 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); + +@@ -141,75 +134,25 @@ ossl_digest_update(VALUE self, VALUE 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); +-} +- +-static VALUE +-ossl_digest_digest(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; +-} +- + static VALUE +-ossl_digest_hexdigest(VALUE self) ++ossl_digest_finish(int argc, VALUE *argv, VALUE self) + { + EVP_MD_CTX *ctx; +- char *buf, *hexbuf; +- int buf_len; +- VALUE hexdigest; ++ VALUE str; ++ 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; +-} +- +-static VALUE +-ossl_digest_s_digest(VALUE klass, VALUE str, VALUE data) +-{ +- VALUE obj = rb_class_new_instance(1, &str, klass); ++ EVP_DigestFinal_ex(ctx, RSTRING_PTR(str), NULL); + +- ossl_digest_update(obj, data); ++ return str; + +- return ossl_digest_digest(obj); +-} +- +-static VALUE +-ossl_digest_s_hexdigest(VALUE klass, VALUE str, VALUE data) +-{ +- VALUE obj = rb_class_new_instance(1, &str, klass); +- +- ossl_digest_update(obj, data); +- +- return ossl_digest_hexdigest(obj); + } + + static VALUE +@@ -258,41 +201,44 @@ ossl_digest_size(VALUE self) + return INT2NUM(EVP_MD_CTX_size(ctx)); + } + ++static VALUE ++ossl_digest_block_length(VALUE self) ++{ ++ EVP_MD_CTX *ctx; ++ ++ GetDigest(self, ctx); ++ ++ return INT2NUM(EVP_MD_CTX_block_size(ctx)); ++} ++ ++ + /* + * INIT + */ + void + Init_ossl_digest() + { ++ rb_require("openssl"); ++ rb_require("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); +- +- cDigest = rb_define_class_under(mDigest, "Digest", rb_cObject); +- ++ cDigest = rb_define_class_under(mOSSL, "Digest", rb_path2class("Digest::Class")); ++ eDigestError = rb_define_class_under(cDigest, "DigestError", eOSSLError); ++ + 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.spec b/ruby.spec index 541f5af..b1fadc5 100644 --- a/ruby.spec +++ b/ruby.spec @@ -16,7 +16,7 @@ Name: ruby Version: %{rubyver}%{?dotpatchlevel} -Release: 7%{?dist} +Release: 8%{?dist} License: Ruby or GPLv2 URL: http://www.ruby-lang.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -56,6 +56,8 @@ Patch31: ruby-1.8.6-p369-ri-gem_multipath.patch # Patch32 from ruby_1_8 branch Patch32: ruby-1.8head-irb-save-history.patch Patch33: ruby-1.8.6-p383-mkmf-use-shared.patch +# Testing +Patch34: ruby-1.8.6-simplify-openssl-digest.patch Summary: An interpreter of object-oriented scripting language Group: Development/Languages @@ -197,6 +199,8 @@ pushd %{name}-%{arcver} %patch31 -p1 %patch32 -p0 %patch33 -p1 + +%patch34 -p1 popd %build @@ -572,7 +576,9 @@ rm -rf $RPM_BUILD_ROOT %{_emacs_sitestartdir}/ruby-mode-init.el %changelog -* Wed Jan 27 2010 Jeroen van Meeuwen - 1.8.6.388-7 +* Wed Jan 27 2010 Jeroen van Meeuwen - 1.8.6.388-8 +- Backport openssl/digest functions providing digest and hexdigest functions + directly in OpenSSL::Digest.methods - Make sure that Red Hat people version their changelog entries - This is actually release #1, but now needs to be release #7 From 603d5bcb0df127e7b691bfc7fb2d3a0244ad3acb Mon Sep 17 00:00:00 2001 From: Mamoru Tasaka Date: Mon, 26 Apr 2010 19:02:47 +0000 Subject: [PATCH 17/18] - Update to 1.8.6 p 399 (bug 579675) - Patch to fix gc bug causing open4 crash (bug 580993) --- .cvsignore | 1 + ruby.spec | 24 +- ruby_1_8_7-gc-open4_096segv.patch | 351 ++++++++++++++++++++++++++++++ sources | 1 + 4 files changed, 372 insertions(+), 5 deletions(-) create mode 100644 ruby_1_8_7-gc-open4_096segv.patch diff --git a/.cvsignore b/.cvsignore index 237576f..bcd6a57 100644 --- a/.cvsignore +++ b/.cvsignore @@ -2,3 +2,4 @@ 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 diff --git a/ruby.spec b/ruby.spec index b1fadc5..1fa8ccb 100644 --- a/ruby.spec +++ b/ruby.spec @@ -1,6 +1,6 @@ %define rubyxver 1.8 %define rubyver 1.8.6 -%define _patchlevel 388 +%define _patchlevel 399 %define dotpatchlevel %{?_patchlevel:.%{_patchlevel}} %define patchlevel %{?_patchlevel:-p%{_patchlevel}} %define arcver %{rubyver}%{?patchlevel} @@ -16,7 +16,7 @@ Name: ruby Version: %{rubyver}%{?dotpatchlevel} -Release: 8%{?dist} +Release: 1%{?dist} License: Ruby or GPLv2 URL: http://www.ruby-lang.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -57,7 +57,10 @@ Patch31: ruby-1.8.6-p369-ri-gem_multipath.patch Patch32: ruby-1.8head-irb-save-history.patch Patch33: ruby-1.8.6-p383-mkmf-use-shared.patch # Testing -Patch34: ruby-1.8.6-simplify-openssl-digest.patch +# Patch34 disabled for now +Patch34: ruby-1.8.6-simplify-openssl-digest.patch +# bz 580993 +Patch35: ruby_1_8_7-gc-open4_096segv.patch Summary: An interpreter of object-oriented scripting language Group: Development/Languages @@ -199,8 +202,9 @@ pushd %{name}-%{arcver} %patch31 -p1 %patch32 -p0 %patch33 -p1 - -%patch34 -p1 +# Once kill patch34 due to build failure on actionpack +#%%patch34 -p1 +%patch35 -p1 popd %build @@ -576,6 +580,16 @@ rm -rf $RPM_BUILD_ROOT %{_emacs_sitestartdir}/ruby-mode-init.el %changelog +* Tue Apr 27 2010 Mamoru Tasaka - 1.8.6.399-1 +- Update to 1.8.6 p 399 (bug 579675) +- Patch to fix gc bug causing open4 crash (bug 580993) + +* Fri Mar 12 2010 Mamoru Tasaka - 1.8.6.388-9 +- F-14: rebuild against new gdbm + +* Thu Jan 28 2010 Mamoru Tasaka +- Once revert the previous change (patch34) + * Wed Jan 27 2010 Jeroen van Meeuwen - 1.8.6.388-8 - Backport openssl/digest functions providing digest and hexdigest functions directly in OpenSSL::Digest.methods diff --git a/ruby_1_8_7-gc-open4_096segv.patch b/ruby_1_8_7-gc-open4_096segv.patch new file mode 100644 index 0000000..4514022 --- /dev/null +++ b/ruby_1_8_7-gc-open4_096segv.patch @@ -0,0 +1,351 @@ +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 402aa20..4217687 100644 --- a/sources +++ b/sources @@ -2,3 +2,4 @@ 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 From bea32eafdb8fcebde9d5a8517cbb21225511a88f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 29 Jul 2010 11:44:24 +0000 Subject: [PATCH 18/18] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 21 --------------------- branch | 1 - import.log | 10 ---------- 4 files changed, 32 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile delete mode 100644 branch delete mode 100644 import.log diff --git a/.cvsignore b/.gitignore similarity index 100% rename from .cvsignore rename to .gitignore diff --git a/Makefile b/Makefile deleted file mode 100644 index 9141959..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: ruby -# $Id: Makefile,v 1.2 2007/10/15 19:21:20 notting Exp $ -NAME := ruby -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attempt a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/branch b/branch deleted file mode 100644 index 25c7708..0000000 --- a/branch +++ /dev/null @@ -1 +0,0 @@ -F-11 diff --git a/import.log b/import.log deleted file mode 100644 index cb9fb58..0000000 --- a/import.log +++ /dev/null @@ -1,10 +0,0 @@ -ruby-1_8_6_287-4_fc10:HEAD:ruby-1.8.6.287-4.fc10.src.rpm:1237096558 -ruby-1_8_6_287-5_fc10:HEAD:ruby-1.8.6.287-5.fc10.src.rpm:1237096677 -ruby-1_8_6_287-7_fc11:HEAD:ruby-1.8.6.287-7.fc11.src.rpm:1237351812 -ruby-1_8_6_368-1_fc11:F-11:ruby-1.8.6.368-1.fc11.src.rpm:1243759224 -ruby-1_8_6_368-2_fc11:F-11:ruby-1.8.6.368-2.fc11.src.rpm:1245520335 -ruby-1_8_6_369-1_fc11:F-11:ruby-1.8.6.369-1.fc11.src.rpm:1245760801 -ruby-1_8_6_383-1_fc11:F-11:ruby-1.8.6.383-1.fc11.src.rpm:1256225647 -ruby-1_8_6_388-6_fc12:F-11:ruby-1.8.6.388-6.fc12.src.rpm:1264032783 -ruby-1_8_6_388-7_fc12:F-11:ruby-1.8.6.388-7.fc12.src.rpm:1264595869 -ruby-1_8_6_388-8_fc12:F-11:ruby-1.8.6.388-8.fc12.src.rpm:1264601759