From: Elan Ruusamäe Date: Wed, 7 Apr 2010 15:28:38 +0000 (+0000) Subject: - ruby19 fix on users file encoding reading X-Git-Tag: auto/th/cvsspam-0_2_12-13 X-Git-Url: http://git.pld-linux.org/?p=packages%2Fcvsspam.git;a=commitdiff_plain;h=23914c10a068a6c348034488010329f55744f2b6;hp=011d6702aef090de939584c1544c37735840ab50 - ruby19 fix on users file encoding reading Changed files: cvsspam.spec -> 1.45 ruby19.patch -> 1.1 --- diff --git a/cvsspam.spec b/cvsspam.spec index e6a6e3c..b81b19a 100644 --- a/cvsspam.spec +++ b/cvsspam.spec @@ -2,7 +2,7 @@ Summary: CVSspam emails you diffs when someone commits a change to your CVS repo Summary(pl.UTF-8): CVSspam - wysyłanie różnic po wykonaniu zmiany w repozytorium CVS Name: cvsspam Version: 0.2.12 -Release: 12 +Release: 13 License: GPL Group: Applications/System Source0: http://www.badgers-in-foil.co.uk/projects/cvsspam/releases/%{name}-%{version}.tar.gz @@ -11,6 +11,7 @@ Source1: %{name}-branch.sh Patch100: %{name}-branch.diff Patch0: %{name}-textdiff.patch Patch1: %{name}-tracfunc.patch +Patch2: ruby19.patch URL: http://www.badgers-in-foil.co.uk/projects/cvsspam/ BuildRequires: rpmbuild(macros) >= 1.277 Requires: cvs-client @@ -40,6 +41,7 @@ rm svn_post_commit_hook.rb %patch100 -p0 %patch0 -p0 %patch1 -p1 +%patch2 -p1 %install rm -rf $RPM_BUILD_ROOT diff --git a/ruby19.patch b/ruby19.patch new file mode 100644 index 0000000..97117ea --- /dev/null +++ b/ruby19.patch @@ -0,0 +1,19 @@ +--- cvsspam-0.2.12/cvsspam.rb~ 2010-04-07 18:25:49.252489451 +0300 ++++ cvsspam-0.2.12/cvsspam.rb 2010-04-07 18:27:22.000000000 +0300 +@@ -169,7 +171,7 @@ + + # test to see of the given string contains non-ASCII characters + def requires_rfc2047?(word) +- (word =~ /[\177-\377]/) != nil ++ (word.force_encoding('ASCII-8BIT') =~ /[\177-\377]/) != nil + end + end + +@@ -2242,6 +2244,7 @@ + if File.exists?($users_file) + File.open($users_file) do |io| + io.each_line do |line| ++ line.force_encoding($users_file_charset) + if line =~ /^([^:]+)\s*:\s*(['"]?)([^\n\r]+)(\2)/ + if email.address == $1 + return EmailAddress.new($3, $users_file_charset)