[Pkg-wmaker-commits] [wmfrog] 27/145: debian/patches/20-weather.pl-grep-fix.dpatch: new

Doug Torrance dtorrance-guest at moszumanska.debian.org
Sun Aug 23 05:46:15 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository wmfrog.

commit 4898cec38fd93e19d196628843ea6ab00cd6d72c
Author: Jari Aalto <jari.aalto at cante.net>
Date:   Fri Nov 7 10:59:06 2008 +0200

    debian/patches/20-weather.pl-grep-fix.dpatch: new
    
    Signed-off-by: Jari Aalto <jari.aalto at cante.net>
---
 debian/patches/00list                        |  1 +
 debian/patches/20-weather.pl-grep-fix.dpatch | 74 ++++++++++++++++++++++++++++
 2 files changed, 75 insertions(+)

diff --git a/debian/patches/00list b/debian/patches/00list
index 21890f9..69c36af 100644
--- a/debian/patches/00list
+++ b/debian/patches/00list
@@ -1 +1,2 @@
 10-manpage-hyphen-fix.dpatch
+20-weather.pl-grep-fix.dpatch
diff --git a/debian/patches/20-weather.pl-grep-fix.dpatch b/debian/patches/20-weather.pl-grep-fix.dpatch
new file mode 100755
index 0000000..0e48920
--- /dev/null
+++ b/debian/patches/20-weather.pl-grep-fix.dpatch
@@ -0,0 +1,74 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## /tmp/weather.pl-grep-fix.patch.dpatch by  <jari.aalto at cante.net>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: ./Src/weather.pl: Check that /tmp/<station> folder exists before grep
+
+ at DPATCH@
+
+diff --git a/Src/weather.pl b/Src/weather.pl
+index 6849279..fee14e2 100755
+--- a/Src/weather.pl
++++ b/Src/weather.pl
+@@ -240,32 +240,37 @@ if($dew eq "")
+ }
+ 
+ #check for ok temperature
+-open(GREP, "grep Temp $tmpfolder/${station} | ");
+-$templine=<GREP>;
+-$templine=~m/^Temp:(.*)$/;
++
++if ( -d $tmpfolder/$station )
+ {
+-	$lattemp=$1;
+-	if($temp>-50 && $temp<150)
+-	{
+-		if($lasttemp>-50 && $lasttemp<150)
+-		{
+-			if($temp>-2 && $temp<2)
+-			{
+-				if($lasttemp>7 || $lasttemp<-7)
+-				{
+-					#probably invalid
+-					$station="";
+-				}
+-			}
+-		}
+-	}
+-	else
+-	{
+-	#invalid
+-	$station="";
+-	}
++    open(GREP, "grep Temp $tmpfolder/${station} | ");
++    $templine=<GREP>;
++
++    $templine=~m/^Temp:(.*)$/;
++    {
++	    $lattemp=$1;
++	    if($temp>-50 && $temp<150)
++	    {
++		    if($lasttemp>-50 && $lasttemp<150)
++		    {
++			    if($temp>-2 && $temp<2)
++			    {
++				    if($lasttemp>7 || $lasttemp<-7)
++				    {
++					    #probably invalid
++					    $station="";
++				    }
++			    }
++		    }
++	    }
++	    else
++	    {
++	    #invalid
++	    $station="";
++	    }
++    }
++    close GREP;
+ }
+-close GREP;
+ 
+ #print "$$station\n";
+ if(length($station)==4)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmfrog.git



More information about the Pkg-wmaker-commits mailing list