From 9cfe0217752e7057421b57fe73cb3233767cbcd5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Fri, 18 Jun 2010 09:23:26 +0000 Subject: [PATCH] - shadow outer var fix Changed files: cvsspam.spec -> 1.46 ruby19-shadow-outer-var.patch -> 1.1 --- cvsspam.spec | 4 ++- ruby19-shadow-outer-var.patch | 52 +++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 ruby19-shadow-outer-var.patch diff --git a/cvsspam.spec b/cvsspam.spec index b81b19a..b390fc2 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: 13 +Release: 13.1 License: GPL Group: Applications/System Source0: http://www.badgers-in-foil.co.uk/projects/cvsspam/releases/%{name}-%{version}.tar.gz @@ -12,6 +12,7 @@ Patch100: %{name}-branch.diff Patch0: %{name}-textdiff.patch Patch1: %{name}-tracfunc.patch Patch2: ruby19.patch +Patch3: ruby19-shadow-outer-var.patch URL: http://www.badgers-in-foil.co.uk/projects/cvsspam/ BuildRequires: rpmbuild(macros) >= 1.277 Requires: cvs-client @@ -42,6 +43,7 @@ rm svn_post_commit_hook.rb %patch0 -p0 %patch1 -p1 %patch2 -p1 +%patch3 -p1 %install rm -rf $RPM_BUILD_ROOT diff --git a/ruby19-shadow-outer-var.patch b/ruby19-shadow-outer-var.patch new file mode 100644 index 0000000..33becde --- /dev/null +++ b/ruby19-shadow-outer-var.patch @@ -0,0 +1,52 @@ +fix warnings for "warning: shadowing outer local variable - line" +side effect is that code starts to work again. + +--- cvsspam-0.2.12/collect_diffs.rb 2010-06-18 12:15:54.514725990 +0300 ++++ cvsspam-0.2.12/collect_diffs.rb 2010-06-18 12:16:09.410605410 +0300 +@@ -169,8 +169,7 @@ + + raise "missing data dir (#{$tmpdir}/#{$dirtemplate}-XXXXXX)" if $datadir==nil + +- line = $stdin.gets +- unless line =~ /^Update of (.+)/ ++ unless $stdin.gets =~ /^Update of (.+)/ + fail "Log preamble looks suspect (doesn't start 'Update of ...')" + end + +@@ -189,11 +188,15 @@ + end + + # look for the start of the user's comment ++ got_log_message = false + $stdin.each do |line| +- break if line =~ /^Log Message/ ++ if line =~ /^Log Message/ ++ got_log_message = true ++ break ++ end + end + +- unless line =~ /^Log Message/ ++ unless got_log_message + fail "Input did not contain a 'Log Message:' entry" + end + +@@ -273,12 +276,14 @@ + blah("about to run #{diff_cmd.join(' ')}") + safer_popen(*diff_cmd) do |pipe| + # skip over cvs-diff's preamble +- pipe.each do |line| +- break if line =~ /^diff / ++ line = nil ++ pipe.each do |l| ++ line = l ++ break if l =~ /^diff / + end + file.puts "#U #{line}" +- pipe.each do |line| +- file.puts "#U #{line}" ++ pipe.each do |l| ++ file.puts "#U #{l}" + end + end + end -- 2.43.0