r12064 - in /trunk/libgeo-metar-perl: METAR.pm debian/changelog debian/compat debian/control debian/libgeo-metar-perl.examples debian/patches/ debian/patches/01-various-#262397.patch debian/patches/series debian/rules debian/watch t/metar.t
tincho-guest at users.alioth.debian.org
tincho-guest at users.alioth.debian.org
Sat Jan 5 17:55:02 UTC 2008
Author: tincho-guest
Date: Sat Jan 5 17:55:01 2008
New Revision: 12064
URL: http://svn.debian.org/wsvn/?sc=1&rev=12064
Log:
* Moved modifications to the code to a patch file.
* Added quilt stuff.
* debian/control: updated Standards-Version, debhelper version, fixed
depends, and revamped Description.
* debian/rules: rewritten to conform current practices.
Added:
trunk/libgeo-metar-perl/debian/patches/
trunk/libgeo-metar-perl/debian/patches/01-various-#262397.patch
trunk/libgeo-metar-perl/debian/patches/series
Removed:
trunk/libgeo-metar-perl/debian/libgeo-metar-perl.examples
Modified:
trunk/libgeo-metar-perl/METAR.pm
trunk/libgeo-metar-perl/debian/changelog
trunk/libgeo-metar-perl/debian/compat
trunk/libgeo-metar-perl/debian/control
trunk/libgeo-metar-perl/debian/rules
trunk/libgeo-metar-perl/debian/watch
trunk/libgeo-metar-perl/t/metar.t
Modified: trunk/libgeo-metar-perl/METAR.pm
URL: http://svn.debian.org/wsvn/trunk/libgeo-metar-perl/METAR.pm?rev=12064&op=diff
==============================================================================
--- trunk/libgeo-metar-perl/METAR.pm (original)
+++ trunk/libgeo-metar-perl/METAR.pm Sat Jan 5 17:55:01 2008
@@ -95,13 +95,9 @@
# PRESSURE
#
-# The pressure, or altimeter setting, at the reporting site recorded in inches
-# of mercury (Hg) minus the decimal point. It should always look like
-# (A\d\d\d\d).
-#
-# Note: The WMO standard is to report the altimeter in whole hectopascals. In
-# this case, the altimeter setting group will be begin with a Q instead of an
-# A.
+# The pressure, or altimeter setting, at the reporting site recorded in
+# inches of mercury (Hg) minus the decimal point. It should always look
+# like (A\d\d\d\d).
# REMARKS
#
@@ -203,8 +199,6 @@
$self->{WIND_GUST_KTS} = undef; # wind gusts (knots)
$self->{WIND_MPH} = undef; # wind speed (MPH)
$self->{WIND_GUST_MPH} = undef; # wind gusts (MPH)
- $self->{WIND_VAR_DEG} = undef; # wind variation in degrees
- $self->{WIND_VAR_ENG} = undef; # wind variation in english
$self->{VISIBILITY} = undef; # visibility info
$self->{RUNWAY} = undef; # runyway vis.
$self->{WEATHER} = [ ]; # current weather
@@ -219,8 +213,7 @@
$self->{HOURLY_DEW_F} = undef; # hourly dew point, celcius
$self->{HOURLY_DEW_C} = undef; # hourly dew point, farenheit
$self->{HOURLY_PRECIP} = undef; # hourly precipitation
- $self->{ALT} = undef; # altimeter setting (Hg)
- $self->{ALT_HP} = undef; # altimeter setting (hPa)
+ $self->{ALT} = undef; # altimeter setting [pressure]
$self->{SLP} = undef; # sea level pressure
$self->{REMARKS} = undef; # remarks and such
@@ -229,16 +222,15 @@
# default=METAR
$self->{site} = undef; # the site code (4 chars)
$self->{date_time} = undef; # date/time
- $self->{modifier} = undef; # the AUTO/COR modifier
+ $self->{modifier} = "AUTO"; # the AUTO/COR modifier (if
+ # any) default=AUTO
$self->{wind} = undef; # the wind information
- $self->{vrbwind} = undef; # variable wind information
$self->{visibility} = undef; # visibility information
$self->{runway} = undef; # runway visibility
$self->{weather} = [ ]; # current weather conditions
$self->{sky} = [ ]; # sky conditions (cloud cover)
$self->{temp_dew} = undef; # temp and dew pt.
- $self->{alt} = undef; # altimeter setting (Hg)
- $self->{alt_hp} = undef; # altimeter setting (hPa)
+ $self->{alt} = undef; # altimeter setting
$self->{slp} = undef; # sea level pressure
$self->{remarks} = [ ]; # remarks
@@ -402,7 +394,7 @@
## is is a site ID?
##
- elsif ($tok =~ /^[A-Z]{4,4}$/ && !$self->{site})
+ elsif ($tok =~ /K[A-Z]{3,3}/)
{
$self->{site} = $tok;
print "[$tok] is a site ID.\n" if $self->{debug};
@@ -445,17 +437,6 @@
}
##
- ## is it variable wind information?
- ##
-
- elsif ($tok =~ /^\d\d\dV\d\d\d$/i)
- {
- $self->{vrbwind} = $tok;
- print "[$tok] is variable wind information.\n" if $self->{debug};
- next;
- }
-
- ##
## is it visibility information?
##
@@ -465,17 +446,6 @@
print "[$tok] is visibility information.\n" if $self->{debug};
next;
}
-
- ##
- ## does it say CAVOK? (ceiling and visibility ok)
- ##
-
- elsif ($tok =~ /^CAVOK/i)
- {
- $self->{visibility} = $tok;
- print "[$tok] is visibility information, too.\n" if $self->{debug};
- next;
- }
##
## is it visibility information with a leading digit?
@@ -615,7 +585,7 @@
}
##
- ## is it an altimeter setting? (inches in mercury)
+ ## is it an altimeter setting?
##
elsif (!$in_remarks && $tok =~ /^A(\d\d)(\d\d)$/i)
@@ -625,18 +595,6 @@
print "[$tok] is an altimeter setting.\n" if $self->{debug};
next;
}
-
- ##
- ## is it an altimeter setting? (hectopascals)
-
- elsif (!$in_remarks && $tok =~ /^Q(\d\d\d\d)$/i)
- {
- $self->{alt_hp} = $tok;
- $self->{ALT_HP} = $1;
- print "[$tok] is an altimeter setting in hectopascals.\n"
- if $self->{debug};
- next;
- }
##
## automatic station type?
@@ -875,95 +833,18 @@
}
##
- ## Variable wind information
- ##
-
- {
- if ($self->{vrbwind}) {
- my $vrbwind = $self->{vrbwind};
- my $vrbwind_deg_1 = substr($vrbwind,0,3);
- my $vrbwind_deg_2 = substr($vrbwind,4,3);
- my $vrbwind_eng_1 = "";
- my $vrbwind_eng_2 = "";
-
- if ($vrbwind_deg_1 < 15) { $vrbwind_eng_1 = "North"; }
- elsif ($vrbwind_deg_1 < 30) { $vrbwind_eng_1 = "North/Northeast"; }
- elsif ($vrbwind_deg_1 < 60) { $vrbwind_eng_1 = "Northeast"; }
- elsif ($vrbwind_deg_1 < 75) { $vrbwind_eng_1 = "East/Northeast"; }
- elsif ($vrbwind_deg_1 < 105) { $vrbwind_eng_1 = "East"; }
- elsif ($vrbwind_deg_1 < 120) { $vrbwind_eng_1 = "East/Southeast"; }
- elsif ($vrbwind_deg_1 < 150) { $vrbwind_eng_1 = "Southeast"; }
- elsif ($vrbwind_deg_1 < 165) { $vrbwind_eng_1 = "South/Southeast"; }
- elsif ($vrbwind_deg_1 < 195) { $vrbwind_eng_1 = "South"; }
- elsif ($vrbwind_deg_1 < 210) { $vrbwind_eng_1 = "South/Southwest"; }
- elsif ($vrbwind_deg_1 < 240) { $vrbwind_eng_1 = "Southwest"; }
- elsif ($vrbwind_deg_1 < 265) { $vrbwind_eng_1 = "West/Southwest"; }
- elsif ($vrbwind_deg_1 < 285) { $vrbwind_eng_1 = "West"; }
- elsif ($vrbwind_deg_1 < 300) { $vrbwind_eng_1 = "West/Northwest"; }
- elsif ($vrbwind_deg_1 < 330) { $vrbwind_eng_1 = "Northwest"; }
- elsif ($vrbwind_deg_1 < 345) { $vrbwind_eng_1 = "North/Northwest"; }
- else { $vrbwind_eng_1 = "North"; }
-
- if ($vrbwind_deg_2 < 15) { $vrbwind_eng_2 = "North"; }
- elsif ($vrbwind_deg_2 < 30) { $vrbwind_eng_2 = "North/Northeast"; }
- elsif ($vrbwind_deg_2 < 60) { $vrbwind_eng_2 = "Northeast"; }
- elsif ($vrbwind_deg_2 < 75) { $vrbwind_eng_2 = "East/Northeast"; }
- elsif ($vrbwind_deg_2 < 105) { $vrbwind_eng_2 = "East"; }
- elsif ($vrbwind_deg_2 < 120) { $vrbwind_eng_2 = "East/Southeast"; }
- elsif ($vrbwind_deg_2 < 150) { $vrbwind_eng_2 = "Southeast"; }
- elsif ($vrbwind_deg_2 < 165) { $vrbwind_eng_2 = "South/Southeast"; }
- elsif ($vrbwind_deg_2 < 195) { $vrbwind_eng_2 = "South"; }
- elsif ($vrbwind_deg_2 < 210) { $vrbwind_eng_2 = "South/Southwest"; }
- elsif ($vrbwind_deg_2 < 240) { $vrbwind_eng_2 = "Southwest"; }
- elsif ($vrbwind_deg_2 < 265) { $vrbwind_eng_2 = "West/Southwest"; }
- elsif ($vrbwind_deg_2 < 285) { $vrbwind_eng_2 = "West"; }
- elsif ($vrbwind_deg_2 < 300) { $vrbwind_eng_2 = "West/Northwest"; }
- elsif ($vrbwind_deg_2 < 330) { $vrbwind_eng_2 = "Northwest"; }
- elsif ($vrbwind_deg_2 < 345) { $vrbwind_eng_2 = "North/Northwest"; }
- else { $vrbwind_eng_2 = "North"; }
-
- push @{$self->{WIND_VAR_DEG}}, $vrbwind_deg_1;
- push @{$self->{WIND_VAR_DEG}}, $vrbwind_deg_2;
- push @{$self->{WIND_VAR_ENG}}, $vrbwind_eng_1;
- push @{$self->{WIND_VAR_ENG}}, $vrbwind_eng_2;
- }
- }
-
- ##
## Visibility.
##
{
- if ($self->{visibility}) {
- my $vis = $self->{visibility};
- $vis =~ s/SM$//oi; # nuke the "SM"
- if ($vis =~ /^CAVOK$/i) {
- $self->{VISIBILITY} = "Ceiling and visibility OK";
- }
- elsif ($vis =~ /M(\d\/\d)/o) {
- $self->{VISIBILITY} = "Less than $1 statute miles";
- } else {
- $self->{VISIBILITY} = $vis . " Statute Miles";
- } # end if
- }
+ my $vis = $self->{visibility};
+ $vis =~ s/SM$//oi; # nuke the "SM"
+ if ($vis =~ /M(\d\/\d)/o) {
+ $self->{VISIBILITY} = "Less than $1 statute miles";
+ } else {
+ $self->{VISIBILITY} = $vis . " Statute Miles";
+ } # end if
}
-
- ##
- ## Convert ALT to ALT_HP or vice versa
- ##
-
- {
- if ($self->{ALT} && !$self->{ALT_HP}) {
- my $alt = $self->{ALT};
- $alt = $alt * 1.33; # mmHg to hPa
- $self->{ALT_HP} = $alt;
- }
- elsif (!$self->{ALT} && $self->{ALT_HP}) {
- my $alt = $self->{ALT_HP};
- $alt = $alt * 0.75; # hPa to mmHg
- $self->{ALT} = $alt;
- }
- }
##
## Calculate F temps for all C temps
@@ -1029,14 +910,12 @@
print "date_time: $self->{date_time}\n";
print "modifier: $self->{modifier}\n";
print "wind: $self->{wind}\n";
- print "variable wind: $self->{vrbwind}\n";
print "visibility: $self->{visibility}\n";
print "runway: $self->{runway}\n";
print "weather: " . join(', ', @{$self->{weather}}) . "\n";
print "sky: " . join(', ', @{$self->{sky}}) . "\n";
print "temp_dew: $self->{temp_dew}\n";
print "alt: $self->{alt}\n";
- print "alt_hp: $self->{alt_hp}\n";
print "slp: $self->{slp}\n";
print "remarks: " . join (', ', @{$self->{remarks}}) . "\n";
print "\n";
@@ -1089,12 +968,10 @@
Here is how you I<might> use the Geo::METAR module.
One use that I have had for this module is to query the NWS METAR page
-(using the LWP modules) at:
-
-I<http://weather.noaa.gov/cgi-bin/mgetmetar.pl?cccc=KFDY>
-
-to get an up-to-date METAR. Then, I scan thru the output, looking for what
-looks like a METAR string (that's not hard in Perl). Oh, KFDY can be any site
+(using the LWP modules) at
+http://weather.noaa.gov/cgi-bin/mgetmetar.pl?cccc=KFDY to get an
+up-to-date METAR. Then, I scan thru the output, looking for what looks
+like a METAR string (that's not hard in Perl). Oh, KFDY can be any site
location code where there is a reporting station.
I then pass the METAR into this module and get the info I want. I can
@@ -1209,20 +1086,12 @@
=item WIND_DIR_ENG
-The current wind direction in English (Southwest, East, North, etc.)
+The current wind direction in english (Southwest, East, North, etc.)
=item WIND_DIR_DEG
The current wind direction in degrees.
-=item WIND_VAR_ENG
-
-Variable wind direction in English.
-
-=item WIND_VAR_DEG
-
-Variable wind direction in degrees.
-
=item WIND_KTS
The current wind speed in Knots.
@@ -1278,10 +1147,6 @@
=item ALT
Altimeter setting (barometric pressure).
-
-=item ALT_HP
-
-Altimeter setting in hectopascals.
=item REMARKS
Modified: trunk/libgeo-metar-perl/debian/changelog
URL: http://svn.debian.org/wsvn/trunk/libgeo-metar-perl/debian/changelog?rev=12064&op=diff
==============================================================================
--- trunk/libgeo-metar-perl/debian/changelog (original)
+++ trunk/libgeo-metar-perl/debian/changelog Sat Jan 5 17:55:01 2008
@@ -1,9 +1,17 @@
libgeo-metar-perl (1.14-6) UNRELEASED; urgency=low
+ [ gregor herrmann ]
* debian/control: Added: Vcs-Svn field (source stanza); Vcs-Browser
field (source stanza); Homepage field (source stanza).
* Set Maintainer to Debian Perl Group.
* Use dist-based URL in debian/watch.
+
+ [ MartÃn Ferrari ]
+ * Moved modifications to the code to a patch file.
+ * Added quilt stuff.
+ * debian/control: updated Standards-Version, debhelper version, fixed
+ depends, and revamped Description.
+ * debian/rules: rewritten to conform current practices.
-- gregor herrmann <gregor+debian at comodo.priv.at> Sat, 01 Dec 2007 18:54:54 +0100
Modified: trunk/libgeo-metar-perl/debian/compat
URL: http://svn.debian.org/wsvn/trunk/libgeo-metar-perl/debian/compat?rev=12064&op=diff
==============================================================================
--- trunk/libgeo-metar-perl/debian/compat (original)
+++ trunk/libgeo-metar-perl/debian/compat Sat Jan 5 17:55:01 2008
@@ -1,1 +1,1 @@
-4
+5
Modified: trunk/libgeo-metar-perl/debian/control
URL: http://svn.debian.org/wsvn/trunk/libgeo-metar-perl/debian/control?rev=12064&op=diff
==============================================================================
--- trunk/libgeo-metar-perl/debian/control (original)
+++ trunk/libgeo-metar-perl/debian/control Sat Jan 5 17:55:01 2008
@@ -3,8 +3,9 @@
Priority: optional
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
Uploaders: Jay Bonci <jaybonci at debian.org>
-Build-Depends-Indep: debhelper (>= 4.1.40), perl (>= 5.6.0-16)
-Standards-Version: 3.6.1.0
+Build-Depends-Indep: debhelper (>= 5), quilt
+Build-Depends: perl (>= 5.6.0-16)
+Standards-Version: 3.7.3
Homepage: http://search.cpan.org/dist/Geo-METAR/
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libgeo-metar-perl/
Vcs-Browser: http://svn.debian.org/wsvn/pkg-perl/trunk/libgeo-metar-perl/
@@ -12,11 +13,9 @@
Package: libgeo-metar-perl
Architecture: all
Depends: ${perl:Depends}
-Description: Geo::METAR, Accessing Aviation Weather Information with Perl
- libgeo-metar-perl (Geo::METAR) is a set of Perl modules which allow
- accessing of aviation weather information with Perl.
- The Geo::METAR home page is located at:
- http://www.wcnet.org/~jzawodn/perl/Geo-METAR/
- This is a perl module to allow accessing weather info.
+Description: Accessing Aviation Weather Information with Perl
+ Geo::METAR is a Perl module to access and parse aviation weather information
+ with Perl.
+ .
Note: This version differs slightly from the version in CPAN. See the file
README.Debian for specific changes
Added: trunk/libgeo-metar-perl/debian/patches/01-various-#262397.patch
URL: http://svn.debian.org/wsvn/trunk/libgeo-metar-perl/debian/patches/01-various-%23262397.patch?rev=12064&op=file
==============================================================================
--- trunk/libgeo-metar-perl/debian/patches/01-various-#262397.patch (added)
+++ trunk/libgeo-metar-perl/debian/patches/01-various-#262397.patch Sat Jan 5 17:55:01 2008
@@ -1,0 +1,377 @@
+Index: libgeo-metar-perl/METAR.pm
+===================================================================
+--- libgeo-metar-perl.orig/METAR.pm
++++ libgeo-metar-perl/METAR.pm
+@@ -95,9 +95,13 @@
+
+ # PRESSURE
+ #
+-# The pressure, or altimeter setting, at the reporting site recorded in
+-# inches of mercury (Hg) minus the decimal point. It should always look
+-# like (A\d\d\d\d).
++# The pressure, or altimeter setting, at the reporting site recorded in inches
++# of mercury (Hg) minus the decimal point. It should always look like
++# (A\d\d\d\d).
++#
++# Note: The WMO standard is to report the altimeter in whole hectopascals. In
++# this case, the altimeter setting group will be begin with a Q instead of an
++# A.
+
+ # REMARKS
+ #
+@@ -199,6 +203,8 @@ sub new
+ $self->{WIND_GUST_KTS} = undef; # wind gusts (knots)
+ $self->{WIND_MPH} = undef; # wind speed (MPH)
+ $self->{WIND_GUST_MPH} = undef; # wind gusts (MPH)
++ $self->{WIND_VAR_DEG} = undef; # wind variation in degrees
++ $self->{WIND_VAR_ENG} = undef; # wind variation in english
+ $self->{VISIBILITY} = undef; # visibility info
+ $self->{RUNWAY} = undef; # runyway vis.
+ $self->{WEATHER} = [ ]; # current weather
+@@ -213,7 +219,8 @@ sub new
+ $self->{HOURLY_DEW_F} = undef; # hourly dew point, celcius
+ $self->{HOURLY_DEW_C} = undef; # hourly dew point, farenheit
+ $self->{HOURLY_PRECIP} = undef; # hourly precipitation
+- $self->{ALT} = undef; # altimeter setting [pressure]
++ $self->{ALT} = undef; # altimeter setting (Hg)
++ $self->{ALT_HP} = undef; # altimeter setting (hPa)
+ $self->{SLP} = undef; # sea level pressure
+ $self->{REMARKS} = undef; # remarks and such
+
+@@ -222,15 +229,16 @@ sub new
+ # default=METAR
+ $self->{site} = undef; # the site code (4 chars)
+ $self->{date_time} = undef; # date/time
+- $self->{modifier} = "AUTO"; # the AUTO/COR modifier (if
+- # any) default=AUTO
++ $self->{modifier} = undef; # the AUTO/COR modifier
+ $self->{wind} = undef; # the wind information
++ $self->{vrbwind} = undef; # variable wind information
+ $self->{visibility} = undef; # visibility information
+ $self->{runway} = undef; # runway visibility
+ $self->{weather} = [ ]; # current weather conditions
+ $self->{sky} = [ ]; # sky conditions (cloud cover)
+ $self->{temp_dew} = undef; # temp and dew pt.
+- $self->{alt} = undef; # altimeter setting
++ $self->{alt} = undef; # altimeter setting (Hg)
++ $self->{alt_hp} = undef; # altimeter setting (hPa)
+ $self->{slp} = undef; # sea level pressure
+ $self->{remarks} = [ ]; # remarks
+
+@@ -394,7 +402,7 @@ sub _process
+ ## is is a site ID?
+ ##
+
+- elsif ($tok =~ /K[A-Z]{3,3}/)
++ elsif ($tok =~ /^[A-Z]{4,4}$/ && !$self->{site})
+ {
+ $self->{site} = $tok;
+ print "[$tok] is a site ID.\n" if $self->{debug};
+@@ -437,6 +445,17 @@ sub _process
+ }
+
+ ##
++ ## is it variable wind information?
++ ##
++
++ elsif ($tok =~ /^\d\d\dV\d\d\d$/i)
++ {
++ $self->{vrbwind} = $tok;
++ print "[$tok] is variable wind information.\n" if $self->{debug};
++ next;
++ }
++
++ ##
+ ## is it visibility information?
+ ##
+
+@@ -447,6 +466,17 @@ sub _process
+ next;
+ }
+
++ ##
++ ## does it say CAVOK? (ceiling and visibility ok)
++ ##
++
++ elsif ($tok =~ /^CAVOK/i)
++ {
++ $self->{visibility} = $tok;
++ print "[$tok] is visibility information, too.\n" if $self->{debug};
++ next;
++ }
++
+ ##
+ ## is it visibility information with a leading digit?
+ ##
+@@ -585,7 +615,7 @@ sub _process
+ }
+
+ ##
+- ## is it an altimeter setting?
++ ## is it an altimeter setting? (inches in mercury)
+ ##
+
+ elsif (!$in_remarks && $tok =~ /^A(\d\d)(\d\d)$/i)
+@@ -596,6 +626,18 @@ sub _process
+ next;
+ }
+
++ ##
++ ## is it an altimeter setting? (hectopascals)
++
++ elsif (!$in_remarks && $tok =~ /^Q(\d\d\d\d)$/i)
++ {
++ $self->{alt_hp} = $tok;
++ $self->{ALT_HP} = $1;
++ print "[$tok] is an altimeter setting in hectopascals.\n"
++ if $self->{debug};
++ next;
++ }
++
+ ##
+ ## automatic station type?
+ ##
+@@ -833,19 +875,96 @@ sub _process
+ }
+
+ ##
++ ## Variable wind information
++ ##
++
++ {
++ if ($self->{vrbwind}) {
++ my $vrbwind = $self->{vrbwind};
++ my $vrbwind_deg_1 = substr($vrbwind,0,3);
++ my $vrbwind_deg_2 = substr($vrbwind,4,3);
++ my $vrbwind_eng_1 = "";
++ my $vrbwind_eng_2 = "";
++
++ if ($vrbwind_deg_1 < 15) { $vrbwind_eng_1 = "North"; }
++ elsif ($vrbwind_deg_1 < 30) { $vrbwind_eng_1 = "North/Northeast"; }
++ elsif ($vrbwind_deg_1 < 60) { $vrbwind_eng_1 = "Northeast"; }
++ elsif ($vrbwind_deg_1 < 75) { $vrbwind_eng_1 = "East/Northeast"; }
++ elsif ($vrbwind_deg_1 < 105) { $vrbwind_eng_1 = "East"; }
++ elsif ($vrbwind_deg_1 < 120) { $vrbwind_eng_1 = "East/Southeast"; }
++ elsif ($vrbwind_deg_1 < 150) { $vrbwind_eng_1 = "Southeast"; }
++ elsif ($vrbwind_deg_1 < 165) { $vrbwind_eng_1 = "South/Southeast"; }
++ elsif ($vrbwind_deg_1 < 195) { $vrbwind_eng_1 = "South"; }
++ elsif ($vrbwind_deg_1 < 210) { $vrbwind_eng_1 = "South/Southwest"; }
++ elsif ($vrbwind_deg_1 < 240) { $vrbwind_eng_1 = "Southwest"; }
++ elsif ($vrbwind_deg_1 < 265) { $vrbwind_eng_1 = "West/Southwest"; }
++ elsif ($vrbwind_deg_1 < 285) { $vrbwind_eng_1 = "West"; }
++ elsif ($vrbwind_deg_1 < 300) { $vrbwind_eng_1 = "West/Northwest"; }
++ elsif ($vrbwind_deg_1 < 330) { $vrbwind_eng_1 = "Northwest"; }
++ elsif ($vrbwind_deg_1 < 345) { $vrbwind_eng_1 = "North/Northwest"; }
++ else { $vrbwind_eng_1 = "North"; }
++
++ if ($vrbwind_deg_2 < 15) { $vrbwind_eng_2 = "North"; }
++ elsif ($vrbwind_deg_2 < 30) { $vrbwind_eng_2 = "North/Northeast"; }
++ elsif ($vrbwind_deg_2 < 60) { $vrbwind_eng_2 = "Northeast"; }
++ elsif ($vrbwind_deg_2 < 75) { $vrbwind_eng_2 = "East/Northeast"; }
++ elsif ($vrbwind_deg_2 < 105) { $vrbwind_eng_2 = "East"; }
++ elsif ($vrbwind_deg_2 < 120) { $vrbwind_eng_2 = "East/Southeast"; }
++ elsif ($vrbwind_deg_2 < 150) { $vrbwind_eng_2 = "Southeast"; }
++ elsif ($vrbwind_deg_2 < 165) { $vrbwind_eng_2 = "South/Southeast"; }
++ elsif ($vrbwind_deg_2 < 195) { $vrbwind_eng_2 = "South"; }
++ elsif ($vrbwind_deg_2 < 210) { $vrbwind_eng_2 = "South/Southwest"; }
++ elsif ($vrbwind_deg_2 < 240) { $vrbwind_eng_2 = "Southwest"; }
++ elsif ($vrbwind_deg_2 < 265) { $vrbwind_eng_2 = "West/Southwest"; }
++ elsif ($vrbwind_deg_2 < 285) { $vrbwind_eng_2 = "West"; }
++ elsif ($vrbwind_deg_2 < 300) { $vrbwind_eng_2 = "West/Northwest"; }
++ elsif ($vrbwind_deg_2 < 330) { $vrbwind_eng_2 = "Northwest"; }
++ elsif ($vrbwind_deg_2 < 345) { $vrbwind_eng_2 = "North/Northwest"; }
++ else { $vrbwind_eng_2 = "North"; }
++
++ push @{$self->{WIND_VAR_DEG}}, $vrbwind_deg_1;
++ push @{$self->{WIND_VAR_DEG}}, $vrbwind_deg_2;
++ push @{$self->{WIND_VAR_ENG}}, $vrbwind_eng_1;
++ push @{$self->{WIND_VAR_ENG}}, $vrbwind_eng_2;
++ }
++ }
++
++ ##
+ ## Visibility.
+ ##
+
+ {
+- my $vis = $self->{visibility};
+- $vis =~ s/SM$//oi; # nuke the "SM"
+- if ($vis =~ /M(\d\/\d)/o) {
+- $self->{VISIBILITY} = "Less than $1 statute miles";
+- } else {
+- $self->{VISIBILITY} = $vis . " Statute Miles";
+- } # end if
++ if ($self->{visibility}) {
++ my $vis = $self->{visibility};
++ $vis =~ s/SM$//oi; # nuke the "SM"
++ if ($vis =~ /^CAVOK$/i) {
++ $self->{VISIBILITY} = "Ceiling and visibility OK";
++ }
++ elsif ($vis =~ /M(\d\/\d)/o) {
++ $self->{VISIBILITY} = "Less than $1 statute miles";
++ } else {
++ $self->{VISIBILITY} = $vis . " Statute Miles";
++ } # end if
++ }
+ }
+
++ ##
++ ## Convert ALT to ALT_HP or vice versa
++ ##
++
++ {
++ if ($self->{ALT} && !$self->{ALT_HP}) {
++ my $alt = $self->{ALT};
++ $alt = $alt * 1.33; # mmHg to hPa
++ $self->{ALT_HP} = $alt;
++ }
++ elsif (!$self->{ALT} && $self->{ALT_HP}) {
++ my $alt = $self->{ALT_HP};
++ $alt = $alt * 0.75; # hPa to mmHg
++ $self->{ALT} = $alt;
++ }
++ }
++
+ ##
+ ## Calculate F temps for all C temps
+ ##
+@@ -910,12 +1029,14 @@ sub dump
+ print "date_time: $self->{date_time}\n";
+ print "modifier: $self->{modifier}\n";
+ print "wind: $self->{wind}\n";
++ print "variable wind: $self->{vrbwind}\n";
+ print "visibility: $self->{visibility}\n";
+ print "runway: $self->{runway}\n";
+ print "weather: " . join(', ', @{$self->{weather}}) . "\n";
+ print "sky: " . join(', ', @{$self->{sky}}) . "\n";
+ print "temp_dew: $self->{temp_dew}\n";
+ print "alt: $self->{alt}\n";
++ print "alt_hp: $self->{alt_hp}\n";
+ print "slp: $self->{slp}\n";
+ print "remarks: " . join (', ', @{$self->{remarks}}) . "\n";
+ print "\n";
+@@ -968,10 +1089,12 @@ weather.
+ Here is how you I<might> use the Geo::METAR module.
+
+ One use that I have had for this module is to query the NWS METAR page
+-(using the LWP modules) at
+-http://weather.noaa.gov/cgi-bin/mgetmetar.pl?cccc=KFDY to get an
+-up-to-date METAR. Then, I scan thru the output, looking for what looks
+-like a METAR string (that's not hard in Perl). Oh, KFDY can be any site
++(using the LWP modules) at:
++
++I<http://weather.noaa.gov/cgi-bin/mgetmetar.pl?cccc=KFDY>
++
++to get an up-to-date METAR. Then, I scan thru the output, looking for what
++looks like a METAR string (that's not hard in Perl). Oh, KFDY can be any site
+ location code where there is a reporting station.
+
+ I then pass the METAR into this module and get the info I want. I can
+@@ -1086,12 +1209,20 @@ Modifier (AUTO/COR) if any.
+
+ =item WIND_DIR_ENG
+
+-The current wind direction in english (Southwest, East, North, etc.)
++The current wind direction in English (Southwest, East, North, etc.)
+
+ =item WIND_DIR_DEG
+
+ The current wind direction in degrees.
+
++=item WIND_VAR_ENG
++
++Variable wind direction in English.
++
++=item WIND_VAR_DEG
++
++Variable wind direction in degrees.
++
+ =item WIND_KTS
+
+ The current wind speed in Knots.
+@@ -1148,6 +1279,10 @@ Dew point in Farenheit.
+
+ Altimeter setting (barometric pressure).
+
++=item ALT_HP
++
++Altimeter setting in hectopascals.
++
+ =item REMARKS
+
+ Any remarks in the report.
+Index: libgeo-metar-perl/t/metar.t
+===================================================================
+--- libgeo-metar-perl.orig/t/metar.t
++++ libgeo-metar-perl/t/metar.t
+@@ -5,59 +5,19 @@
+ # Test script for METAR installation.
+
+ use strict;
+-use Test;
++use Test::More tests => 7;
+
+-BEGIN { plan tests => 6 }
++my $modname = "Geo::METAR";
++my $m;
+
+-use Geo::METAR;
+-
+-my %tally = (passed => 0, failed => 0, skipped => 0);
+-
+-print "Testing METAR.\n";
+-
+-my $m = new Geo::METAR;
+-
+-# Create a new instance.
+-
+-if (ref $m eq 'Geo::METAR') {
+- ok(1);
+-} else {
+- ok(0);
+-}
+-
+-##
+-## Try out one hard-coded example. We need many more of these.
+-##
+-
+-if ($m->metar("KFDY 251450Z 21012G21KT 8SM OVC065 04/M01 A3010 RMK 57014")) {
+- ok(1);
+-} else {
+- ok(0);
+-}
+-
+-if ($m->SITE eq "KFDY") {
+- ok(1);
+-} else {
+- ok(0);
+-}
+-
+-if ($m->DATE eq "25") {
+- ok(1);
+-} else {
+- ok(0);
+-}
+-
+-if ($m->MOD eq "AUTO") {
+- ok(1);
+-} else {
+- ok(0);
+-}
+-
+-if ($m->TEMP_F eq "39.2") {
+- ok(1);
+-} else {
+- ok(0);
+-}
++use_ok($modname);
++ok($m = $modname->new());
++ok(ref $m eq $modname);
++
++ok($m->metar("KFDY 251450Z 21012G21KT 8SM OVC065 04/M01 A3010 RMK 57014"));
++ok($m->SITE eq "KFDY");
++ok($m->DATE eq "25");
++ok($m->TEMP_F eq "39.2");
+
+ exit;
+
Added: trunk/libgeo-metar-perl/debian/patches/series
URL: http://svn.debian.org/wsvn/trunk/libgeo-metar-perl/debian/patches/series?rev=12064&op=file
==============================================================================
--- trunk/libgeo-metar-perl/debian/patches/series (added)
+++ trunk/libgeo-metar-perl/debian/patches/series Sat Jan 5 17:55:01 2008
@@ -1,0 +1,1 @@
+01-various-#262397.patch
Modified: trunk/libgeo-metar-perl/debian/rules
URL: http://svn.debian.org/wsvn/trunk/libgeo-metar-perl/debian/rules?rev=12064&op=diff
==============================================================================
--- trunk/libgeo-metar-perl/debian/rules (original)
+++ trunk/libgeo-metar-perl/debian/rules Sat Jan 5 17:55:01 2008
@@ -5,33 +5,36 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
-# This is the debhelper compatibility version to use.
-# export DH_COMPAT=4
+export PERL_MM_USE_DEFAULT=1
-PACKAGE=`pwd | sed -e "s/.*\/\\(.*\\)-.*/\\1/"`
+PACKAGE = $(shell dh_listpackages)
+TMP = $(CURDIR)/debian/$(PACKAGE)
+PERL ?= /usr/bin/perl
+include /usr/share/quilt/quilt.make
-build:
+build: build-stamp
+build-stamp: $(QUILT_STAMPFN)
dh_testdir
- # Add here commands to compile the package.
- perl Makefile.PL verbose INSTALLDIRS=vendor
-clean:
+ $(PERL) Makefile.PL verbose INSTALLDIRS=vendor
+ $(MAKE)
+ $(MAKE) test
+ touch $@
+
+clean: unpatch
dh_testdir
dh_testroot
+ dh_clean build-stamp install-stamp
+ [ ! -f Makefile ] || $(MAKE) realclean
- -$(MAKE) clean
- rm -f Makefile.old
- dh_clean
-
-install:
+install: install-stamp
+install-stamp: build-stamp
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
-
- $(MAKE) PREFIX=$(CURDIR)/debian/$(PACKAGE)/usr OPTIMIZE="-O2 -g -Wall" test install
- -find $(CURDIR)/debian -type d | xargs rmdir -p --ignore-fail-on-non-empty
- -find $(CURDIR)/examples/ -exec chmod 755 {} \;
+ $(MAKE) install DESTDIR=$(TMP) PREFIX=/usr
+ touch $@
binary-arch:;
binary-indep: build install
@@ -40,16 +43,15 @@
dh_installdocs
dh_installman
dh_installchangelogs
- dh_installexamples
+ dh_installexamples examples/*
dh_link
- dh_strip
+ dh_perl
dh_compress
dh_fixperms
dh_installdeb
- dh_perl
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
+.PHONY: build clean binary-indep binary-arch binary install
Modified: trunk/libgeo-metar-perl/debian/watch
URL: http://svn.debian.org/wsvn/trunk/libgeo-metar-perl/debian/watch?rev=12064&op=diff
==============================================================================
--- trunk/libgeo-metar-perl/debian/watch (original)
+++ trunk/libgeo-metar-perl/debian/watch Sat Jan 5 17:55:01 2008
@@ -1,2 +1,2 @@
version=3
-http://search.cpan.org/dist/Geo-METAR/ .*/Geo-METAR-([[:digit:]].*)\.tar\.gz
+http://search.cpan.org/dist/Geo-METAR/ .*/Geo-METAR-v?([[:digit:]].*)\.tar\.gz
Modified: trunk/libgeo-metar-perl/t/metar.t
URL: http://svn.debian.org/wsvn/trunk/libgeo-metar-perl/t/metar.t?rev=12064&op=diff
==============================================================================
--- trunk/libgeo-metar-perl/t/metar.t (original)
+++ trunk/libgeo-metar-perl/t/metar.t Sat Jan 5 17:55:01 2008
@@ -5,19 +5,59 @@
# Test script for METAR installation.
use strict;
-use Test::More tests => 7;
+use Test;
-my $modname = "Geo::METAR";
-my $m;
+BEGIN { plan tests => 6 }
-use_ok($modname);
-ok($m = $modname->new());
-ok(ref $m eq $modname);
+use Geo::METAR;
-ok($m->metar("KFDY 251450Z 21012G21KT 8SM OVC065 04/M01 A3010 RMK 57014"));
-ok($m->SITE eq "KFDY");
-ok($m->DATE eq "25");
-ok($m->TEMP_F eq "39.2");
+my %tally = (passed => 0, failed => 0, skipped => 0);
+
+print "Testing METAR.\n";
+
+my $m = new Geo::METAR;
+
+# Create a new instance.
+
+if (ref $m eq 'Geo::METAR') {
+ ok(1);
+} else {
+ ok(0);
+}
+
+##
+## Try out one hard-coded example. We need many more of these.
+##
+
+if ($m->metar("KFDY 251450Z 21012G21KT 8SM OVC065 04/M01 A3010 RMK 57014")) {
+ ok(1);
+} else {
+ ok(0);
+}
+
+if ($m->SITE eq "KFDY") {
+ ok(1);
+} else {
+ ok(0);
+}
+
+if ($m->DATE eq "25") {
+ ok(1);
+} else {
+ ok(0);
+}
+
+if ($m->MOD eq "AUTO") {
+ ok(1);
+} else {
+ ok(0);
+}
+
+if ($m->TEMP_F eq "39.2") {
+ ok(1);
+} else {
+ ok(0);
+}
exit;
More information about the Pkg-perl-cvs-commits
mailing list