[rubygem-gettext] Patch from upstream git to remove memoization with
Mamoru Tasaka
mtasaka at fedoraproject.org
Tue Oct 15 05:24:05 UTC 2013
commit 6984de89925fc7860725880a9fe072dae8486b55
Author: Mamoru TASAKA <mtasaka at fedoraproject.org>
Date: Tue Oct 15 14:23:56 2013 +0900
Patch from upstream git to remove memoization with
coordination with rubygem-locale side change
- Patch from upstream git to fix test failure on arm
...gem-gettext-3.0.2-dont_use_hash_for_cache.patch | 39 ++++++++++++++++++++
rubygem-gettext.spec | 6 +++-
2 files changed, 44 insertions(+), 1 deletions(-)
---
diff --git a/rubygem-gettext-3.0.2-dont_use_hash_for_cache.patch b/rubygem-gettext-3.0.2-dont_use_hash_for_cache.patch
new file mode 100644
index 0000000..c724408
--- /dev/null
+++ b/rubygem-gettext-3.0.2-dont_use_hash_for_cache.patch
@@ -0,0 +1,39 @@
+From 48bdf7d7a465ce77c2c91476f13eedc4acdd5b3a Mon Sep 17 00:00:00 2001
+From: Kouhei Sutou <kou at clear-code.com>
+Date: Mon, 14 Oct 2013 20:38:50 +0900
+Subject: [PATCH] Don't use hash value as cache key
+
+GitHub: #22
+
+Hash value may conflict on armv7hl.
+
+Reported by mtasaka. Thanks!!!
+---
+ lib/gettext/text_domain_manager.rb | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/gettext/text_domain_manager.rb b/lib/gettext/text_domain_manager.rb
+index 525668b..e329fb4 100644
+--- a/lib/gettext/text_domain_manager.rb
++++ b/lib/gettext/text_domain_manager.rb
+@@ -96,7 +96,7 @@ def each_text_domains(klass) #:nodoc:
+ # it returns a last part of msgid separeted "div".
+ def translate_singular_message(klass, msgid, div = nil)
+ klass = ClassInfo.normalize_class(klass)
+- key = [Locale.current, klass, msgid, div].hash
++ key = [Locale.current, klass, msgid, div]
+ msg = @@singular_message_cache[key]
+ return msg if msg and @@cached
+ # Find messages from related classes.
+@@ -156,7 +156,7 @@ def translate_plural_message(klass, arg1, arg2, arg3 = "|", arg4 = "|")
+ div = arg4
+ end
+
+- key = [Locale.current, klass, msgid, msgid_plural, div].hash
++ key = [Locale.current, klass, msgid, msgid_plural, div]
+ msgs = @@plural_message_cache[key]
+ unless (msgs and @@cached)
+ # Find messages from related classes.
+--
+1.8.4
+
diff --git a/rubygem-gettext.spec b/rubygem-gettext.spec
index e46e6e4..ed767d2 100644
--- a/rubygem-gettext.spec
+++ b/rubygem-gettext.spec
@@ -19,6 +19,8 @@ URL: http://www.yotabanana.com/hiki/ruby-gettext.html?ruby-gettext
Source0: http://gems.rubyforge.org/gems/%{gem_name}-%{version}.gem
# https://github.com/ruby-gettext/gettext/commit/262c52d1e57344d7c732cdc8150edcd152d11fcb.patch
Patch0: rubygem-gettext-3.0.2-remove-memoization.patch
+# https://github.com/ruby-gettext/gettext/commit/48bdf7d.patch
+Patch1: rubygem-gettext-3.0.2-dont_use_hash_for_cache.patch
%if 0%{?fedora} >= 19
Requires: ruby(release)
@@ -79,6 +81,7 @@ cd %{gem_name}-%{version}
#Patches, etc
%patch0 -p1 -b .memoization
+%patch1 -p1 -b .hash
gem specification -l --ruby %{SOURCE0} > %{gem_name}.gemspec
@@ -173,9 +176,10 @@ popd
%exclude %{gem_instdir}/src/
%changelog
-* Mon Oct 14 2013 Mamoru TASAKA <mtasaka at fedoraproject.org> - 3.0.2-5
+* Tue Oct 15 2013 Mamoru TASAKA <mtasaka at fedoraproject.org> - 3.0.2-5
- Patch from upstream git to remove memoization with
coordination with rubygem-locale side change
+- Patch from upstream git to fix test failure on arm
* Fri Oct 11 2013 Mamoru TASAKA <mtasaka at fedoraproject.org> - 3.0.2-4
- Make test failure conditional
More information about the scm-commits
mailing list