Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-commits
Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-commits@g.o
From: "Doug Goldstein (cardoe)" <cardoe@g.o>
Subject: gentoo-x86 commit in media-plugins/mythweather/files: mythweather-0.21_p20069-nws-parse-fix.patch
Date: Tue, 10 Nov 2009 15:58:41 +0000
cardoe      09/11/10 15:58:41

  Added:                mythweather-0.21_p20069-nws-parse-fix.patch
  Log:
  Patch from Jerry McDonald <gentoo@...> from bug #287001 fixing the parsing error in the NWS script in 0.21. Fixed permissions on the scripts in 0.21 and 0.22
  (Portage version: 2.1.7.4/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  media-plugins/mythweather/files/mythweather-0.21_p20069-nws-parse-fix.patch

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-plugins/mythweather/files/mythweather-0.21_p20069-nws-parse-fix.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-plugins/mythweather/files/mythweather-0.21_p20069-nws-parse-fix.patch?rev=1.1&content-type=text/plain

Index: mythweather-0.21_p20069-nws-parse-fix.patch
===================================================================
diff -Burp a/mythweather/mythweather/scripts/us_nws/nwsxml.pl b/mythweather/mythweather/scripts/us_nws/nwsxml.pl
--- a/mythweather/mythweather/scripts/us_nws/nwsxml.pl	2008-02-11 11:38:20.000000000 -0500
+++ b/mythweather/mythweather/scripts/us_nws/nwsxml.pl	2009-09-29 17:59:08.000000000 -0400
@@ -99,11 +99,17 @@ foreach (@types) {
             $xml->{$key} = int($xml->{'wind_mph'} * 1.609344 + .5);
         }
     } elsif (/wind_gust/) {
-        if ($units =~ /ENG/ || $xml->{'wind_gust_mph'} eq 'NA') {
-            $key = 'wind_gust_mph';
+	if (defined($xml->{'wind_gust_mph'})) { 
+            if ($units =~ /ENG/ || $xml->{'wind_gust_mph'} eq 'NA') { 
+                $key = 'wind_gust_mph'; 
+            } else { 
+                $key = 'wind_gust_kph'; 
+                $xml->{$key} = int($xml->{'wind_gust_mph'} * 1.609344 + .5); 
+            }
         } else {
-            $key = 'wind_gust_kph';
-            $xml->{$key} = int($xml->{'wind_gust_mph'} * 1.609344 + .5);
+            $xml->{'wind_gust_mph'} = 'NA';
+            $xml->{'wind_gust_kph'} = 'NA';
+            $key = 'wind_gust';
         }
     } elsif (/visibility/) {
         if ($units =~ /ENG/) {
@@ -128,14 +134,17 @@ foreach (@types) {
     } elsif (/cclocation/) {
         $key = 'location';   
     } elsif (/appt$/) {
-        if ($xml->{windchill_f} eq 'NA') {
-            $key = 'heat_index_f' if ($units =~ /ENG/); 
-            $key = 'heat_index_c' if ($units =~ /SI/);
-        } else { 
-            $key = 'windchill_f' if ($units =~ /ENG/); 
-            $key = 'windchill_c' if ($units =~ /SI/);
-        };
-        
+        if (defined($xml->{windchill_f})) {
+            if ($xml->{windchill_f} eq 'NA') {
+                $key = 'heat_index_f' if ($units =~ /ENG/); 
+                $key = 'heat_index_c' if ($units =~ /SI/);
+            } else { 
+                $key = 'windchill_f' if ($units =~ /ENG/); 
+                $key = 'windchill_c' if ($units =~ /SI/);
+            };
+        } else {
+            $key = 'appt';
+        }
     } elsif (/wind_spdgst/) {
         # relying on this being after speed and gust
         $key = "wind_spdgst";
@@ -148,5 +157,11 @@ foreach (@types) {
     } else {
         $key = $label;
     }
-    printf $label . "::" . $xml->{$key}. "\n";
+    print $label . "::";
+    if (defined($xml->{$key})) {
+        print $xml->{$key};
+    } else {
+        print "NA";
+    }
+    print "\n";
 }





Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
gentoo-x86 commit in media-plugins/mythweather: mythweather-0.22_p22763-r1.ebuild ChangeLog mythweather-0.21_p20069-r1.ebuild mythweather-0.22_p22763.ebuild
Next by thread:
gentoo-x86 commit in media-plugins/mythweather/files: mythweather-0.21_p20069-nws-parse-fix.patch
Previous by date:
gentoo-x86 commit in media-plugins/mythweather: mythweather-0.22_p22763-r1.ebuild ChangeLog mythweather-0.21_p20069-r1.ebuild mythweather-0.22_p22763.ebuild
Next by date:
gentoo-x86 commit in media-plugins/gst-plugins-gconf: ChangeLog gst-plugins-gconf-0.10.16.ebuild


Updated Jun 26, 2012

Summary: Archive of the gentoo-commits mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.