[DRE-commits] [ruby-gettext] 02/03: Refresh patches

Cédric Boutillier boutil at moszumanska.debian.org
Sat Jan 18 07:36:44 UTC 2014


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

boutil pushed a commit to annotated tag debian/3.0.3-2
in repository ruby-gettext.

commit a1e67f9aca91a639ba78a39d9f4263e66964617e
Author: Cédric Boutillier <boutil at debian.org>
Date:   Thu Jan 16 17:38:23 2014 +0100

    Refresh patches
---
 debian/changelog                                   |  1 +
 ...ndle-a-closed-stdin-when-prompting-in-msg.patch |  4 +-
 .../0005-Restore-compatibility-with-Ruby-1.8.patch | 91 ++++++++--------------
 3 files changed, 35 insertions(+), 61 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index a78b8e5..5c68e5c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@ ruby-gettext (3.0.3-2) UNRELEASED; urgency=medium
   * Team upload.
   * Stop build-depending in rubygems, since rubygems in now included in
     the supported versions of the Ruby interpreter
+  * Refresh patches
 
  -- Cédric Boutillier <boutil at debian.org>  Thu, 16 Jan 2014 17:24:57 +0100
 
diff --git a/debian/patches/0001-Properly-handle-a-closed-stdin-when-prompting-in-msg.patch b/debian/patches/0001-Properly-handle-a-closed-stdin-when-prompting-in-msg.patch
index dfd030c..ced94ee 100644
--- a/debian/patches/0001-Properly-handle-a-closed-stdin-when-prompting-in-msg.patch
+++ b/debian/patches/0001-Properly-handle-a-closed-stdin-when-prompting-in-msg.patch
@@ -6,11 +6,9 @@ Subject: Properly handle a closed stdin when prompting in msginit
  lib/gettext/tools/msginit.rb |    2 ++
  1 file changed, 2 insertions(+)
 
-diff --git a/lib/gettext/tools/msginit.rb b/lib/gettext/tools/msginit.rb
-index 49247fd..69b2551 100644
 --- a/lib/gettext/tools/msginit.rb
 +++ b/lib/gettext/tools/msginit.rb
-@@ -216,6 +216,8 @@ module GetText
+@@ -234,6 +234,8 @@
        end
  
        def prompt(message, default)
diff --git a/debian/patches/0005-Restore-compatibility-with-Ruby-1.8.patch b/debian/patches/0005-Restore-compatibility-with-Ruby-1.8.patch
index 6dec7aa..306a7bb 100644
--- a/debian/patches/0005-Restore-compatibility-with-Ruby-1.8.patch
+++ b/debian/patches/0005-Restore-compatibility-with-Ruby-1.8.patch
@@ -19,9 +19,6 @@ Subject: Restore compatibility with Ruby 1.8
  create mode 100644 lib/gettext/core_ext/iconv.rb
  create mode 100644 lib/gettext/core_ext/string.rb
 
-diff --git a/lib/gettext/core_ext/iconv.rb b/lib/gettext/core_ext/iconv.rb
-new file mode 100644
-index 0000000..389a2c7
 --- /dev/null
 +++ b/lib/gettext/core_ext/iconv.rb
 @@ -0,0 +1,110 @@
@@ -135,9 +132,6 @@ index 0000000..389a2c7
 +    puts $!.class
 +  end
 +end
-diff --git a/lib/gettext/core_ext/string.rb b/lib/gettext/core_ext/string.rb
-new file mode 100644
-index 0000000..900bea0
 --- /dev/null
 +++ b/lib/gettext/core_ext/string.rb
 @@ -0,0 +1,91 @@
@@ -232,8 +226,6 @@ index 0000000..900bea0
 +  end
 +end
 +
-diff --git a/lib/gettext/locale_path.rb b/lib/gettext/locale_path.rb
-index a0445c3..0b89581 100644
 --- a/lib/gettext/locale_path.rb
 +++ b/lib/gettext/locale_path.rb
 @@ -11,6 +11,7 @@
@@ -244,11 +236,9 @@ index a0445c3..0b89581 100644
  
  module GetText
    # Treats locale-path for mo-files.
-diff --git a/lib/gettext/mo.rb b/lib/gettext/mo.rb
-index 56549dd..5cd7953 100644
 --- a/lib/gettext/mo.rb
 +++ b/lib/gettext/mo.rb
-@@ -43,8 +43,12 @@ module GetText
+@@ -43,8 +43,12 @@
        :trans_sysdep_tab_offset
      end
  
@@ -263,7 +253,7 @@ index 56549dd..5cd7953 100644
  
      def self.open(arg = nil, output_charset = nil)
        result = self.new(output_charset)
-@@ -308,24 +312,40 @@ module GetText
+@@ -308,24 +312,40 @@
      attr_reader :charset, :nplurals, :plural
  
      private
@@ -272,24 +262,15 @@ index 56549dd..5cd7953 100644
 +    if "".respond_to?(:encode)
 +      def convert_encoding(string, original_string)
 +        return string if @output_charset.nil? or @charset.nil?
- 
--      if Encoding.find(@output_charset) == Encoding.find(@charset)
--        string.force_encoding(@output_charset)
--        return string
--      end
++
 +        if Encoding.find(@output_charset) == Encoding.find(@charset)
 +          string.force_encoding(@output_charset)
 +          return string
 +        end
  
--      begin
--        string.encode(@output_charset, @charset)
--      rescue EncodingError
--        if $DEBUG
--          warn "@charset = ", @charset
--          warn "@output_charset = ", @output_charset
--          warn "msgid = ", original_string
--          warn "msgstr = ", string
+-      if Encoding.find(@output_charset) == Encoding.find(@charset)
+-        string.force_encoding(@output_charset)
+-        return string
 +        begin
 +          string.encode(@output_charset, @charset)
 +        rescue EncodingError
@@ -301,7 +282,16 @@ index 56549dd..5cd7953 100644
 +          end
 +          string
 +        end
-+      end
+       end
+-
+-      begin
+-        string.encode(@output_charset, @charset)
+-      rescue EncodingError
+-        if $DEBUG
+-          warn "@charset = ", @charset
+-          warn "@output_charset = ", @output_charset
+-          warn "msgid = ", original_string
+-          warn "msgstr = ", string
 +    else
 +      require 'gettext/core_ext/iconv'
 +      def convert_encoding(string, original_string)
@@ -319,11 +309,9 @@ index 56549dd..5cd7953 100644
        end
      end
  
-diff --git a/lib/gettext/tools/parser/erb.rb b/lib/gettext/tools/parser/erb.rb
-index dc2ad1c..dee952f 100644
 --- a/lib/gettext/tools/parser/erb.rb
 +++ b/lib/gettext/tools/parser/erb.rb
-@@ -64,13 +64,15 @@ module GetText
+@@ -64,13 +64,15 @@
        content = IO.read(@path)
        src = ERB.new(content).src
  
@@ -331,26 +319,23 @@ index dc2ad1c..dee952f 100644
 -      # or original content.
 -      encoding = detect_encoding(src) || content.encoding
 -      src.force_encoding(encoding)
--
--      # Remove magic comment prepended by erb in Ruby 1.9.
--      src = src.gsub(MAGIC_COMMENT, "")
 +      if src.respond_to?(:encode)
 +        # Force the src encoding back to the encoding in magic comment
 +        # or original content.
 +        encoding = detect_encoding(src) || content.encoding
 +        src.force_encoding(encoding)
-+
+ 
+-      # Remove magic comment prepended by erb in Ruby 1.9.
+-      src = src.gsub(MAGIC_COMMENT, "")
 +        # Remove magic comment prepended by erb in Ruby 1.9.
 +        src = src.gsub(MAGIC_COMMENT, "")
 +      end
  
        RubyParser.new(@path, @options).parse_source(src)
      end
-diff --git a/lib/gettext/tools/parser/ruby.rb b/lib/gettext/tools/parser/ruby.rb
-index 2886b77..671d2c1 100644
 --- a/lib/gettext/tools/parser/ruby.rb
 +++ b/lib/gettext/tools/parser/ruby.rb
-@@ -211,13 +211,16 @@ module GetText
+@@ -211,13 +211,16 @@
      def parse
        source = IO.read(@path)
  
@@ -369,11 +354,9 @@ index 2886b77..671d2c1 100644
        binary_source = source.dup.force_encoding("ASCII-8BIT")
        if /\A.*coding\s*[=:]\s*([[:alnum:]\-_]+)/ =~ binary_source
          $1.gsub(/-(?:unix|mac|dos)\z/, "")
-diff --git a/test/gettext-test-utils.rb b/test/gettext-test-utils.rb
-index 4dfab44..d973c06 100644
 --- a/test/gettext-test-utils.rb
 +++ b/test/gettext-test-utils.rb
-@@ -22,6 +22,10 @@ require "tmpdir"
+@@ -22,6 +22,10 @@
  require "tempfile"
  require "time"
  
@@ -384,7 +367,7 @@ index 4dfab44..d973c06 100644
  require "gettext"
  
  module GetTextTestUtils
-@@ -41,4 +45,23 @@ module GetTextTestUtils
+@@ -41,4 +45,23 @@
    def teardown_tmpdir
      FileUtils.rm_rf(@tmpdir, :secure => true) if @tmpdir
    end
@@ -408,11 +391,9 @@ index 4dfab44..d973c06 100644
 +    end
 +  end
  end
-diff --git a/test/test_parser.rb b/test/test_parser.rb
-index 9bbc80c..68cb9aa 100644
 --- a/test/test_parser.rb
 +++ b/test/test_parser.rb
-@@ -133,6 +133,8 @@ class TestGetTextParser < Test::Unit::TestCase
+@@ -133,6 +133,8 @@
      include GetTextTestUtils
  
      def test_detect_encoding
@@ -421,11 +402,9 @@ index 9bbc80c..68cb9aa 100644
        euc_file = Tempfile.new("euc-jp.rhtml")
        euc_file.open
        euc_file.puts("<%#-*- coding: euc-jp -*-%>")
-diff --git a/test/test_po_parser.rb b/test/test_po_parser.rb
-index 88329dd..ea73992 100644
 --- a/test/test_po_parser.rb
 +++ b/test/test_po_parser.rb
-@@ -306,6 +306,8 @@ EOP
+@@ -306,6 +306,8 @@
      end
    end
  
@@ -434,18 +413,16 @@ index 88329dd..ea73992 100644
    class TestHeader < self
      class TestEncoding < self
        def test_known
-@@ -337,4 +339,6 @@ msgstr ""
+@@ -337,4 +339,6 @@
        end
      end
    end
 +
 +  end
  end
-diff --git a/test/tools/parser/test_ruby.rb b/test/tools/parser/test_ruby.rb
-index 1d037f1..7459838 100644
 --- a/test/tools/parser/test_ruby.rb
 +++ b/test/tools/parser/test_ruby.rb
-@@ -68,6 +68,8 @@ class TestRubyParser < Test::Unit::TestCase
+@@ -68,6 +68,8 @@
    end
  
    class TestDetectEncoding < self
@@ -454,11 +431,9 @@ index 1d037f1..7459838 100644
      def test_ascii_and_hyphen
        assert_equal("euc-jp", detect_encoding("# coding: euc-jp"))
      end
-diff --git a/test/tools/test_xgettext.rb b/test/tools/test_xgettext.rb
-index 9837959..8d5e5ff 100644
 --- a/test/tools/test_xgettext.rb
 +++ b/test/tools/test_xgettext.rb
-@@ -119,6 +119,8 @@ EOP
+@@ -120,6 +120,8 @@
  
    class TestEncoding < self
      def test_different_encoding_from_current_locale
@@ -467,7 +442,7 @@ index 9837959..8d5e5ff 100644
        rhtml = <<-EOR
  <%#-*- coding: sjis -*-%>
  <html>
-@@ -131,34 +133,36 @@ EOP
+@@ -132,34 +134,36 @@
  </html>
  EOR
        File.open(@rhtml_file_path, "w") do |rhtml_file|
@@ -509,7 +484,7 @@ index 9837959..8d5e5ff 100644
  <%# -*- coding: cp932 -*-%>
  <h1><%= _("わたし") %></h1>
  EOR
-@@ -168,7 +172,7 @@ EOR
+@@ -169,7 +173,7 @@
  
        encoding = "UTF-8"
        pot_content = File.read(@pot_file_path)
@@ -518,7 +493,7 @@ index 9837959..8d5e5ff 100644
        expected_content = <<-EOP
  #{header}
  #: ../lib/xgettext.rb:2
-@@ -179,7 +183,7 @@ msgstr ""
+@@ -180,7 +184,7 @@
  msgid "わたし"
  msgstr ""
  EOP
@@ -527,7 +502,7 @@ index 9837959..8d5e5ff 100644
        assert_equal(expected_content, pot_content)
      end
    end
-@@ -346,13 +350,15 @@ msgstr ""
+@@ -351,13 +355,15 @@
      end
  
      def test_to_code
@@ -544,7 +519,7 @@ index 9837959..8d5e5ff 100644
  
        options = {:to_code => output_encoding}
        expected_pot = <<-EOP
-@@ -361,7 +367,7 @@ EOR
+@@ -366,7 +372,7 @@
  msgid "わたし"
  msgstr ""
  EOP

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



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