[carton] 97/472: fix defaults to not override the one set in local
Lucas Kanashiro
kanashiro-guest at moszumanska.debian.org
Fri Jul 24 00:38:37 UTC 2015
This is an automated email from the git hooks/post-receive script.
kanashiro-guest pushed a commit to branch master
in repository carton.
commit b5528843c2d05213f6f177b39b1857c9e5665bea
Author: Tatsuhiko Miyagawa <miyagawa at bulknews.net>
Date: Fri Jul 1 15:08:21 2011 -0700
fix defaults to not override the one set in local
---
lib/Carton/Config.pm | 5 ++++-
xt/cli/mirror.t | 3 ++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/lib/Carton/Config.pm b/lib/Carton/Config.pm
index aa40391..7c8cf76 100644
--- a/lib/Carton/Config.pm
+++ b/lib/Carton/Config.pm
@@ -25,7 +25,10 @@ sub load_defaults {
for my $default (@defaults) {
my($section, $name, $value) = @$default;
- $self->define(section => $section, name => $name, value => $value, origin => 'module');
+ my $v = $self->get(key => "$section.$name");
+ unless (defined $v) {
+ $self->define(section => $section, name => $name, value => $value, origin => 'module');
+ }
}
$self->loaded_defaults(1);
diff --git a/xt/cli/mirror.t b/xt/cli/mirror.t
index f1e9c72..1a75848 100644
--- a/xt/cli/mirror.t
+++ b/xt/cli/mirror.t
@@ -8,7 +8,8 @@ my $cwd = Cwd::cwd();
{
my $app = cli();
- $app->config->define(section => "cpanm", name => "mirror", value => "$cwd/xt/mirror", origin => __FILE__);
+ $app->run("config", "cpanm.mirror", "$cwd/xt/mirror");
+ $app->run("config", "cpanm.mirror");
$app->run("install", "Hash::MultiValue");
$app->run("list");
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/carton.git
More information about the Pkg-perl-cvs-commits
mailing list