From c7c272c58fcbcf33d252e4af0adbf26b933b7fb0 Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Thu, 4 Feb 2021 19:35:39 +0000 Subject: [PATCH 1/8] hurrah, it's no longer 2020 --- CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 28efc5f..9110491 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -2020-02-04 3.7001 Data from OFCOM/CNAC/NPA/localcallingguide.com squirreled +2021-02-04 3.7001 Data from OFCOM/CNAC/NPA/localcallingguide.com squirreled away during builds for greater reproducibility; Data updates From 4382a44a3e5a4f1edb588cf8e7faad52aab942bb Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Wed, 24 Feb 2021 13:55:20 +0000 Subject: [PATCH 2/8] apparently the tests now run as a different user on Mac OS --- .cirrus.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 257c1aa..b5c4fdb 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -27,16 +27,16 @@ task: image: catalina-xcode-12.0 test_script: - echo|cpan App::cpanminus - - export PERL5LIB=/Users/anka/perl5/lib/perl5 - - /Users/anka/perl5/bin/cpanm --quiet --notest File::ShareDir::Install - - /Users/anka/perl5/bin/cpanm --quiet --notest XML::XPath - - /Users/anka/perl5/bin/cpanm --quiet --notest DBM::Deep - - /Users/anka/perl5/bin/cpanm --quiet --notest Digest::MD5 - - /Users/anka/perl5/bin/cpanm --quiet --notest File::Find::Rule - - /Users/anka/perl5/bin/cpanm --quiet --notest Spreadsheet::XLSX - - /Users/anka/perl5/bin/cpanm --quiet --notest Text::CSV_XS - - /Users/anka/perl5/bin/cpanm --quiet --notest LWP::Protocol::https - - /Users/anka/perl5/bin/cpanm --installdeps . + - export PERL5LIB=/Users/admin/perl5/lib/perl5 + - /Users/admin/perl5/bin/cpanm --quiet --notest File::ShareDir::Install + - /Users/admin/perl5/bin/cpanm --quiet --notest XML::XPath + - /Users/admin/perl5/bin/cpanm --quiet --notest DBM::Deep + - /Users/admin/perl5/bin/cpanm --quiet --notest Digest::MD5 + - /Users/admin/perl5/bin/cpanm --quiet --notest File::Find::Rule + - /Users/admin/perl5/bin/cpanm --quiet --notest Spreadsheet::XLSX + - /Users/admin/perl5/bin/cpanm --quiet --notest Text::CSV_XS + - /Users/admin/perl5/bin/cpanm --quiet --notest LWP::Protocol::https + - /Users/admin/perl5/bin/cpanm --installdeps . - ./build-data.sh - perl Makefile.PL - make From 0b31bc82da1d8d126922ceab9f52e113eb7a9d7a Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Wed, 24 Feb 2021 17:34:36 +0000 Subject: [PATCH 3/8] Canadian data moved; updated Caribbean data --- build-data.sh | 2 +- t/inc/common-nanp_and_libphonenumber_tests.pl | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build-data.sh b/build-data.sh index 241dd70..2506383 100755 --- a/build-data.sh +++ b/build-data.sh @@ -98,7 +98,7 @@ echo $LIBPHONENUMBERTAG > .libphonenumber-tag http://static.ofcom.org.uk/static/numbering/S8.xlsx \ http://static.ofcom.org.uk/static/numbering/S9.xlsx \ https://www.nationalpooling.com/reports/region/AllBlocksAugmentedReport.zip \ - http://www.cnac.ca/data/COCodeStatus_ALL.zip; + https://cnac.ca/data/COCodeStatus_ALL.zip; do # make sure that there's a file that curl -z can look at if test ! -e `basename $i`; then diff --git a/t/inc/common-nanp_and_libphonenumber_tests.pl b/t/inc/common-nanp_and_libphonenumber_tests.pl index dc7d082..ec55283 100644 --- a/t/inc/common-nanp_and_libphonenumber_tests.pl +++ b/t/inc/common-nanp_and_libphonenumber_tests.pl @@ -135,11 +135,11 @@ ['+1 242 225 0000' => 'BAHAMAS TELECOMMUNICATIONS CORP.'], ['+1 246 220 0000' => 'CABLE & WIRELESS BARBADOS'], ['+1 264 222 0000' => 'CABLE & WIRELESS - ANGUILLA'], - ['+1 268 222 0000' => 'CABLE & WIRELESS - ANTIGUA'], + ['+1 268 268 0000' => 'CABLE & WIRELESS - ANTIGUA'], ['+1 284 229 0000' => 'CABLE & WIRELESS - TORTOLA'], ['+1 340 774 5666' => 'VIRGIN ISLANDS TEL. CORP. DBA INNOVATIVE TELEPHONE'], ['+1 345 222 0000' => 'CABLE & WIRELESS - CAYMAN ISLANDS'], - ['+1 441 222 0000' => 'Bermuda Cablevision Ltd'], + ['+1 441 222 0000' => 'BERMUDA CABLEVISION LIMITED - BM'], ['+1 473 230 0000' => 'COLUMBUS COMMUNICATIONS (GRENADA) LIMITED'], ['+1 649 231 0000' => 'CABLE & WIRELESS - TURKS & CAICOS'], # No data yet. @@ -151,7 +151,7 @@ ['+1 670 233 0000' => 'MICRONESIAN TELECOMMUNICATIONS CORP.'], ['+1 671 472 7679' => 'TELEGUAM HOLDINGS, LLC'], ['+1 684 248 0000' => 'AST TELECOM, LLC - AS'], - ['+1 721 510 0000' => 'UTS RADCOMM'], + ['+1 721 547 0000' => 'ST. MAARTEN TELEPHONE COMPANY, NV'], ['+1 758 234 0000' => 'CABLE & WIRELESS - ST. LUCIA, LTD'], ['+1 767 221 0000' => 'DIGICEL (GRENADA) LIMITED'], ['+1 784 266 0000' => 'CABLE & WIRELESS - ST. VINCENT'], @@ -159,7 +159,7 @@ ['+1 809 202 0000' => 'ECONOMITEL, C. POR A. - DR'], ['+1 829 201 0000' => 'CODETEL'], ['+1 849 201 0000' => 'CODETEL'], - ['+1 868 201 0000' => 'Open Telecom Ltd'], + ['+1 868 215 0000' => 'COLUMBUS COMMUNICATIONS TRINIDAD LIMITED'], ['+1 869 212 0000' => 'ST KITTS NEVIS TELEPHONE - NEVIS'], ['+1 876 202 0000' => 'JAMAICA TELEPHONE CO.'], ['+1 939 201 0000' => 'AT&T, INC. - PR'], From 437c7de08574a6e022829b6768fe78b6b29e27b3 Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Tue, 9 Mar 2021 18:40:39 +0000 Subject: [PATCH 4/8] update tests to match pointless change in source data --- t/inc/common-nanp_and_libphonenumber_tests.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/inc/common-nanp_and_libphonenumber_tests.pl b/t/inc/common-nanp_and_libphonenumber_tests.pl index ec55283..991496b 100644 --- a/t/inc/common-nanp_and_libphonenumber_tests.pl +++ b/t/inc/common-nanp_and_libphonenumber_tests.pl @@ -127,7 +127,7 @@ skip_if_libphonenumber("Stubs don't support operator", 1, sub { is($CLASS->new('+1 416 392 2489')->operator(), 'Bell Canada', "Canada"); - is($CLASS->new('+1 216 208 0000')->operator(), 'ONVOY, LLC - OH', + is($CLASS->new('+1 216 208 0000')->operator(), 'ONVOY LLC - OH', "Unicode en-dash in some US data converted to hyphen"); my @codes_seen = (); From a3163ba00c8867e59da8d81697148863a26d6f17 Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Tue, 9 Mar 2021 18:41:19 +0000 Subject: [PATCH 5/8] book-keeping for release --- CHANGELOG | 2 ++ lib/Number/Phone.pm | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 9110491..44e48b0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +2021-03-09 3.7002 Data updates + 2021-02-04 3.7001 Data from OFCOM/CNAC/NPA/localcallingguide.com squirreled away during builds for greater reproducibility; Data updates diff --git a/lib/Number/Phone.pm b/lib/Number/Phone.pm index aebf789..0712de1 100644 --- a/lib/Number/Phone.pm +++ b/lib/Number/Phone.pm @@ -14,7 +14,7 @@ use Number::Phone::Data; use Number::Phone::StubCountry; # MUST be in format N.NNNN, see https://github.com/DrHyde/perl-modules-Number-Phone/issues/58 -our $VERSION = '3.7001'; +our $VERSION = '3.7002'; my $NOSTUBS = 0; sub import { From 73f08e512950c86690f899af628e44b1684cf5ed Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Tue, 9 Mar 2021 19:27:11 +0000 Subject: [PATCH 6/8] remove unneeded imports --- build-data.country-mapping | 1 - build-data.nanp | 1 - build-data.uk | 4 ---- build-tests.pl | 1 - 4 files changed, 7 deletions(-) diff --git a/build-data.country-mapping b/build-data.country-mapping index da00681..94c9053 100644 --- a/build-data.country-mapping +++ b/build-data.country-mapping @@ -6,7 +6,6 @@ use strict; use warnings; -use Data::Dumper; local $Data::Dumper::Indent = 2; # use lib 'lib'; # use Number::Phone::NANP::Data; diff --git a/build-data.nanp b/build-data.nanp index c6490dc..32da446 100644 --- a/build-data.nanp +++ b/build-data.nanp @@ -9,7 +9,6 @@ use warnings; use LWP::UserAgent; use XML::XPath; use Text::CSV_XS; -use Data::Dumper;local $Data::Dumper::Indent = 1; use lib 'lib'; use Number::Phone::Country qw(noexport); diff --git a/build-data.uk b/build-data.uk index f740a94..01b96e4 100644 --- a/build-data.uk +++ b/build-data.uk @@ -5,7 +5,6 @@ use warnings; use DBM::Deep; use Digest::MD5 'md5_base64'; -use Data::Dumper; use File::Find::Rule; use Spreadsheet::XLSX; use Text::CSV_XS; @@ -31,9 +30,6 @@ foreach my $xlsfile (File::Find::Rule->name('*.xlsx')->in('data-files')) { print "Working on $xlsfile\n"; my $parser = Spreadsheet::XLSX->new($xlsfile); - # use Data::Dumper; local $Data::Dumper::Indent = 1; - # die(Dumper($parser)); - my $worksheet = $parser->{Worksheet}->[0]; my ( $row_min, $row_max ) = $worksheet->row_range(); my ( $col_min, $col_max ) = $worksheet->col_range(); diff --git a/build-tests.pl b/build-tests.pl index f3f28d2..07988fd 100644 --- a/build-tests.pl +++ b/build-tests.pl @@ -6,7 +6,6 @@ use strict; use warnings; -use Data::Dumper; local $Data::Dumper::Indent = 2; use XML::XPath; $| = 1; From f71372132549eb2e6b45f4b7b6d0ba0a907c7869 Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Tue, 9 Mar 2021 19:27:43 +0000 Subject: [PATCH 7/8] tidy up Dumper output in Github install workflows --- .github/workflows/linux-normal-build.yml | 4 ++-- .github/workflows/linux-without_uk-build.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linux-normal-build.yml b/.github/workflows/linux-normal-build.yml index 03cb660..cc26380 100644 --- a/.github/workflows/linux-normal-build.yml +++ b/.github/workflows/linux-normal-build.yml @@ -23,10 +23,10 @@ jobs: perl -v perl -MData::Dumper -e 'eval "use Number::Phone"; if(!$@) { print "Number::Phone is already installed, argh\n".Dumper(\%INC); exit(1) } else { print "Number::Phone not yet installed, hurrah\n"; exit(0) }' cpanm --quiet --notest ExtUtils::MakeMaker Test::Pod Test::Pod::Coverage parent - cpanm --quiet --notest File::ShareDir::Install XML::XPath DBM::Deep Digest::MD5 File::Find::Rule Spreadsheet::XLSX Text::CSV_XS LWP::Protocol::https + cpanm --quiet --notest Data::Dumper::Concise File::ShareDir::Install XML::XPath DBM::Deep Digest::MD5 File::Find::Rule Spreadsheet::XLSX Text::CSV_XS LWP::Protocol::https cpanm --quiet --notest --installdeps . ./build-data.sh perl Makefile.PL make test TEST_VERBOSE=1 make install - perl -MData::Dumper -MNumber::Phone -e 'if(Number::Phone->new("+447979866975")->operator() =~ /vodafone/i) { print "N::P::UK built/installed correctly\n".Dumper(\%INC); exit(0) } else { print "N::P::UK build/install failed\n"; exit(1) }' + perl -MData::Dumper::Concise -MNumber::Phone -e 'if(Number::Phone->new("+447979866975")->operator() =~ /vodafone/i) { print "N::P::UK built/installed correctly\n".Dumper(\%INC); exit(0) } else { print "N::P::UK build/install failed\n"; exit(1) }' diff --git a/.github/workflows/linux-without_uk-build.yml b/.github/workflows/linux-without_uk-build.yml index 7f1c279..b3f2e1f 100644 --- a/.github/workflows/linux-without_uk-build.yml +++ b/.github/workflows/linux-without_uk-build.yml @@ -23,10 +23,10 @@ jobs: perl -v perl -MData::Dumper -e 'eval "use Number::Phone"; if(!$@) { print "Number::Phone is already installed, argh\n".Dumper(\%INC); exit(1) } else { print "Number::Phone not yet installed, hurrah\n"; exit(0) }' cpanm --quiet --notest ExtUtils::MakeMaker Test::Pod Test::Pod::Coverage parent - cpanm --quiet --notest File::ShareDir::Install XML::XPath DBM::Deep Digest::MD5 File::Find::Rule Spreadsheet::XLSX Text::CSV_XS LWP::Protocol::https + cpanm --quiet --notest Data::Dumper::Concise File::ShareDir::Install XML::XPath DBM::Deep Digest::MD5 File::Find::Rule Spreadsheet::XLSX Text::CSV_XS LWP::Protocol::https cpanm --quiet --notest --installdeps . ./build-data.sh perl Makefile.PL --without_uk make test TEST_VERBOSE=1 make install - perl -MData::Dumper -MNumber::Phone -e 'if(Number::Phone->new("+447979866975")->isa("Number::Phone::StubCountry::GB")) { print "N::P built/installed correctly without N::P::UK\n".Dumper(\%INC); exit(0) } else { print "N::P build/install failed\n"; exit(1) }' + perl -MData::Dumper::Concise -MNumber::Phone -e 'if(Number::Phone->new("+447979866975")->isa("Number::Phone::StubCountry::GB")) { print "N::P built/installed correctly without N::P::UK\n".Dumper(\%INC); exit(0) } else { print "N::P build/install failed\n"; exit(1) }' From 62210a8df4ab45d6cbbb0104a830d2d495933db5 Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Thu, 8 Apr 2021 22:13:55 +0100 Subject: [PATCH 8/8] deprecate 32-bit perl in preparation for switch to Data::CompactReadonly database --- CHANGELOG | 4 ++++ Makefile.PL | 2 ++ lib/Number/Phone.pm | 6 ++++++ t/deprecations.t | 17 +++++++++++++++++ 4 files changed, 29 insertions(+) create mode 100644 t/deprecations.t diff --git a/CHANGELOG b/CHANGELOG index 44e48b0..55487e0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +XXXX-XX-XX XXXXXX Data updates; + Add deprecation warning for platforms with 32 bit int (support will + go away some time after 2023-06-01 with no further warning) + 2021-03-09 3.7002 Data updates 2021-02-04 3.7001 Data from OFCOM/CNAC/NPA/localcallingguide.com squirreled diff --git a/Makefile.PL b/Makefile.PL index ddc3d25..53a8c69 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -49,6 +49,7 @@ WriteMakefile( PREREQ_PM => { 'Cwd' => 0, 'DBM::Deep' => 2.0008, + 'Data::Dumper::Concise' => 0, 'Devel::CheckOS' => '1.83', 'Digest::MD5' => 0, 'File::Basename' => 0, @@ -61,6 +62,7 @@ WriteMakefile( 'Test::Differences' => 0.62, 'Test::More' => '0.96', # need done_testing (0.88) and subtests (0.95_01) 'Test::utf8' => 0, + 'Test::Warnings' => 0, }, dist => { PREOP => "./build-data.sh --previouslibphonenumbertag" diff --git a/lib/Number/Phone.pm b/lib/Number/Phone.pm index 0712de1..c643c13 100644 --- a/lib/Number/Phone.pm +++ b/lib/Number/Phone.pm @@ -25,6 +25,10 @@ sub import { } } +if(~0 == 4294967295) { + warn("Your perl only supports 32 bit ints; Number::Phone will require 64 bit ints from some time after 2023-06-01"); +} + sub _find_data_file { my $wanted = shift; @@ -201,6 +205,8 @@ As of version 3.6000 the C method pays attention to your locale settings and so you might start getting locale-appropriate versions of areanames instead of what you used to get. +64 bit ints will be required some time after 2023-06-01. + =head1 COMPATIBILTY WITH libphonenumber libphonenumber is a similar project for other languages, maintained diff --git a/t/deprecations.t b/t/deprecations.t new file mode 100644 index 0000000..b125ec1 --- /dev/null +++ b/t/deprecations.t @@ -0,0 +1,17 @@ +use strict; +use warnings; + +use Data::Dumper::Concise; +use Test::More; +use Test::Warnings qw(warning); + +if(~0 == 4294967295) { + my $warning = warning { use_ok 'Number::Phone' }; + like( + $warning, + qr/32 bit/, + "warned about 32 bit support going away" + ) || diag(Dumper($warning)); +} + +done_testing();