From efaee5aa08113ec458044d84e9e7f255272a5e2f Mon Sep 17 00:00:00 2001 From: Mamoru Tasaka Date: Aug 26 2009 17:44:17 +0000 Subject: - Add trial sanity check again --- diff --git a/alexandria-0.6.5-glib_convert-syntax.patch b/alexandria-0.6.5-glib_convert-syntax.patch index 774669b..8f373ab 100644 --- a/alexandria-0.6.5-glib_convert-syntax.patch +++ b/alexandria-0.6.5-glib_convert-syntax.patch @@ -1,17 +1,65 @@ Index: lib/alexandria/utils.rb =================================================================== --- lib/alexandria/utils.rb (revision 1085) -+++ lib/alexandria/utils.rb (working copy) -@@ -20,7 +20,11 @@ ++++ lib/alexandria/utils.rb (revision 1086) +@@ -15,51 +15,17 @@ + # write to the Free Software Foundation, Inc., 51 Franklin Street, + # Fifth Floor, Boston, MA 02110-1301 USA. + +-#begin + require 'glib2' class String - def convert(charset_from, charset_to) +- def convert(charset_from, charset_to) - GLib.convert(self, charset_from, charset_to) -+# -+# Ask upstream!! Perhaps from <-> to are reverse -+# http://ruby-gnome2.sourceforge.jp/hiki.cgi?GLib#GLib.convert -+# -+ GLib.convert(self, charset_to, charset_from) ++ ++ # Converts this string into the desired charset. ++ # ++ # Note that this may raise a GLib::ConvertError if the ++ # desired_charset cannot accommodate all the characters present in ++ # the string, e.g. trying to convert Japanese Kanji to ISO-8859-1 ++ # will obviously not work. ++ def convert(desired_charset, source_data_charset) ++ GLib.convert(self, desired_charset, source_data_charset) end end - +- +-=begin +-rescue LoadError +- +- # We assume that Ruby/Cocoa is loaded there +- +- #require 'iconv' +- +- class String +- def to_utf8_nsstring +- # This should be writen in ObjC in order to catch the ObjC exception if the +- # string could not be converted to UTF8. +- (OSX::NSString.stringWithUTF8String(self) or self) +- end +- +- def convert(charset_from, charset_to) +- # Do nothing for the moment... +- self +- end +- +- return OSX::NSString.stringWithUTF8String(self) +- x = Iconv.iconv(charset_to, charset_from, self).first +- p "#{self} -> #{x}" +- return x +- #p charset_from, charset_to +- #return self +- +- from = OSX::NSString.alloc.initWithString(self) +- encoding = charset_to.nsencoding +- encoding = OSX::NSUnicodeStringEncoding +- data = from.dataUsingEncoding(encoding) +- s = OSX::NSString.alloc.initWithData_encoding(data, encoding).to_s +- s +- #self +- end +- +- end +- +-end +-=end diff --git a/alexandria.spec b/alexandria.spec index 816e824..1aa393d 100644 --- a/alexandria.spec +++ b/alexandria.spec @@ -5,7 +5,7 @@ %define majorver 0.6.5 %undefine minorver -%define fedorarel 2 +%define fedorarel 4 %define rel %{?minorver:0.}%{fedorarel}%{?minorver:.%minorver} @@ -22,12 +22,12 @@ Source0: http://rubyforge.org/frs/download.php/%{repoid}/%{name}-%{version}%{?mi # Trial fix for hang up when importing list containing invalid isdn # ref: alexandria-Bugs-25348 Patch2: alexandria-0.6.4.1-hang-importing-invalid-isdn.patch -# Need ask to upstream -# perhaps there is some confusion about GLib.convert... -#Patch3: alexandria-0.6.5-glib_convert-syntax.patch -# Need ask to upstream -# Sometimes search result has empty book or cover entry -#Patch4: alexandria-0.6.5-search-result-sanity-check.patch +# Clarify the usage of GLib.convert +# ref: alexandria-Bugs-26968 +Patch3: alexandria-0.6.5-glib_convert-syntax.patch +# Add some sanity check for search results +# Currently discussed on alexandria-Bugs-27000 +Patch4: alexandria-0.6.5-search-result-sanity-check.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -78,8 +78,8 @@ Alexandria is a GNOME application to help you manage your book collection. %prep %setup -q -n %{name}-%{majorver}%{?minorver} %patch2 -p0 -b .up25348 -#%%patch3 -p0 -b .glib -#%%patch4 -p0 -b .result +%patch3 -p0 -b .glib +%patch4 -p0 -b .sanity # Embed Fedora EVR %{__sed} -i.evr \ @@ -206,6 +206,13 @@ exit 0 %{_datadir}/icons/hicolor/*/apps/%{name}.* %changelog +* Thu Aug 27 2009 Mamoru Tasaka - 0.6.5-4 +- Add trial sanity check again + +* Fri Aug 21 2009 Mamoru Tasaka - 0.6.5-3 +- Clarify GLib.convert usage in utils.rb (does not change the + functionality of alexandria) + * Thu Aug 20 2009 Mamoru Tasaka - 0.6.5-2 - Kill the previous 2 patches (for now)