diff --git a/ruby-2.1.0-resolv.rb-no-encodings.patch b/ruby-2.1.0-resolv.rb-no-encodings.patch new file mode 100644 index 0000000..f1037db --- /dev/null +++ b/ruby-2.1.0-resolv.rb-no-encodings.patch @@ -0,0 +1,143 @@ +From 1ffbe07e179a2e047d24c7091f6ff013195b1a93 Mon Sep 17 00:00:00 2001 +From: nobu +Date: Sat, 21 Dec 2013 03:37:26 +0000 +Subject: [PATCH] resolv.rb: no encodings + +* lib/resolv.rb (Resolv::Hosts#lazy_initialize): should not + consider encodings in hosts file. [ruby-core:59239] [Bug #9273] +* lib/resolv.rb (Resolv::Config.parse_resolv_conf): ditto. + +git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e +--- + ChangeLog | 7 +++++++ + lib/resolv.rb | 4 ++-- + test/resolv/test_addr.rb | 12 ++++++++++++ + test/resolv/test_dns.rb | 13 +++++++++++++ + 4 files changed, 34 insertions(+), 2 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 72eaa6f..93686e9 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,6 +1,13 @@ + install win32.h. + [ruby-core:58801][Bug #9199] reported by arton. + ++Sat Dec 21 12:37:19 2013 Nobuyoshi Nakada ++ ++ * lib/resolv.rb (Resolv::Hosts#lazy_initialize): should not ++ consider encodings in hosts file. [ruby-core:59239] [Bug #9273] ++ ++ * lib/resolv.rb (Resolv::Config.parse_resolv_conf): ditto. ++ + Fri Dec 20 17:52:50 2013 Koichi Sasada + + * vm_method.c: check definition of +diff --git a/lib/resolv.rb b/lib/resolv.rb +index 6d34a67..0c2b68e 100644 +--- a/lib/resolv.rb ++++ b/lib/resolv.rb +@@ -187,7 +187,7 @@ class Resolv + unless @initialized + @name2addr = {} + @addr2name = {} +- open(@filename) {|f| ++ open(@filename, 'rb') {|f| + f.each {|line| + line.sub!(/#.*/, '') + addr, hostname, *aliases = line.split(/\s+/) +@@ -920,7 +920,7 @@ class Resolv + nameserver = [] + search = nil + ndots = 1 +- open(filename) {|f| ++ open(filename, 'rb') {|f| + f.each {|line| + line.sub!(/[#;].*/, '') + keyword, *args = line.split(/\s+/) +diff --git a/test/resolv/test_addr.rb b/test/resolv/test_addr.rb +index 84bc8c2..d4728e1 100644 +--- a/test/resolv/test_addr.rb ++++ b/test/resolv/test_addr.rb +@@ -13,4 +13,16 @@ class TestResolvAddr < Test::Unit::TestCase + end + } + end ++ ++ def test_invalid_byte_comment ++ bug9273 = '[ruby-core:59239] [Bug #9273]' ++ Tempfile.open('resolv_test_addr_') do |tmpfile| ++ tmpfile.print("\xff\x00\x40") ++ tmpfile.close ++ hosts = Resolv::Hosts.new(tmpfile.path) ++ assert_nothing_raised(ArgumentError, bug9273) do ++ hosts.each_address("") {break} ++ end ++ end ++ end + end +diff --git a/test/resolv/test_dns.rb b/test/resolv/test_dns.rb +index 0d9565e..e3e38ef 100644 +--- a/test/resolv/test_dns.rb ++++ b/test/resolv/test_dns.rb +@@ -1,6 +1,7 @@ + require 'test/unit' + require 'resolv' + require 'socket' ++require 'tempfile' + + class TestResolvDNS < Test::Unit::TestCase + def setup +@@ -150,4 +151,16 @@ class TestResolvDNS < Test::Unit::TestCase + } + end + ++ def test_invalid_byte_comment ++ bug9273 = '[ruby-core:59239] [Bug #9273]' ++ Tempfile.open('resolv_test_dns_') do |tmpfile| ++ tmpfile.print("\xff\x00\x40") ++ tmpfile.close ++ Resolv::DNS.open(tmpfile.path) do |dns| ++ assert_nothing_raised(ArgumentError, bug9273) do ++ dns.getresources("foo.example.org", Resolv::DNS::Resource::IN::A) ++ end ++ end ++ end ++ end + end +-- +1.8.4.2 + +From 1ef0a76c6c6556bf6ab155e2ad28a23748ee59ef Mon Sep 17 00:00:00 2001 +From: nobu +Date: Sat, 21 Dec 2013 07:18:18 +0000 +Subject: [PATCH] test_dns.rb: no server access + +* test/resolv/test_dns.rb (test_invalid_byte_comment): get rid of + actual server access. [Bug #9273] + +git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e +--- + test/resolv/test_dns.rb | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/test/resolv/test_dns.rb b/test/resolv/test_dns.rb +index e3e38ef..07396fb 100644 +--- a/test/resolv/test_dns.rb ++++ b/test/resolv/test_dns.rb +@@ -156,10 +156,8 @@ class TestResolvDNS < Test::Unit::TestCase + Tempfile.open('resolv_test_dns_') do |tmpfile| + tmpfile.print("\xff\x00\x40") + tmpfile.close +- Resolv::DNS.open(tmpfile.path) do |dns| +- assert_nothing_raised(ArgumentError, bug9273) do +- dns.getresources("foo.example.org", Resolv::DNS::Resource::IN::A) +- end ++ assert_nothing_raised(ArgumentError, bug9273) do ++ Resolv::DNS::Config.parse_resolv_conf(tmpfile.path) + end + end + end +-- +1.8.4.2 + diff --git a/ruby.spec b/ruby.spec index 3d7e87a..e1f3c9f 100644 --- a/ruby.spec +++ b/ruby.spec @@ -13,7 +13,7 @@ #%%global milestone preview2 # Keep the revision enabled for pre-releases from SVN. -%global revision 44289 +%global revision 44362 %global ruby_archive %{name}-%{ruby_version} @@ -29,7 +29,7 @@ %global release 16 %{!?release_string:%global release_string %{?development_release:0.}%{release}%{?development_release:.%{development_release}}%{?dist}} -%global rubygems_version 2.2.0.rc.1 +%global rubygems_version 2.2.0 # The RubyGems library has to stay out of Ruby directory three, since the # RubyGems should be share by all Ruby implementations. @@ -45,7 +45,7 @@ %global minitest_version 4.7.5 %global psych_version 2.0.2 %global rake_version 10.1.0 -%global rdoc_version 4.1.0.rc.1 +%global rdoc_version 4.1.0 # Might not be needed in the future, if we are lucky enough. # https://bugzilla.redhat.com/show_bug.cgi?id=888262 @@ -134,6 +134,10 @@ Patch12: ruby-1.9.3-mkmf-verbose.patch # in support for ABRT. # http://bugs.ruby-lang.org/issues/8566 Patch17: ruby-2.1.0-Allow-to-specify-additional-preludes-by-configuratio.patch +# Fixes possible "ArgumentError: invalid byte sequence in US-ASCII" error in +# TestGemRemoteFetcher#test_download_to_cache. +# http://bugs.ruby-lang.org/issues/9273 +Patch18: ruby-2.1.0-resolv.rb-no-encodings.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: ruby(rubygems) >= %{rubygems_version} @@ -399,6 +403,7 @@ Tcl/Tk interface for the object-oriented scripting language Ruby. %patch8 -p1 %patch12 -p1 %patch17 -p1 +%patch18 -p1 # Provide an example of usage of the tapset: cp -a %{SOURCE3} . @@ -913,8 +918,8 @@ OPENSSL_ENABLE_MD5_VERIFY=1 make check TESTS="-v $DISABLE_TESTS" %{ruby_libdir}/tkextlib %changelog -* Tue Dec 17 2013 Vít Ondruch - 2.1.0.0-0.16.r44289 -- Upgrade to Ruby 2.1.0 (r44289). +* Mon Dec 23 2013 Vít Ondruch - 2.1.0.0-0.16.r44362 +- Upgrade to Ruby 2.1.0 (r44362). * Mon Dec 02 2013 Vít Ondruch - 2.1.0.0-0.16.preview1 - Allow MD5 in OpenSSL for tests.