[libtime-olsontz-download-perl] 01/08: New upstream version 0.006
gregor herrmann
gregoa at debian.org
Thu Aug 3 00:53:09 UTC 2017
This is an automated email from the git hooks/post-receive script.
gregoa pushed a commit to branch master
in repository libtime-olsontz-download-perl.
commit ce42403c3515cb4a9d2c2ff1d32ccb6acdae3f2d
Author: gregor herrmann <gregoa at debian.org>
Date: Wed Aug 2 20:40:30 2017 -0400
New upstream version 0.006
---
Build.PL | 11 ++--
Changes | 29 +++++++++++
MANIFEST | 2 +-
META.json | 68 +++++++++++++++++++++++++
META.yml | 46 +++++++++++++++++
README | 3 +-
SIGNATURE | 35 +++++++++++++
lib/Time/OlsonTZ/Download.pm | 26 ++++++----
xt/latest.t | 119 +++++++++++++++++++++++++++++++++++++++++++
9 files changed, 323 insertions(+), 16 deletions(-)
diff --git a/Build.PL b/Build.PL
index 00bf050..542faa1 100644
--- a/Build.PL
+++ b/Build.PL
@@ -9,35 +9,36 @@ Module::Build->new(
license => "perl",
configure_requires => {
"Module::Build" => 0,
- "perl" => "5.006",
+ "perl" => "5.008",
"strict" => 0,
"warnings" => 0,
},
build_requires => {
"Module::Build" => 0,
"Test::More" => 0,
- "perl" => "5.006",
+ "perl" => "5.008",
"strict" => 0,
"warnings" => 0,
},
requires => {
"Carp" => 0,
+ "Encode" => "1.75",
"File::Path" => "2.07",
"File::Temp" => "0.22",
"IO::Dir" => "1.03",
"IO::File" => "1.03",
"IPC::Filter" => "0.002",
- "Net::FTP" => "1.21",
+ "Net::FTP" => "3.07",
"Params::Classify" => 0,
"String::ShellQuote" => "1.01",
"parent" => 0,
- "perl" => "5.006",
+ "perl" => "5.008",
"strict" => 0,
+ "utf8" => 0,
"warnings" => 0,
},
dynamic_config => 0,
meta_add => { distribution_type => "module" },
- create_makefile_pl => "passthrough",
sign => 1,
)->create_build_script;
diff --git a/Changes b/Changes
index 5da88c5..30bc9ac 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,32 @@
+version 0.006; 2017-07-17
+
+ * when invoking make in the Olson distribution directory, suppress
+ rebuilding of the version file, to cope with copies of the
+ distribution in which timestamps have been mangled, or which are git
+ working directories for projects other than the Olson database, or
+ from which some version-contributing files (such as the copyrighted
+ ones) have been omitted
+
+version 0.005; 2017-07-16
+
+ * bugfix: require bugfixed version of Net::FTP
+
+ * accept non-ASCII UTF-8 strings in iso3166.tab, seen from tzdata
+ version 2015e onwards, consequently increasing the Perl version
+ requirement to 5.8
+
+ * avoid unescaped brace in regexp, which is deprecated starting in
+ Perl 5.21.1
+
+ * in documentation, indicate that the ->new_from_local_source
+ constructor accepts multiple attribute parameters
+
+ * new author test to try out the module's actual functionality (not
+ automatically run due to dependence on network and on the content
+ of the latest Olson distribution)
+
+ * no longer include a Makefile.PL in the distribution
+
version 0.004; 2012-07-20
* switch to new official repository, <ftp://ftp.iana.org/tz/releases/>
diff --git a/MANIFEST b/MANIFEST
index 9f5ec56..1b1ff2b 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -4,10 +4,10 @@ Changes
MANIFEST
META.json
META.yml
-Makefile.PL
README
lib/Time/OlsonTZ/Download.pm
t/pod_cvg.t
t/pod_syn.t
t/use.t
+xt/latest.t
SIGNATURE Added here by Module::Build
diff --git a/META.json b/META.json
new file mode 100644
index 0000000..dee3cc4
--- /dev/null
+++ b/META.json
@@ -0,0 +1,68 @@
+{
+ "abstract" : "Olson timezone database from source",
+ "author" : [
+ "Andrew Main (Zefram) <zefram at fysh.org>"
+ ],
+ "dynamic_config" : 0,
+ "generated_by" : "Module::Build version 0.4222",
+ "license" : [
+ "perl_5"
+ ],
+ "meta-spec" : {
+ "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
+ "version" : 2
+ },
+ "name" : "Time-OlsonTZ-Download",
+ "prereqs" : {
+ "build" : {
+ "requires" : {
+ "Module::Build" : "0",
+ "Test::More" : "0",
+ "perl" : "5.008",
+ "strict" : "0",
+ "warnings" : "0"
+ }
+ },
+ "configure" : {
+ "requires" : {
+ "Module::Build" : "0",
+ "perl" : "5.008",
+ "strict" : "0",
+ "warnings" : "0"
+ }
+ },
+ "runtime" : {
+ "requires" : {
+ "Carp" : "0",
+ "Encode" : "1.75",
+ "File::Path" : "2.07",
+ "File::Temp" : "0.22",
+ "IO::Dir" : "1.03",
+ "IO::File" : "1.03",
+ "IPC::Filter" : "0.002",
+ "Net::FTP" : "3.07",
+ "Params::Classify" : "0",
+ "String::ShellQuote" : "1.01",
+ "parent" : "0",
+ "perl" : "5.008",
+ "strict" : "0",
+ "utf8" : "0",
+ "warnings" : "0"
+ }
+ }
+ },
+ "provides" : {
+ "Time::OlsonTZ::Download" : {
+ "file" : "lib/Time/OlsonTZ/Download.pm",
+ "version" : "0.006"
+ }
+ },
+ "release_status" : "stable",
+ "resources" : {
+ "license" : [
+ "http://dev.perl.org/licenses/"
+ ]
+ },
+ "version" : "0.006",
+ "x_serialization_backend" : "JSON::PP version 2.93"
+}
diff --git a/META.yml b/META.yml
new file mode 100644
index 0000000..699c42a
--- /dev/null
+++ b/META.yml
@@ -0,0 +1,46 @@
+---
+abstract: 'Olson timezone database from source'
+author:
+ - 'Andrew Main (Zefram) <zefram at fysh.org>'
+build_requires:
+ Module::Build: '0'
+ Test::More: '0'
+ perl: '5.008'
+ strict: '0'
+ warnings: '0'
+configure_requires:
+ Module::Build: '0'
+ perl: '5.008'
+ strict: '0'
+ warnings: '0'
+dynamic_config: 0
+generated_by: 'Module::Build version 0.4222, CPAN::Meta::Converter version 2.150010'
+license: perl
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: '1.4'
+name: Time-OlsonTZ-Download
+provides:
+ Time::OlsonTZ::Download:
+ file: lib/Time/OlsonTZ/Download.pm
+ version: '0.006'
+requires:
+ Carp: '0'
+ Encode: '1.75'
+ File::Path: '2.07'
+ File::Temp: '0.22'
+ IO::Dir: '1.03'
+ IO::File: '1.03'
+ IPC::Filter: '0.002'
+ Net::FTP: '3.07'
+ Params::Classify: '0'
+ String::ShellQuote: '1.01'
+ parent: '0'
+ perl: '5.008'
+ strict: '0'
+ utf8: '0'
+ warnings: '0'
+resources:
+ license: http://dev.perl.org/licenses/
+version: '0.006'
+x_serialization_backend: 'CPAN::Meta::YAML version 0.012'
diff --git a/README b/README
index ce39b31..4914be6 100644
--- a/README
+++ b/README
@@ -23,7 +23,8 @@ Andrew Main (Zefram) <zefram at fysh.org>
COPYRIGHT
-Copyright (C) 2010, 2011, 2012 Andrew Main (Zefram) <zefram at fysh.org>
+Copyright (C) 2010, 2011, 2012, 2017
+Andrew Main (Zefram) <zefram at fysh.org>
LICENSE
diff --git a/SIGNATURE b/SIGNATURE
new file mode 100644
index 0000000..3540b1c
--- /dev/null
+++ b/SIGNATURE
@@ -0,0 +1,35 @@
+This file contains message digests of all files listed in MANIFEST,
+signed via the Module::Signature module, version 0.73.
+
+To verify the content in this distribution, first make sure you have
+Module::Signature installed, then type:
+
+ % cpansign -v
+
+It will check each file's integrity, as well as the signature's
+validity. If "==> Signature verified OK! <==" is not displayed,
+the distribution may already have been compromised, and you should
+not run its Makefile.PL or Build.PL.
+
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+SHA1 859028e24d7d3ac5cf5809692e685befb1d7b2ca .gitignore
+SHA1 1571ce6bf0a9cd1b717be9ef321d215585f798d4 Build.PL
+SHA1 c83b58b580be5b22d4d95c7e7a64605412204701 Changes
+SHA1 8190abde39553507eb1d93938b63d03491d157f8 MANIFEST
+SHA1 81c869698e034dffd7f32a69a381dc5363c85fb9 META.json
+SHA1 d0d1207cb9b27306c1b180785e09720ac7992aee META.yml
+SHA1 4015c3ead93c8dd2cd7d2f4d2e3aa915365adbe7 README
+SHA1 50babfa765be17630534c56610224a17f6c222c8 lib/Time/OlsonTZ/Download.pm
+SHA1 904d9a4f76525e2303e4b0c168c68230f223c8de t/pod_cvg.t
+SHA1 65c75abdef6f01a5d1588a307f2ddfe2333dc961 t/pod_syn.t
+SHA1 90514f5e59b12f6e8a08da605da827900cff24ea t/use.t
+SHA1 2f2912328b2639991467ee6255eccbd3b1fbec14 xt/latest.t
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1
+
+iEYEARECAAYFAllsC3gACgkQOV9mt2VyAVHP0gCeKDlIIAd1Az45rCVKu2Phc50l
+vhoAnjSBp5ML8TtXs3aSzlAvh4IQtD8+
+=M8z8
+-----END PGP SIGNATURE-----
diff --git a/lib/Time/OlsonTZ/Download.pm b/lib/Time/OlsonTZ/Download.pm
index 1fc64a7..8221dcf 100644
--- a/lib/Time/OlsonTZ/Download.pm
+++ b/lib/Time/OlsonTZ/Download.pm
@@ -44,16 +44,18 @@ use warnings;
use strict;
use Carp qw(croak);
+use Encode 1.75 qw(decode FB_CROAK);
use File::Path 2.07 qw(rmtree);
use File::Temp 0.22 qw(tempdir);
use IO::Dir 1.03 ();
use IO::File 1.03 ();
use IPC::Filter 0.002 qw(filter);
-use Net::FTP 1.21 ();
+use Net::FTP 3.07 ();
use Params::Classify 0.000 qw(is_undef is_string);
use String::ShellQuote 1.01 qw(shell_quote);
+use utf8 ();
-our $VERSION = "0.004";
+our $VERSION = "0.006";
sub _init_ftp($$) {
my($self, $hostname) = @_;
@@ -217,7 +219,7 @@ sub new {
return $self;
}
-=item Time::OlsonTZ::Download->new_from_local_source(ATTR => VALUE)
+=item Time::OlsonTZ::Download->new_from_local_source(ATTR => VALUE, ...)
Acquires Olson database source locally, without downloading, and returns
an object representing a copy of it ready to use like a download.
@@ -635,7 +637,9 @@ sub country_selection {
my $itabfh = IO::File->new($itabname, "r")
or die "data file $itabname unreadable: $!\n";
while(defined(my $line = $itabfh->getline)) {
- if($line =~ /\A([A-Z]{2})\t([!-~][ -~]*[!-~])\n\z/) {
+ $line = decode("UTF-8", $line, FB_CROAK);
+ utf8::upgrade($line);
+ if($line =~ /\A([A-Z]{2})\t(\S[^\t\n]*\S)\n\z/) {
die "duplicate $itabname entry for $1\n"
if exists $itab{$1};
$itab{$1} = $2;
@@ -711,7 +715,7 @@ sub _ensure_standard_zonenames {
\nzonenames:[\ \t]+\$\(TDATA\)[\ \t]*\n
\t[\ \t]*\@\$\(AWK\)\ '
/\^Zone/\ \{\ print\ \$\$2\ \}
- \ /\^Link/\ {\ print\ \$\$3\ }
+ \ /\^Link/\ \{\ print\ \$\$3\ \}
'\ \$\(TDATA\)[\ \t]*\n\n
#x);
}
@@ -725,7 +729,8 @@ sub data_files {
$self->_ensure_standard_zonenames;
$self->_ensure_unpacked;
my $list = filter("", "cd @{[shell_quote($self->dir)]} && ".
- "make zonenames AWK=echo");
+ "make zonenames ".
+ "AWK=echo VERSION_DEPS=");
$list =~ s#\A.*\{.*\} ##s;
$list =~ s#\n\z##;
$self->{data_files} =
@@ -738,7 +743,8 @@ sub _ensure_zic_built {
my($self) = @_;
unless($self->{zic_built}) {
$self->_ensure_unpacked;
- filter("", "cd @{[shell_quote($self->dir)]} && make zic");
+ filter("", "cd @{[shell_quote($self->dir)]} && ".
+ "make zic VERSION_DEPS=");
$self->{zic_built} = 1;
}
}
@@ -814,7 +820,8 @@ sub zoneinfo_dir {
my $zidir = $self->dir."/zoneinfo_$type";
unless($self->{"zoneinfo_built_$type"}) {
filter("", "cd @{[shell_quote($self->unpacked_dir)]} && ".
- "make ${type}_only TZDIR=@{[shell_quote($zidir)]}");
+ "make ${type}_only TZDIR=@{[shell_quote($zidir)]} ".
+ "VERSION_DEPS=");
my %expect_names = %{$self->all_names};
my $skiplen = length($zidir) + 1;
_foreach_nondir_under($zidir, sub {
@@ -859,7 +866,8 @@ Andrew Main (Zefram) <zefram at fysh.org>
=head1 COPYRIGHT
-Copyright (C) 2010, 2011, 2012 Andrew Main (Zefram) <zefram at fysh.org>
+Copyright (C) 2010, 2011, 2012, 2017
+Andrew Main (Zefram) <zefram at fysh.org>
=head1 LICENSE
diff --git a/xt/latest.t b/xt/latest.t
new file mode 100644
index 0000000..7f59540
--- /dev/null
+++ b/xt/latest.t
@@ -0,0 +1,119 @@
+use warnings;
+use strict;
+
+use Params::Classify qw(is_blessed is_ref is_string);
+use Test::More tests => 57;
+
+BEGIN { use_ok "Time::OlsonTZ::Download"; }
+
+my $lv = Time::OlsonTZ::Download->latest_version;
+ok is_string($lv), "latest_version well formed";
+like $lv, qr/\A[0-9]{4}[a-z]\z/, "latest_version well formed";
+
+my $ld = Time::OlsonTZ::Download->new;
+ok is_blessed($ld), "constructor returns object";
+my $v = $ld->version;
+ok is_string($v), "version well formed";
+like $v, qr/\A[0-9]{4}[a-z]\z/, "version well formed";
+is $v, $lv, "version is latest version";
+my $cv = $ld->code_version;
+ok is_string($cv), "code_version well formed";
+like $cv, qr/\A[0-9]{4}[a-z]\z/, "code_version well formed";
+ok $cv le $lv, "code_version is no later than latest version";
+my $dv = $ld->data_version;
+ok is_string($dv), "data_version well formed";
+like $dv, qr/\A[0-9]{4}[a-z]\z/, "data_version well formed";
+ok $dv eq $lv, "data_version is latest version";
+
+my $dir = $ld->dir;
+ok is_string($dir), "dir well formed";
+like $dir, qr#\A/#, "dir well formed";
+my $udir = $ld->unpacked_dir;
+ok is_string($udir), "unpacked_dir well formed";
+is $udir, $dir, "unpacked_dir is dir";
+ok(-f "$dir/zic.c", "code (zic.c) unpacked");
+ok(-f "$dir/iso3166.tab", "data (iso3166.tab) unpacked");
+if($dir =~ m#\A/# && $udir eq $dir) {
+ # date.c is a copyrighted file; check that we can go on without it
+ unlink "$dir/date.c";
+}
+
+my $zname_rx = qr#[A-Za-z0-9\-\+_]{1,14}(?:/[A-Za-z0-9\-\+_]{1,14})*|Canada/East-Saskatchewan#;
+
+my $cn = $ld->canonical_names;
+ok is_ref($cn, "HASH"), "canonical_names well formed";
+ok !(grep { !/\A$zname_rx\z/ } keys %$cn), "canonical_names well formed";
+ok !(grep { defined } values %$cn), "canonical_names well formed";
+ok keys(%$cn) >= 100, "at least 100 canonical zones";
+note "have @{[scalar keys %$cn]} canonical zones";
+my $ln = $ld->link_names;
+ok is_ref($ln, "HASH"), "link_names well formed";
+ok !(grep { !/\A$zname_rx\z/ } keys %$ln), "link_names well formed";
+ok !(grep { defined } values %$ln), "link_names well formed";
+ok keys(%$ln) >= 1, "at least 1 link";
+note "have @{[scalar keys %$ln]} links";
+ok !(grep { exists $ln->{$_} } keys %$cn), "no link names in canonical_names";
+ok !(grep { exists $cn->{$_} } keys %$ln), "no canonical names in link_names";
+my $an = $ld->all_names;
+ok is_ref($an, "HASH"), "all_names well formed";
+ok !(grep { defined } values %$an), "all_names well formed";
+is_deeply $an, { %$cn, %$ln }, "all_names is canonical_names plus link_names";
+ok exists($an->{"Europe/London"}), "Europe/London zone defined";
+
+my $rl = $ld->raw_links;
+ok is_ref($rl, "HASH"), "raw_links well formed";
+ok !(grep { !/\A$zname_rx\z/ } keys %$rl), "raw_links well formed";
+ok !(grep { !(is_string($_) && /\A$zname_rx\z/) } values %$rl), "raw_links well formed";
+is_deeply [ sort keys %$rl ], [ sort keys %$ln ], "raw_links keys match link_names";
+my $tl = $ld->threaded_links;
+ok is_ref($tl, "HASH"), "threaded_links well formed";
+ok !(grep { !/\A$zname_rx\z/ } keys %$tl), "threaded_links well formed";
+ok !(grep { !(is_string($_) && /\A$zname_rx\z/) } values %$tl), "threaded_links well formed";
+is_deeply [ sort keys %$tl ], [ sort keys %$ln ], "threaded_links keys match link_names";
+ok !(grep { !exists($cn->{$_}) } values %$tl), "threaded_links refer to canonical zones";
+
+my $cs = $ld->country_selection;
+ok is_ref($cs, "HASH"), "country_selection well formed";
+ok keys(%$cs) >= 100, "at least 100 countries";
+my $failures = 0;
+foreach(keys %$cs) {
+ /\A[A-Z]{2}\z/ or $failures++;
+ my $cnt = $cs->{$_};
+ is_ref($cnt, "HASH") or $failures++;
+ is_string($cnt->{alpha2_code}) or $failures++;
+ $cnt->{alpha2_code} eq $_ or $failures++;
+ is_string($cnt->{olson_name}) or $failures++;
+ my $regs = $cnt->{regions};
+ is_ref($regs, "HASH") or $failures++;
+ scalar(keys %$regs) != 0 or $failures++;
+ (scalar(keys %$regs) != 1 xor exists($regs->{""})) or $failures++;
+ foreach(keys %$regs) {
+ my $reg = $regs->{$_};
+ is_string($reg->{olson_description}) or $failures++;
+ $reg->{olson_description} eq $_ or $failures++;
+ is_string($reg->{timezone_name}) or $failures++;
+ exists $an->{$reg->{timezone_name}} or $failures++;
+ is_string($reg->{location_coords}) or $failures++;
+ is_string($reg->{location_coords}) or $failures++;
+ }
+}
+is $failures, 0, "country_selection well formed";
+
+my $df = $ld->data_files;
+ok is_ref($df, "ARRAY"), "data_files well formed";
+ok @$df >= 1, "at least one data file";
+ok !(grep { !(is_string($_) && m#\A/#) } @$df), "data_files well formed";
+ok !(grep { !m#\A\Q$dir\E/[A-Za-z0-9\-\+_]{1,14}\z# } @$df), "data files in right place";
+my $zx = $ld->zic_exe;
+ok is_string($zx), "zic_exe well formed";
+like $zx, qr#\A/#, "zic_exe well formed";
+is $zx, "$dir/zic", "zic executable in right place";
+ok(-f $zx, "zic executable exists");
+
+my $zd = $ld->zoneinfo_dir;
+ok is_string($zd), "zoneinfo_dir well formed";
+like $zd, qr#\A/#, "zoneinfo_dir well formed";
+like $zd, qr#\A\Q$dir\E/#, "zoneinfo dir in right place";
+ok !(grep { !(-f "$zd/$_") } keys %$cn), "zoneinfo files exist";
+
+1;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libtime-olsontz-download-perl.git
More information about the Pkg-perl-cvs-commits
mailing list