aboutsummaryrefslogtreecommitdiff
path: root/lib
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 /lib
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.
Diffstat (limited to 'lib')
-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
3 files changed, 29 insertions, 22 deletions
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);
use Sys::Hostname;
use Pod::Usage;
use Pod::Man;
-use Getopt::Long qw(:config gnu_getopt no_ignore_case auto_version);
+use Getopt::Long qw(:config gnu_getopt no_ignore_case);
use POSIX qw(strftime time floor);
use App::Acmeman::Config;
use App::Acmeman::Domain qw(:files);
@@ -25,7 +25,7 @@ use Text::ParseWords;
use App::Acmeman::Log qw(:all :sysexits);
use feature 'state';
-our $VERSION = '2.00';
+our $VERSION = '2.01';
my $progdescr = "manages ACME certificates";
@@ -46,24 +46,28 @@ sub new {
_domains => []
}, $class;
GetOptions(
- "h" => sub {
- pod2usage(-message => "$self->{_progname}: $progdescr",
- -exitstatus => EX_OK);
- },
- "help" => sub {
- pod2usage(-exitstatus => EX_OK, -verbose => 2);
- },
- "usage" => sub {
- pod2usage(-exitstatus => EX_OK, -verbose => 0);
- },
- "debug|d+" => \$self->{_option}{debug},
- "dry-run|n" => \$self->{_option}{dry_run},
- "stage|s" => sub { $self->{_acme_host} = 'staging' },
- "force|F" => \$self->{_option}{force},
- "time-delta|D=n" => \$self->{_option}{time_delta},
- "setup|S" => sub { $self->{_command} = 'setup' },
- "alt-names|a" => \$self->{_option}{check_alt_names},
- "config-file|f=s" => \$self->{_option}{config_file},
+ 'h' => sub {
+ pod2usage(-message => "$self->{_progname}: $progdescr",
+ -exitstatus => EX_OK);
+ },
+ 'help' => sub {
+ pod2usage(-exitstatus => EX_OK, -verbose => 2);
+ },
+ 'usage' => sub {
+ pod2usage(-exitstatus => EX_OK, -verbose => 0);
+ },
+ 'debug|d+' => \$self->{_option}{debug},
+ 'dry-run|n' => \$self->{_option}{dry_run},
+ 'stage|s' => sub { $self->{_acme_host} = 'staging' },
+ 'force|F' => \$self->{_option}{force},
+ 'time-delta|D=n' => \$self->{_option}{time_delta},
+ 'setup|S' => sub { $self->{_command} = 'setup' },
+ 'alt-names|a' => \$self->{_option}{check_alt_names},
+ 'config-file|f=s' => \$self->{_option}{config_file},
+ 'version' => sub {
+ print "$0 version $VERSION\n";
+ exit(EX_OK)
+ }
) or exit(EX_USAGE);
++$self->{_option}{debug} if $self->dry_run_option;
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} }
sub scan {
my ($self) = @_;
debug(2, 'assuming Apache layout "'.$self->layout->name.'"');
- $self->set(qw(core postrenew), $self->layout->restart_command);
+ $self->set(qw(core postrenew), $self->layout->restart_command)
+ unless $self->cfg->is_set(qw(core postrenew));
return $self->examine_http_config($self->layout->config_file);
}
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 {
}
foreach my $file (glob $self->{pattern}) {
next if $file =~ m{$self->{ignore}};
- $err |= $self->load($file);
+ unless ($self->load($file)) {
+ ++$err;
+ }
}
return $err == 0;
}

Return to:

Send suggestions and report system problems to the System administrator.