# returns key-value pairs of config directives in a hash
# if keys may be multi-value, the value is an array ref containing all values
sub new {
- my ($class, $file) = @_;
+ my ($class, $file, $errfh) = @_;
$file //= default_file();
my $self;
if (ref($file) eq 'SCALAR') { # used by some tests
$self = config_fh_parse($fh, "\n", '=');
bless $self, $class;
} else {
- $self = git_config_dump($class, $file);
+ $self = git_config_dump($class, $file, $errfh);
$self->{'-f'} = $file;
}
# caches
$cur_st = pack('dd', $st[10], $st[7]);
qerr($self, "# $f created") if $self->{cmd} ne 'config';
}
- my $cfg = PublicInbox::Config->git_config_dump($f);
+ my $cfg = PublicInbox::Config->git_config_dump($f, $self->{2});
$cfg->{-st} = $cur_st;
$cfg->{'-f'} = $f;
if ($sto && canonpath_harder($sto_dir // store_path($self))
}
return $lei->err("# @$cmd failed (non-fatal)") if $cerr;
rename($f, $ce) or return $lei->err("link($f, $ce): $! (non-fatal)");
- my $cfg = PublicInbox::Config->git_config_dump($f);
+ my $cfg = PublicInbox::Config->git_config_dump($f, $lei->{2});
my $ibx = $self->{ibx} = {};
for my $sec (grep(/\Apublicinbox\./, @{$cfg->{-section_order}})) {
for (qw(address newsgroup nntpmirror)) {
}
# force synchronous dwaitpid for v2:
local $PublicInbox::DS::in_loop = 0;
- my $cfg = PublicInbox::Config->new;
+ my $cfg = PublicInbox::Config->new(undef, $lei->{2});
my $env = PublicInbox::Admin::index_prepare($opt, $cfg);
local %ENV = (%ENV, %$env) if $env;
PublicInbox::Admin::progress_prepare($opt, $lei->{2});