[DRE-commits] [ruby-rubymail] 01/01: Several fixes for Ruby 2.0

Antonio Terceiro terceiro at alioth.debian.org
Sun Oct 6 21:28:44 UTC 2013


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to branch master
in repository ruby-rubymail.

commit 752b3deb92e7df24b64f20022163a2e372cc4c6e
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Sun Oct 6 13:30:12 2013 -0300

    Several fixes for Ruby 2.0
---
 debian/changelog                                   |   13 ++++++++
 debian/control                                     |   19 +-----------
 .../0007-Create-Explicit-Binary-Regexp.patch       |   32 ++++++++++++++++++++
 debian/patches/0008-fix-testbase-for-ruby2.0.patch |   11 +++++++
 .../patches/0009-fix-testaddress-for-ruby2.0.patch |   21 +++++++++++++
 .../patches/0010-fix-testmessage-for-ruby2.0.patch |   11 +++++++
 debian/patches/series                              |    4 +++
 7 files changed, 93 insertions(+), 18 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 5a1d276..2273f70 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,16 @@
+ruby-rubymail (1.0.0-2) unstable; urgency=low
+
+  * Team upload
+  * Added patches for Ruby 2.0 compatibility (Closes: #720253):
+    - debian/patches/0007-Create-Explicit-Binary-Regexp.patch
+    - debian/patches/0008-fix-testbase-for-ruby2.0.patch
+    - debian/patches/0009-fix-testaddress-for-ruby2.0.patch
+    - debian/patches/0010-fix-testmessage-for-ruby2.0.patch
+  * Standards-Version bumped to 3.9.4; no changes needed.
+  * Drop old transition packages as they are not needed anymore
+
+ -- Antonio Terceiro <terceiro at debian.org>  Sun, 06 Oct 2013 13:30:43 -0300
+
 ruby-rubymail (1.0.0-1) unstable; urgency=low
 
   * New maintainer. Closes: #676346
diff --git a/debian/control b/debian/control
index 03870e4..d26245c 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Priority: optional
 Maintainer: Debian Ruby Extras Maintainers <pkg-ruby-extras-maintainers at lists.alioth.debian.org>
 Uploaders: Per Andersson <avtobiff at gmail.com>
 Build-Depends: debhelper (>= 7.0.50~), gem2deb (>= 0.2.16~)
-Standards-Version: 3.9.3
+Standards-Version: 3.9.4
 Vcs-Git: git://anonscm.debian.org/pkg-ruby-extras/ruby-rubymail.git
 Vcs-Browser: http://anonscm.debian.org/gitweb?p=pkg-ruby-extras/ruby-rubymail.git;a=summary
 Homepage: http://rubyforge.org/projects/rubymail/
@@ -36,20 +36,3 @@ Description: lightweight mail library for Ruby
  classes and modules that allow Ruby scripts to parse, modify, and generate
  MIME mail messages.
 
-Package: librmail-ruby-doc
-Section: oldlibs
-Priority: extra
-Architecture: all
-Depends: ${misc:Depends}, ruby-rubymail-doc
-Description: Transitional package for ruby-rubymail-doc
- This is a transitional package to ease upgrades to the ruby-rubymail-doc
- package. It can safely be removed.
-
-Package: librmail-ruby1.8
-Section: oldlibs
-Priority: extra
-Architecture: all
-Depends: ${misc:Depends}, ruby-rubymail
-Description: Transitional package for ruby-rubymail
- This is a transitional package to ease upgrades to the ruby-rubymail
- package. It can safely be removed.
diff --git a/debian/patches/0007-Create-Explicit-Binary-Regexp.patch b/debian/patches/0007-Create-Explicit-Binary-Regexp.patch
new file mode 100644
index 0000000..07b6aa8
--- /dev/null
+++ b/debian/patches/0007-Create-Explicit-Binary-Regexp.patch
@@ -0,0 +1,32 @@
+Author: Antonio Terceiro <terceiro at debian.org>
+Description: Create explicit binary regexp
+ Ruby 2.0 chokes on those regexes saying they are not valid syntax. This
+ specific solution is based on the discussion at
+ http://www.velocityreviews.com/forums/t856762-ruby-1-9-1-invalid-multibyte-escape-xc0-xdf-regexperror.html
+
+diff --git a/lib/rmail/address.rb b/lib/rmail/address.rb
+index 8227841..ae99d16 100644
+--- a/lib/rmail/address.rb
++++ b/lib/rmail/address.rb
+@@ -691,7 +691,7 @@ module RMail
+ 	    @sym = SYM_DOMAIN_LITERAL
+ 	    @lexeme = $1.gsub(/(^|[^\\])[\r\n\t ]+/, '\1').gsub(/\\(.)/, '\1')
+ 	    break
+-          when /\A[\200-\377\w!$%&\'*+\/=?^_\`{\}|~#-]+/m
++          when Regexp.new('\A[\200-\377\w!$%&\'*+\/=?^_\`{\}|~#-]+', Regexp::MULTILINE, 'n')
+             # This is just like SYM_ATOM, but includes all characters
+             # with high bits.  This is so we can allow such tokens in
+             # the display name portion of an address even though it
+diff --git a/lib/rmail/header.rb b/lib/rmail/header.rb
+index 9102f28..9d5c9b2 100644
+--- a/lib/rmail/header.rb
++++ b/lib/rmail/header.rb
+@@ -73,7 +73,7 @@ module RMail
+ 
+     class Field                 # :nodoc:
+       # fixme, document methadology for this (RFC2822)
+-      EXTRACT_FIELD_NAME_RE = /\A([^\x00-\x1f\x7f-\xff :]+):\s*/o
++      EXTRACT_FIELD_NAME_RE = Regexp.new '\A([^\x00-\x1f\x7f-\xff :]+):\s*', nil, 'n'
+ 
+       class << self
+         def parse(field)
diff --git a/debian/patches/0008-fix-testbase-for-ruby2.0.patch b/debian/patches/0008-fix-testbase-for-ruby2.0.patch
new file mode 100644
index 0000000..66e1904
--- /dev/null
+++ b/debian/patches/0008-fix-testbase-for-ruby2.0.patch
@@ -0,0 +1,11 @@
+--- a/test/testbase.rb
++++ b/test/testbase.rb
+@@ -39,7 +39,7 @@ rescue LoadError
+ end
+ 
+ class TestBase < Test::Unit::TestCase
+-  include Config
++  include RbConfig
+ 
+   attr_reader :scratch_dir
+ 
diff --git a/debian/patches/0009-fix-testaddress-for-ruby2.0.patch b/debian/patches/0009-fix-testaddress-for-ruby2.0.patch
new file mode 100644
index 0000000..0a3d594
--- /dev/null
+++ b/debian/patches/0009-fix-testaddress-for-ruby2.0.patch
@@ -0,0 +1,21 @@
+--- a/test/testaddress.rb
++++ b/test/testaddress.rb
+@@ -797,14 +797,14 @@ class TestRMailAddress < TestBase
+   def test_invalid_addresses()
+     # The display name isn't encoded -- bad, but we parse it.
+     validate_case\
+-    ["\322\315\322 \312\353\363\341 <bar at foo.invalid>",
+-      [ { :name => "\322\315\322 \312\353\363\341",
+-	  :display_name => "\322\315\322 \312\353\363\341",
++    ["\322\315\322 \312\353\363\341 <bar at foo.invalid>".force_encoding('ASCII-8BIT'),
++      [ { :name => "\322\315\322 \312\353\363\341".force_encoding("ASCII-8BIT"),
++	  :display_name => "\322\315\322 \312\353\363\341".force_encoding("ASCII-8BIT"),
+ 	  :address => 'bar at foo.invalid',
+ 	  :comments => nil,
+ 	  :domain => 'foo.invalid',
+ 	  :local => 'bar',
+-	  :format => "\"\322\315\322 \312\353\363\341\" <bar at foo.invalid>",
++	  :format => "\"\322\315\322 \312\353\363\341\" <bar at foo.invalid>".force_encoding("ASCII-8BIT"),
+ 	} ] ]
+   end
+ 
diff --git a/debian/patches/0010-fix-testmessage-for-ruby2.0.patch b/debian/patches/0010-fix-testmessage-for-ruby2.0.patch
new file mode 100644
index 0000000..5f75b3c
--- /dev/null
+++ b/debian/patches/0010-fix-testmessage-for-ruby2.0.patch
@@ -0,0 +1,11 @@
+--- a/test/testmessage.rb
++++ b/test/testmessage.rb
+@@ -141,7 +141,7 @@ Second body line
+   def test_decode
+     message = RMail::Message.new
+ 
+-    all_bytes = ''
++    all_bytes = ''.force_encoding('ASCII-8BIT')
+     0.upto(255) do |i|
+       all_bytes << i
+     end
diff --git a/debian/patches/series b/debian/patches/series
index 88b4afc..5a4f0d7 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,7 @@
 0004-Parse-messages-with-r-n-as-linefeed.patch
 0005-Patch-out-require-rubygems.patch
 0006-Test-header-params-without-order-guarantee.patch
+0007-Create-Explicit-Binary-Regexp.patch
+0008-fix-testbase-for-ruby2.0.patch
+0009-fix-testaddress-for-ruby2.0.patch
+0010-fix-testmessage-for-ruby2.0.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-rubymail.git



More information about the Pkg-ruby-extras-commits mailing list