* [gentoo-commits] gentoo-x86 commit in media-plugins/mythweather/files: mythweather-0.21_p20069-nws-parse-fix.patch
@ 2009-11-10 15:58 Doug Goldstein (cardoe)
0 siblings, 0 replies; 2+ messages in thread
From: Doug Goldstein (cardoe) @ 2009-11-10 15:58 UTC (permalink / raw
To: gentoo-commits
cardoe 09/11/10 15:58:41
Added: mythweather-0.21_p20069-nws-parse-fix.patch
Log:
Patch from Jerry McDonald <gentoo@greatships.com> 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";
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* [gentoo-commits] gentoo-x86 commit in media-plugins/mythweather/files: mythweather-0.21_p20069-nws-parse-fix.patch
@ 2010-03-22 8:13 Samuli Suominen (ssuominen)
0 siblings, 0 replies; 2+ messages in thread
From: Samuli Suominen (ssuominen) @ 2010-03-22 8:13 UTC (permalink / raw
To: gentoo-commits
ssuominen 10/03/22 08:13:11
Removed: mythweather-0.21_p20069-nws-parse-fix.patch
Log:
old
(Portage version: 2.2_rc67/cvs/Linux x86_64)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-03-22 8:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-10 15:58 [gentoo-commits] gentoo-x86 commit in media-plugins/mythweather/files: mythweather-0.21_p20069-nws-parse-fix.patch Doug Goldstein (cardoe)
-- strict thread matches above, loose matches on Subject: below --
2010-03-22 8:13 Samuli Suominen (ssuominen)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox