summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2019-08-15 08:00:27 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2019-08-15 08:00:27 (GMT)
commit35ca6e67bb06663f1c5cf1e4ceefaedf005bae80 (patch) (side-by-side diff)
treee7a9e0c536e112ba4a699755ee208d258b61f0b2
parent32ad59e0a9c7f74c7c094d5091bce435c145fe33 (diff)
downloadacmeman-35ca6e67bb06663f1c5cf1e4ceefaedf005bae80.tar.gz
acmeman-35ca6e67bb06663f1c5cf1e4ceefaedf005bae80.tar.bz2
Fix acmeman --setup
* acmeman: Unset core.source for setup * lib/App/Acmeman/Config.pm (unset): New function.
Diffstat (more/less context) (ignore whitespace changes)
-rwxr-xr-xacmeman1
-rw-r--r--lib/App/Acmeman/Config.pm14
2 files changed, 15 insertions, 0 deletions
diff --git a/acmeman b/acmeman
index f4024f5..fd4ef60 100755
--- a/acmeman
+++ b/acmeman
@@ -1190,6 +1190,7 @@ $config = new App::Acmeman::Config($config_file,
if ($config->success) {
if (my @source = $config->get(qw(core source))) {
+ $config->unset(qw(core source));
foreach my $s (@source) {
my ($name, @args) = quotewords('\s+', 0, $s);
my $pack = 'App::Acmeman::Source::' . ucfirst($name);
diff --git a/lib/App/Acmeman/Config.pm b/lib/App/Acmeman/Config.pm
index f566cb7..99b6aec 100644
--- a/lib/App/Acmeman/Config.pm
+++ b/lib/App/Acmeman/Config.pm
@@ -315,6 +315,20 @@ sub isset {
return defined $self->_getref(@_);
}
+sub unset {
+ my $self = shift;
+ my $last = pop;
+
+ return unless exists $self->{_conf};
+ my $ref = $self->{_conf};
+ for (@_) {
+ carp "component undefined" unless defined $_;
+ return unless exists $ref->{$_};
+ $ref = $ref->{$_};
+ }
+ delete $ref->{$last};
+}
+
sub set {
my $self = shift;
$self->{_conf} = {} unless exists $self->{_conf};

Return to:

Send suggestions and report system problems to the System administrator.