aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2019-09-11 14:37:23 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2019-09-11 14:41:48 +0300
commitda90b094e7973bc4b7dedcd5cad086dc1d7a8fee (patch)
treef19efa8c78e2c4a0ee6cf6e37d1a55f24c7919bf
parentadf16c29939378f3eaa716239da53bb7e3ef6283 (diff)
downloadacmeman-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--Changes4
-rw-r--r--Makefile.PL3
-rw-r--r--lib/App/Acmeman.pm44
-rw-r--r--lib/App/Acmeman/Source/Apache.pm3
-rw-r--r--lib/App/Acmeman/Source/File.pm4
5 files changed, 35 insertions, 23 deletions
diff --git a/Changes b/Changes
index 1c25821..dcf480c 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,7 @@
12.01 2019-09-11
2 - Fix the "file" source (inverted logic was assumed)
3 - Implement the --version option.
4
12.00 2019-08-26 52.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);
16use Sys::Hostname; 16use Sys::Hostname;
17use Pod::Usage; 17use Pod::Usage;
18use Pod::Man; 18use Pod::Man;
19use Getopt::Long qw(:config gnu_getopt no_ignore_case auto_version); 19use Getopt::Long qw(:config gnu_getopt no_ignore_case);
20use POSIX qw(strftime time floor); 20use POSIX qw(strftime time floor);
21use App::Acmeman::Config; 21use App::Acmeman::Config;
22use App::Acmeman::Domain qw(:files); 22use App::Acmeman::Domain qw(:files);
@@ -25,7 +25,7 @@ use Text::ParseWords;
25use App::Acmeman::Log qw(:all :sysexits); 25use App::Acmeman::Log qw(:all :sysexits);
26use feature 'state'; 26use feature 'state';
27 27
28our $VERSION = '2.00'; 28our $VERSION = '2.01';
29 29
30my $progdescr = "manages ACME certificates"; 30my $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} }
31sub scan { 31sub 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}

Return to:

Send suggestions and report system problems to the System administrator.