[DRE-commits] [SCM] ruby-locale.git branch, master, updated. debian/2.0.5-5-19-g762161f

Hleb Valoshka 375GNU at Gmail.COM
Sun Mar 31 15:55:16 UTC 2013


The following commit has been merged in the master branch:
commit 93540196177c5ffc5ee6d3d6c056dbe1dab2337b
Author: Hleb Valoshka <375GNU at Gmail.COM>
Date:   Sun Mar 31 17:50:36 2013 +0300

    refresh patches

diff --git a/debian/patches/0001-fix-bugs-with-charset-handling.patch b/debian/patches/0001-fix-bugs-with-charset-handling.patch
new file mode 100644
index 0000000..3a906bd
--- /dev/null
+++ b/debian/patches/0001-fix-bugs-with-charset-handling.patch
@@ -0,0 +1,75 @@
+From: Hleb Valoshka <375GNU at Gmail.COM>
+Date: Sun, 31 Mar 2013 17:59:39 +0300
+Subject: fix bugs with charset handling
+
+   Fixes #520181
+---
+ lib/locale/tag/posix.rb | 23 ++++++++++++++++-------
+ lib/locale/taglist.rb   |  6 +-----
+ 2 files changed, 17 insertions(+), 12 deletions(-)
+
+diff --git a/lib/locale/tag/posix.rb b/lib/locale/tag/posix.rb
+index b04aa54..1ce944a 100644
+--- a/lib/locale/tag/posix.rb
++++ b/lib/locale/tag/posix.rb
+@@ -30,9 +30,9 @@ module Locale
+       end
+ 
+       def self.parse(tag)
+-        if tag =~ /^(C|POSIX)$/
+-          ret = self.new("en", "US")
+-          ret.tag = tag
++        if tag =~ /\A(C|POSIX)(?:\.([^@]+))?\Z/
++          ret = self.new("en", "US", $2)
++          ret.tag = $1
+           ret
+         elsif tag =~ TAG_RE
+           ret = self.new($1, $2, $3, $4)
+@@ -47,10 +47,15 @@ module Locale
+       #   <language>_<COUNTRY>.<CHARSET>@<MODIFIER>
+       #   (e.g.) "ja_JP.EUC-JP at Modifier"
+       def to_s
+-        s = @language.dup
+-        s << "_#{@region}" if @region
+-        s << ".#{@charset}" if @charset
+-        s << "@#{@modifier}" if @modifier
++        if posix?
++          s = tag.dup
++          s << ".#{@charset}" if @charset
++        else
++          s = @language.dup
++          s << "_#{@region}" if @region
++          s << ".#{@charset}" if @charset
++          s << "@#{@modifier}" if @modifier
++        end
+         s
+       end
+ 
+@@ -92,6 +97,10 @@ module Locale
+         end
+       end
+ 
++      def posix?
++        ['POSIX', 'C'].include? tag
++      end
++
+     end
+   end
+ end
+diff --git a/lib/locale/taglist.rb b/lib/locale/taglist.rb
+index e5d879c..2b6c8e7 100644
+--- a/lib/locale/taglist.rb
++++ b/lib/locale/taglist.rb
+@@ -46,11 +46,7 @@ module Locale
+     end
+     # Returns the top priority charset. (posix)
+     def charset
+-      if self[0].respond_to? :charset
+-        self[0].charset
+-      else
+-        ::Locale.driver_module.charset
+-      end
++      self[0].respond_to?(:charset) and self[0].charset or ::Locale.driver_module.charset
+     end
+     memoize :charset
+ 
diff --git a/debian/patches/0001-fix-failure-caused-by-empty-env-variable-language.patch b/debian/patches/0001-fix-failure-caused-by-empty-env-variable-language.patch
deleted file mode 100644
index 2faab52..0000000
--- a/debian/patches/0001-fix-failure-caused-by-empty-env-variable-language.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From: Hleb Valoshka <375GNU at Gmail.COM>
-Date: Thu, 26 Apr 2012 20:48:11 +0300
-Subject: fix failure caused by empty env variable language
-
-Fixes #670320.
-
-This basically is a difference between plain gem and debian package
-2.0.5-2, but I've also have added check for non empty ENV["LANGUAGE"].
----
- lib/locale.rb               |    8 +++++---
- lib/locale/driver/env.rb    |    2 +-
- lib/locale/info/language.rb |    6 +++++-
- 3 files changed, 11 insertions(+), 5 deletions(-)
-
-diff --git a/lib/locale.rb b/lib/locale.rb
-index f56de37..95b965a 100644
---- a/lib/locale.rb
-+++ b/lib/locale.rb
-@@ -236,9 +236,11 @@ module Locale
-     end
- 
-     tags = []
--    (0...candidate_tags[0].size).each {|i|
--      tags += candidate_tags.collect{|v| v[i]}
--    }
-+    unless candidate_tags.empty?
-+      (0...candidate_tags[0].size).each {|i|
-+        tags += candidate_tags.collect{|v| v[i]}
-+      }
-+    end
-     tags += default_tags
-     tags.uniq!
- 
-diff --git a/lib/locale/driver/env.rb b/lib/locale/driver/env.rb
-index 9d0995f..3d08500 100644
---- a/lib/locale/driver/env.rb
-+++ b/lib/locale/driver/env.rb
-@@ -39,7 +39,7 @@ module Locale
-       # Gets the locales from environment variables. (LANGUAGE > LC_ALL > LC_MESSAGES > LANG)
-       # * Returns: an Array of the locale as Locale::Tag::Posix or nil.
-       def locales
--        if (locales = ENV["LANGUAGE"])
-+        if (locales = ENV["LANGUAGE"] and locales.size > 0)
-           Locale::TagList.new(locales.split(/:/).collect{|v| Locale::Tag::Posix.parse(v)})
-         elsif (loc = locale)
-           Locale::TagList.new([loc])
-diff --git a/lib/locale/info/language.rb b/lib/locale/info/language.rb
-index b147523..45d25ce 100644
---- a/lib/locale/info/language.rb
-+++ b/lib/locale/info/language.rb
-@@ -74,7 +74,11 @@ module Locale
- 
-       # Returns the two or three code.
-       def to_s
--        two_code || tree_code
-+        if two_code and two_code.size > 0
-+          two_code
-+        else
-+          three_code
-+        end
-       end
- 
-       # Returns this object is valid as ISO 639 data.
diff --git a/debian/patches/0002-fix-better-check-of-current-locale-setter-input.patch b/debian/patches/0002-fix-better-check-of-current-locale-setter-input.patch
deleted file mode 100644
index 6b8e551..0000000
--- a/debian/patches/0002-fix-better-check-of-current-locale-setter-input.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From: Hleb Valoshka <375GNU at Gmail.COM>
-Date: Thu, 26 Apr 2012 21:20:25 +0300
-Subject: fix better check of current locale setter input
-
-Fixes #600713
-Allows Locale.current= accept a value of Locale::TagList (output of Locale.current)
----
- lib/locale.rb |    2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/lib/locale.rb b/lib/locale.rb
-index 95b965a..719cc68 100644
---- a/lib/locale.rb
-+++ b/lib/locale.rb
-@@ -36,6 +36,8 @@ module Locale
-     if tag
-       if tag.kind_of? Locale::Tag::Simple
-         tag
-+      elsif tag.kind_of? Locale::TagList
-+        tag[0]
-       else
-         Locale::Tag.parse(tag)
-       end
diff --git a/debian/patches/0003-fix-untainted-path-under-safe-1.patch b/debian/patches/0003-fix-untainted-path-under-safe-1.patch
deleted file mode 100644
index 7bf7061..0000000
--- a/debian/patches/0003-fix-untainted-path-under-safe-1.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-From: Hleb Valoshka <375GNU at Gmail.COM>
-Date: Thu, 26 Apr 2012 21:24:55 +0300
-Subject: fix untainted path under safe=1
-
----
- lib/locale.rb |    2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/locale.rb b/lib/locale.rb
-index 719cc68..10bc71e 100644
---- a/lib/locale.rb
-+++ b/lib/locale.rb
-@@ -29,7 +29,7 @@ module Locale
- 
-   module_function
-   def require_driver(name)  #:nodoc:
--    require File.join(ROOT, "locale/driver", name.to_s)
-+    require File.join(ROOT, "locale/driver", name.to_s).untaint
-   end
- 
-   def create_language_tag(tag)  #:nodoc:
diff --git a/debian/patches/0004-fix-bugs-with-charset-handling.patch b/debian/patches/0004-fix-bugs-with-charset-handling.patch
deleted file mode 100644
index 1ea0e63..0000000
--- a/debian/patches/0004-fix-bugs-with-charset-handling.patch
+++ /dev/null
@@ -1,143 +0,0 @@
-From: Hleb Valoshka <375GNU at Gmail.COM>
-Date: Wed, 22 Aug 2012 11:36:29 +0300
-Subject: fix bugs with charset handling
-
-   Fixes #520181
----
- lib/locale/driver/env.rb    |    4 ++--
- lib/locale/tag/posix.rb     |   23 ++++++++++++++++-------
- lib/locale/taglist.rb       |    6 +-----
- test/test_detect_general.rb |   10 +++++-----
- 4 files changed, 24 insertions(+), 19 deletions(-)
-
-diff --git a/lib/locale/driver/env.rb b/lib/locale/driver/env.rb
-index 3d08500..78df8c5 100644
---- a/lib/locale/driver/env.rb
-+++ b/lib/locale/driver/env.rb
-@@ -24,11 +24,11 @@ module Locale
-     module Env
-       module_function
- 
--      # Gets the locale from environment variable. (LC_ALL > LC_MESSAGES > LANG)
-+      # Gets the locale from environment variable. (LC_ALL > LC_CTYPE > LANG)
-       # Returns: the locale as Locale::Tag::Posix.
-       def locale
-         # At least one environment valiables should be set on *nix system.
--        [ENV["LC_ALL"], ENV["LC_MESSAGES"], ENV["LANG"]].each do |loc|
-+        [ENV["LC_ALL"], ENV["LC_CTYPE"], ENV["LANG"]].each do |loc|
-           if loc != nil and loc.size > 0
-             return Locale::Tag::Posix.parse(loc)
-           end
-diff --git a/lib/locale/tag/posix.rb b/lib/locale/tag/posix.rb
-index b04aa54..1ce944a 100644
---- a/lib/locale/tag/posix.rb
-+++ b/lib/locale/tag/posix.rb
-@@ -30,9 +30,9 @@ module Locale
-       end
- 
-       def self.parse(tag)
--        if tag =~ /^(C|POSIX)$/
--          ret = self.new("en", "US")
--          ret.tag = tag
-+        if tag =~ /\A(C|POSIX)(?:\.([^@]+))?\Z/
-+          ret = self.new("en", "US", $2)
-+          ret.tag = $1
-           ret
-         elsif tag =~ TAG_RE
-           ret = self.new($1, $2, $3, $4)
-@@ -47,10 +47,15 @@ module Locale
-       #   <language>_<COUNTRY>.<CHARSET>@<MODIFIER>
-       #   (e.g.) "ja_JP.EUC-JP at Modifier"
-       def to_s
--        s = @language.dup
--        s << "_#{@region}" if @region
--        s << ".#{@charset}" if @charset
--        s << "@#{@modifier}" if @modifier
-+        if posix?
-+          s = tag.dup
-+          s << ".#{@charset}" if @charset
-+        else
-+          s = @language.dup
-+          s << "_#{@region}" if @region
-+          s << ".#{@charset}" if @charset
-+          s << "@#{@modifier}" if @modifier
-+        end
-         s
-       end
- 
-@@ -92,6 +97,10 @@ module Locale
-         end
-       end
- 
-+      def posix?
-+        ['POSIX', 'C'].include? tag
-+      end
-+
-     end
-   end
- end
-diff --git a/lib/locale/taglist.rb b/lib/locale/taglist.rb
-index e5d879c..2b6c8e7 100644
---- a/lib/locale/taglist.rb
-+++ b/lib/locale/taglist.rb
-@@ -46,11 +46,7 @@ module Locale
-     end
-     # Returns the top priority charset. (posix)
-     def charset
--      if self[0].respond_to? :charset
--        self[0].charset
--      else
--        ::Locale.driver_module.charset
--      end
-+      self[0].respond_to?(:charset) and self[0].charset or ::Locale.driver_module.charset
-     end
-     memoize :charset
- 
-diff --git a/test/test_detect_general.rb b/test/test_detect_general.rb
-index 08b912d..ab71857 100644
---- a/test/test_detect_general.rb
-+++ b/test/test_detect_general.rb
-@@ -6,14 +6,14 @@ class TestDetectGeneral < Test::Unit::TestCase
-   def setup
-     Locale.clear_all
-     ENV["LC_ALL"] = nil
--    ENV["LC_MESSAGES"] = nil
-+    ENV["LC_CTYPE"] = nil
-     ENV["LANG"] = nil
-     ENV["LANGUAGE"] = nil
-   end
- 
-   def test_lc_all
-     ENV["LC_ALL"] = "ja_JP.eucJP"
--    ENV["LC_MESSAGES"] = "zh_CN.UTF-8"  #Ignored.
-+    ENV["LC_CTYPE"] = "zh_CN.UTF-8"  #Ignored.
-     ENV["LANG"] = "ko_KR.UTF-8"  #Ignored.
-     ENV["LANGUAGE"] = nil
- 
-@@ -29,7 +29,7 @@ class TestDetectGeneral < Test::Unit::TestCase
- 
-   def test_lc_messages
-     ENV["LC_ALL"] = nil
--    ENV["LC_MESSAGES"] = "ja_JP.eucJP"
-+    ENV["LC_CTYPE"] = "ja_JP.eucJP"
-     ENV["LANG"] = "ko_KR.UTF-8"  #Ignored.
-     ENV["LANGUAGE"] = nil
- 
-@@ -45,7 +45,7 @@ class TestDetectGeneral < Test::Unit::TestCase
- 
-   def test_lang
-     ENV["LC_ALL"] = nil
--    ENV["LC_MESSAGES"] = nil
-+    ENV["LC_CTYPE"] = nil
-     ENV["LANG"] = "ja_JP.eucJP"
-     ENV["LANGUAGE"] = nil
- 
-@@ -61,7 +61,7 @@ class TestDetectGeneral < Test::Unit::TestCase
- 
-   def test_lang_complex
-     ENV["LC_ALL"] = "zh_CN.UTF-8"  # Ignored.
--    ENV["LC_MESSAGES"] = "ko_KR.UTF-8" #Ingored.
-+    ENV["LC_CTYPE"] = "ko_KR.UTF-8" #Ingored.
-     ENV["LANG"] = "en_US.UTF-8"  # Ignored.
-     ENV["LANGUAGE"] ="ja_JP.eucJP:zh_CN.UTF-8"
- 
diff --git a/debian/patches/0005-fix-call-to-java.util.Locale.new.patch b/debian/patches/0005-fix-call-to-java.util.Locale.new.patch
deleted file mode 100644
index cdb71d4..0000000
--- a/debian/patches/0005-fix-call-to-java.util.Locale.new.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From: Hleb Valoshka <375GNU at Gmail.COM>
-Date: Wed, 22 Aug 2012 11:37:03 +0300
-Subject: fix call to java.util.Locale.new
-
-    see: http://docs.oracle.com/javase/7/docs/api/java/util/Locale.html#def_variant
----
- test/test_driver_jruby.rb |    2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/test/test_driver_jruby.rb b/test/test_driver_jruby.rb
-index 692d340..6fe7bbf 100644
---- a/test/test_driver_jruby.rb
-+++ b/test/test_driver_jruby.rb
-@@ -12,7 +12,7 @@ begin
-     end
- 
-     def set_locale(tag)
--      java.util.Locale.setDefault(java.util.Locale.new(tag.language, tag.region, tag.variants.to_s))
-+      java.util.Locale.setDefault(java.util.Locale.new(tag.language, tag.region, tag.variants.join('_')))
-     end
- 
-     def test_charset
diff --git a/debian/patches/series b/debian/patches/series
index ed2fbe6..69e1410 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,5 +1 @@
-0001-fix-failure-caused-by-empty-env-variable-language.patch
-0002-fix-better-check-of-current-locale-setter-input.patch
-0003-fix-untainted-path-under-safe-1.patch
-0004-fix-bugs-with-charset-handling.patch
-0005-fix-call-to-java.util.Locale.new.patch
+0001-fix-bugs-with-charset-handling.patch

-- 
ruby-locale.git



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