diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2019-09-11 14:37:23 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2019-09-11 14:41:48 +0300 |
commit | da90b094e7973bc4b7dedcd5cad086dc1d7a8fee (patch) | |
tree | f19efa8c78e2c4a0ee6cf6e37d1a55f24c7919bf | |
parent | adf16c29939378f3eaa716239da53bb7e3ef6283 (diff) | |
download | acmeman-da90b094e7973bc4b7dedcd5cad086dc1d7a8fee.tar.gz acmeman-da90b094e7973bc4b7dedcd5cad086dc1d7a8fee.tar.bz2 |
Bugfixes.v2.01
* Changes: Update
* Makefile.PL: Require Config::Parser.
* lib/App/Acmeman.pm: Implement the --version option.
* lib/App/Acmeman/Source/Apache.pm (scan): Set core.postrenew
from layout, if it is not set explicitly.
* lib/App/Acmeman/Source/File.pm (scan): Fix inverted logic (load
returns false on error.
-rw-r--r-- | Changes | 4 | ||||
-rw-r--r-- | Makefile.PL | 3 | ||||
-rw-r--r-- | lib/App/Acmeman.pm | 44 | ||||
-rw-r--r-- | lib/App/Acmeman/Source/Apache.pm | 3 | ||||
-rw-r--r-- | lib/App/Acmeman/Source/File.pm | 4 |
5 files changed, 35 insertions, 23 deletions
@@ -1,3 +1,7 @@ | |||
1 | 2.01 2019-09-11 | ||
2 | - Fix the "file" source (inverted logic was assumed) | ||
3 | - Implement the --version option. | ||
4 | |||
1 | 2.00 2019-08-26 | 5 | 2.00 2019-08-26 |
2 | 6 | ||
3 | - Released on CPAN | 7 | - Released on CPAN |
diff --git a/Makefile.PL b/Makefile.PL index 0d093a8..f7195d4 100644 --- a/Makefile.PL +++ b/Makefile.PL | |||
@@ -33,7 +33,8 @@ my %makefile_args = ( | |||
33 | 'Socket' => 0, | 33 | 'Socket' => 0, |
34 | 'Sys::Hostname' => 1.16, | 34 | 'Sys::Hostname' => 1.16, |
35 | 'Apache::Defaults' => 1.02, | 35 | 'Apache::Defaults' => 1.02, |
36 | 'Apache::Config::Preproc' => 1.03 | 36 | 'Apache::Config::Preproc' => 1.03, |
37 | 'Config::Parser' => 1.03 | ||
37 | }, | 38 | }, |
38 | MIN_PERL_VERSION => 5.016001, | 39 | MIN_PERL_VERSION => 5.016001, |
39 | META_MERGE => { | 40 | META_MERGE => { |
diff --git a/lib/App/Acmeman.pm b/lib/App/Acmeman.pm index 8f253b2..99d018a 100644 --- a/lib/App/Acmeman.pm +++ b/lib/App/Acmeman.pm | |||
@@ -16,7 +16,7 @@ use Socket qw(inet_ntoa); | |||
16 | use Sys::Hostname; | 16 | use Sys::Hostname; |
17 | use Pod::Usage; | 17 | use Pod::Usage; |
18 | use Pod::Man; | 18 | use Pod::Man; |
19 | use Getopt::Long qw(:config gnu_getopt no_ignore_case auto_version); | 19 | use Getopt::Long qw(:config gnu_getopt no_ignore_case); |
20 | use POSIX qw(strftime time floor); | 20 | use POSIX qw(strftime time floor); |
21 | use App::Acmeman::Config; | 21 | use App::Acmeman::Config; |
22 | use App::Acmeman::Domain qw(:files); | 22 | use App::Acmeman::Domain qw(:files); |
@@ -25,7 +25,7 @@ use Text::ParseWords; | |||
25 | use App::Acmeman::Log qw(:all :sysexits); | 25 | use App::Acmeman::Log qw(:all :sysexits); |
26 | use feature 'state'; | 26 | use feature 'state'; |
27 | 27 | ||
28 | our $VERSION = '2.00'; | 28 | our $VERSION = '2.01'; |
29 | 29 | ||
30 | my $progdescr = "manages ACME certificates"; | 30 | my $progdescr = "manages ACME certificates"; |
31 | 31 | ||
@@ -46,24 +46,28 @@ sub new { | |||
46 | _domains => [] | 46 | _domains => [] |
47 | }, $class; | 47 | }, $class; |
48 | GetOptions( | 48 | GetOptions( |
49 | "h" => sub { | 49 | 'h' => sub { |
50 | pod2usage(-message => "$self->{_progname}: $progdescr", | 50 | pod2usage(-message => "$self->{_progname}: $progdescr", |
51 | -exitstatus => EX_OK); | 51 | -exitstatus => EX_OK); |
52 | }, | 52 | }, |
53 | "help" => sub { | 53 | 'help' => sub { |
54 | pod2usage(-exitstatus => EX_OK, -verbose => 2); | 54 | pod2usage(-exitstatus => EX_OK, -verbose => 2); |
55 | }, | 55 | }, |
56 | "usage" => sub { | 56 | 'usage' => sub { |
57 | pod2usage(-exitstatus => EX_OK, -verbose => 0); | 57 | pod2usage(-exitstatus => EX_OK, -verbose => 0); |
58 | }, | 58 | }, |
59 | "debug|d+" => \$self->{_option}{debug}, | 59 | 'debug|d+' => \$self->{_option}{debug}, |
60 | "dry-run|n" => \$self->{_option}{dry_run}, | 60 | 'dry-run|n' => \$self->{_option}{dry_run}, |
61 | "stage|s" => sub { $self->{_acme_host} = 'staging' }, | 61 | 'stage|s' => sub { $self->{_acme_host} = 'staging' }, |
62 | "force|F" => \$self->{_option}{force}, | 62 | 'force|F' => \$self->{_option}{force}, |
63 | "time-delta|D=n" => \$self->{_option}{time_delta}, | 63 | 'time-delta|D=n' => \$self->{_option}{time_delta}, |
64 | "setup|S" => sub { $self->{_command} = 'setup' }, | 64 | 'setup|S' => sub { $self->{_command} = 'setup' }, |
65 | "alt-names|a" => \$self->{_option}{check_alt_names}, | 65 | 'alt-names|a' => \$self->{_option}{check_alt_names}, |
66 | "config-file|f=s" => \$self->{_option}{config_file}, | 66 | 'config-file|f=s' => \$self->{_option}{config_file}, |
67 | 'version' => sub { | ||
68 | print "$0 version $VERSION\n"; | ||
69 | exit(EX_OK) | ||
70 | } | ||
67 | ) or exit(EX_USAGE); | 71 | ) or exit(EX_USAGE); |
68 | ++$self->{_option}{debug} if $self->dry_run_option; | 72 | ++$self->{_option}{debug} if $self->dry_run_option; |
69 | debug_level($self->{_option}{debug}); | 73 | debug_level($self->{_option}{debug}); |
diff --git a/lib/App/Acmeman/Source/Apache.pm b/lib/App/Acmeman/Source/Apache.pm index 042956a..ae9c342 100644 --- a/lib/App/Acmeman/Source/Apache.pm +++ b/lib/App/Acmeman/Source/Apache.pm | |||
@@ -31,7 +31,8 @@ sub layout { shift->{_layout} } | |||
31 | sub scan { | 31 | sub scan { |
32 | my ($self) = @_; | 32 | my ($self) = @_; |
33 | debug(2, 'assuming Apache layout "'.$self->layout->name.'"'); | 33 | debug(2, 'assuming Apache layout "'.$self->layout->name.'"'); |
34 | $self->set(qw(core postrenew), $self->layout->restart_command); | 34 | $self->set(qw(core postrenew), $self->layout->restart_command) |
35 | unless $self->cfg->is_set(qw(core postrenew)); | ||
35 | return $self->examine_http_config($self->layout->config_file); | 36 | return $self->examine_http_config($self->layout->config_file); |
36 | } | 37 | } |
37 | 38 | ||
diff --git a/lib/App/Acmeman/Source/File.pm b/lib/App/Acmeman/Source/File.pm index c622d51..aa678fd 100644 --- a/lib/App/Acmeman/Source/File.pm +++ b/lib/App/Acmeman/Source/File.pm | |||
@@ -36,7 +36,9 @@ sub scan { | |||
36 | } | 36 | } |
37 | foreach my $file (glob $self->{pattern}) { | 37 | foreach my $file (glob $self->{pattern}) { |
38 | next if $file =~ m{$self->{ignore}}; | 38 | next if $file =~ m{$self->{ignore}}; |
39 | $err |= $self->load($file); | 39 | unless ($self->load($file)) { |
40 | ++$err; | ||
41 | } | ||
40 | } | 42 | } |
41 | return $err == 0; | 43 | return $err == 0; |
42 | } | 44 | } |