[DRE-commits] [SCM] ruby-locale.git branch, master, updated. upstream/2.0.5-10-g24b7d59
Hleb Valoshka
375GNU at Gmail.COM
Thu Apr 26 18:35:35 UTC 2012
The following commit has been merged in the master branch:
commit 899d7207e394c0a4f751f1e57f68d9718e863726
Author: Hleb Valoshka <375GNU at Gmail.COM>
Date: Thu Apr 26 21:25:40 2012 +0300
update patches
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
new file mode 100644
index 0000000..2faab52
--- /dev/null
+++ b/debian/patches/0001-fix-failure-caused-by-empty-env-variable-language.patch
@@ -0,0 +1,63 @@
+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
new file mode 100644
index 0000000..6b8e551
--- /dev/null
+++ b/debian/patches/0002-fix-better-check-of-current-locale-setter-input.patch
@@ -0,0 +1,23 @@
+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
new file mode 100644
index 0000000..7bf7061
--- /dev/null
+++ b/debian/patches/0003-fix-untainted-path-under-safe-1.patch
@@ -0,0 +1,21 @@
+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/fix-untainted-path-under-safe-1 b/debian/patches/fix-untainted-path-under-safe-1
deleted file mode 100644
index 0a362dd..0000000
--- a/debian/patches/fix-untainted-path-under-safe-1
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/lib/locale.rb
-+++ b/lib/locale.rb
-@@ -29,7 +29,7 @@
-
- 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/series b/debian/patches/series
index 689145b..c3b11c1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,3 @@
-fix-untainted-path-under-safe-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
--
ruby-locale.git
More information about the Pkg-ruby-extras-commits
mailing list