diff --git a/.travis.yml b/.travis.yml index f09e930b..1c69802d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,14 +3,14 @@ dist: jammy language: perl perl: - - "5.36" - - "5.30" + - "5.38" + - "5.34" - "5.26" addons: apt: packages: - # From Zonemaster Engine installation instruction + # From Zonemaster Engine installation instruction for Ubuntu - autoconf - automake - build-essential @@ -38,8 +38,10 @@ addons: - libtext-csv-perl - libtool - m4 - # From Zonemaster CLI installation instruction - - libtext-reflow-perl + # From Zonemaster CLI installation instruction for Ubuntu + # libmoosex-getopt-perl, see cpan-install below + # libmodule-install-perl, see cpan-install below + - libtry-tiny-perl before_install: # Help Perl find modules installed from OS packages diff --git a/Changes b/Changes index c300b29d..9d3268ea 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,22 @@ Release history for Zonemaster component Zonemaster-CLI +v7.0.0 2024-07-01 (part of Zonemaster v2024.1 release) + + [Release information] + - Translations have not been fully updated in this release. They will + be updated in an upcoming release. + + [Breaking change] + - Removes deprecated '--sourceaddr' option. Breaks custom 'cli.args' + using this option. Use '--sourceaddr4' and '--sourceaddr6' + instead. (#370) + + [Fixes] + - Fixes command line argument handling of domain names (#365) + - Speeds up Docker build (#374) + + v6.1.0 2024-03-18 (public release version) [Features] diff --git a/Dockerfile b/Dockerfile index f4bedb56..029cc837 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,26 @@ FROM zonemaster/engine:local as build RUN apk add --no-cache \ - # Only needed for Net::Interface build-base \ + make \ + perl-app-cpanminus \ + perl-cpan-meta-check \ + perl-data-dump \ perl-dev \ perl-doc \ + perl-json-xs \ perl-lwp-protocol-https \ - make \ - # Compile-time dependencies - perl-app-cpanminus \ + perl-module-build \ + perl-module-build-tiny \ perl-module-install \ + perl-moose \ + perl-namespace-autoclean \ + perl-params-validate \ + perl-path-tiny \ + perl-test-deep \ + perl-test-needs \ && cpanm --no-wget --from https://cpan.metacpan.org/ \ - MooseX::Getopt \ - Text::Reflow + MooseX::Getopt ARG version @@ -23,6 +31,12 @@ RUN cpanm --no-wget \ FROM zonemaster/engine:local +RUN apk add --no-cache \ + perl-namespace-autoclean \ + perl-params-validate \ + perl-json-xs \ + perl-moose + COPY --from=build /usr/local/bin/zonemaster-cli /usr/local/bin/zonemaster-cli # Include all the Perl modules we built COPY --from=build /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/site_perl diff --git a/Makefile.PL b/Makefile.PL index 30381d3f..e4da4f56 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -23,10 +23,9 @@ requires( 'JSON::XS' => 0, 'Locale::TextDomain' => 1.23, 'MooseX::Getopt' => 0, - 'Text::Reflow' => 0, 'Try::Tiny' => 0, - 'Zonemaster::LDNS' => 4.000000, # v4.0.0 - 'Zonemaster::Engine' => 5.000000, # v5.0.0 + 'Zonemaster::LDNS' => 4.000002, # v4.0.2 + 'Zonemaster::Engine' => 6.000000, # v6.0.0 ); # Make all platforms include inc/Module/Install/External.pm diff --git a/lib/Zonemaster/CLI.pm b/lib/Zonemaster/CLI.pm old mode 100755 new mode 100644 index addbb171..989f0082 --- a/lib/Zonemaster/CLI.pm +++ b/lib/Zonemaster/CLI.pm @@ -11,7 +11,7 @@ use 5.014002; use strict; use warnings; -use version; our $VERSION = version->declare( "v6.1.0" ); +use version; our $VERSION = version->declare( "v7.0.0" ); use Locale::TextDomain 'Zonemaster-CLI'; use Moose; @@ -24,8 +24,6 @@ use JSON::XS; use List::Util qw[max uniq]; use POSIX qw[setlocale LC_MESSAGES LC_CTYPE]; use Scalar::Util qw[blessed]; -use Socket qw[AF_INET AF_INET6]; -use Text::Reflow qw[reflow_string]; use Try::Tiny; use Net::IP::XS; @@ -36,7 +34,6 @@ use Zonemaster::Engine::Normalization qw[normalize_name]; use Zonemaster::Engine::Logger::Entry; use Zonemaster::Engine::Translator; use Zonemaster::Engine::Util qw[parse_hints]; -use Zonemaster::Engine::Zone; our %numeric = Zonemaster::Engine::Logger::Entry->levels; our $JSON = JSON::XS->new->allow_blessed->convert_blessed->canonical; @@ -278,26 +275,13 @@ has 'dump_profile' => ( documentation => __( 'Print the effective profile used in JSON format, then exit.' ), ); -has 'sourceaddr' => ( - is => 'ro', - isa => 'Str', - required => 0, - documentation => __( - 'Deprecated (planned removal: v2024.1). ' - . 'Use --sourceaddr4 and/or --sourceaddr6. ' - . 'Source IP address used to send queries. ' - . 'Setting an IP address not correctly configured on a local network interface causes cryptic error messages.' - ), -); - has 'sourceaddr4' => ( is => 'ro', isa => 'Str', required => 0, documentation => __( 'Source IPv4 address used to send queries. ' - . 'Setting an IPv4 address not correctly configured on a local network interface fails silently. ' - . 'Can not be combined with --sourceaddr.' + . 'Setting an IPv4 address not correctly configured on a local network interface fails silently.' ), ); @@ -307,8 +291,7 @@ has 'sourceaddr6' => ( required => 0, documentation => __( 'Source IPv6 address used to send queries. ' - . 'Setting an IPv6 address not correctly configured on a local network interface fails silently. ' - . 'Can not be combined with --sourceaddr.' + . 'Setting an IPv6 address not correctly configured on a local network interface fails silently.' ), ); @@ -356,14 +339,6 @@ sub run { print_test_list(); } - if ( $self->sourceaddr ) { - if ( $self->sourceaddr4 or $self->sourceaddr6 ) { - die __( "Error: --sourceaddr can't be combined with --sourceaddr4 or --sourceaddr6." ) . "\n"; - } - printf STDERR "%s\n\n", __( "Warning: --sourceaddr is deprecated (planned removal: v2024.1). Use --sourceaddr4 and/or --sourceaddr6 instead." ); - Zonemaster::Engine::Profile->effective->set( q{resolver.source}, $self->sourceaddr ); - } - if ( $self->sourceaddr4 ) { Zonemaster::Engine::Profile->effective->set( q{resolver.source4}, $self->sourceaddr4 ); } @@ -631,18 +606,13 @@ sub run { } ); - if ( $self->profile or $self->test ) { - # Separate initialization from main output in human readable output mode - print "\n" if $fh_diag eq *STDOUT; - } - if ( scalar @{ $self->extra_argv } > 1 ) { die __( "Only one domain can be given for testing. Did you forget to prepend an option with '--