rpms/alexandria/devel alexandria-0.6.3-library-utf8-string.patch, 1.2, 1.3 alexandria.spec, 1.20, 1.21
Mamoru Tasaka
mtasaka at fedoraproject.org
Thu Feb 26 01:54:47 UTC 2009
Author: mtasaka
Update of /cvs/extras/rpms/alexandria/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv9894
Modified Files:
alexandria-0.6.3-library-utf8-string.patch alexandria.spec
Log Message:
UTF-8 patch now upstreamed
alexandria-0.6.3-library-utf8-string.patch:
Index: alexandria-0.6.3-library-utf8-string.patch
===================================================================
RCS file: /cvs/extras/rpms/alexandria/devel/alexandria-0.6.3-library-utf8-string.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- alexandria-0.6.3-library-utf8-string.patch 25 Feb 2009 18:38:19 -0000 1.2
+++ alexandria-0.6.3-library-utf8-string.patch 26 Feb 2009 01:54:16 -0000 1.3
@@ -1,32 +1,53 @@
---- alexandria-0.6.3/lib/alexandria/ui/sidepane.rb.utf_8 2008-02-21 10:11:37.000000000 +0900
-+++ alexandria-0.6.3/lib/alexandria/ui/sidepane.rb 2009-02-26 03:33:41.000000000 +0900
-@@ -20,17 +20,25 @@
+Index: lib/alexandria/ui/sidepane.rb
+===================================================================
+--- lib/alexandria/ui/sidepane.rb (revision 1013)
++++ lib/alexandria/ui/sidepane.rb (working copy)
+@@ -19,21 +19,39 @@
+ x and x.name != @parent.selected_library.name
end
- def contains_illegal_character new_text
-- /([^\w\s'"()&?!:;.\-])/.match(new_text)
-+ #/([^\w\s'"()&?!:;.\-])/.match(new_text)
-+ if /(\/)/.match(new_text)
-+ return true
-+ end
+- def contains_illegal_character new_text
+- /(\/)/.match(new_text)
+- # only forbid / character (since Library names become dir names)
++ # if new_text is invalid utf-8, returns true
++ # if new_text contains disallowed char (/), returns a MatchData object
++ # otherwise returns nil
++ def contains_illegal_character(new_text)
+ begin
-+ new_text.unpack("U*")
-+ rescue
++ new_text.unpack("U*") # attempt to unpack as UTF-8 characters
++ match = /(\/)/.match(new_text)
++ # only forbid / character (since Library names become dir names)
++ return match
++ rescue Exception => ex
++ log.warn { "New library name not valid UTF-8: #{ex.message}" }
+ return true
+ end
-+ return false
+ # /([^\w\s'"()&?!:;.\-])/.match(new_text) # anglocentric!
end
def on_edited_library cell, path_string, new_text
- log.debug { "edited" }
+- log.debug { "edited" }
++ log.debug { "edited library name #{new_text}" }
++ ## new_text = new_text.reverse # for testing;
++ # a great way to generate broken UTF-8
if cell.text != new_text
-- if match = contains_illegal_character(new_text)
-+ if contains_illegal_character(new_text)
- log.debug { "Illegal character" }
- ErrorDialog.new(@main_app, _("Invalid library name '%s'") % new_text,
+ if match = contains_illegal_character(new_text)
+- log.debug { "Illegal character" }
+- puts match
+- ErrorDialog.new(@main_app, _("Invalid library name '%s'") % new_text,
- _("The name provided contains the " + "illegal character '<i>%s</i>'.") %
- match[1].gsub(/&/, "&"))
-+ _("The name provided contains illegal characters"))
++ if match.instance_of? MatchData
++ chars = match[1].gsub(/&/, "&")
++ ErrorDialog.new(@main_app, _("Invalid library name '%s'") % new_text,
++ _("The name provided contains the " +
++ "disallowed character <b>%s</b> ") % chars)
++ else
++ ErrorDialog.new(@main_app, _("Invalid library name"),
++ _("The name provided contains " +
++ "invalid characters."))
++ end
++
elsif new_text.strip.empty?
log.debug { "Empty text" }
ErrorDialog.new(@main_app, _("The library name " +
Index: alexandria.spec
===================================================================
RCS file: /cvs/extras/rpms/alexandria/devel/alexandria.spec,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- alexandria.spec 25 Feb 2009 18:23:57 -0000 1.20
+++ alexandria.spec 26 Feb 2009 01:54:16 -0000 1.21
@@ -5,7 +5,7 @@
%define majorver 0.6.3
%undefine minorver
-%define fedorarel 9
+%define fedorarel 10
%define rel %{?minorver:0.}%{fedorarel}%{?minorver:.%minorver}
@@ -69,7 +69,7 @@
%prep
%setup -q -n %{name}-%{majorver}%{?minorver}
#%%patch0 -p1 -b .tooltips
-%patch1 -p1 -b .utf_8
+%patch1 -p0 -b .utf_8
%build
rake build
@@ -189,6 +189,9 @@
%{_datadir}/icons/hicolor/*/apps/%{name}.*
%changelog
+* Thu Feb 26 2009 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 0.6.3-10
+- Use upstreamed patch for UTF-8 strings issue
+
* Thu Feb 26 2009 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 0.6.3-9
- Attempt to handle UTF-8 strings in library names correctly
More information about the fedora-extras-commits
mailing list