diff options
author | Eric Wong <e@80x24.org> | 2021-02-06 12:18:40 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-02-07 03:34:32 +0000 |
commit | cfc2f64069e245a700b60113705be477857c51e5 (patch) | |
tree | bfcf20bdd19357bbd6399798b351e9a5bbe9c97e /lib/PublicInbox/Admin.pm | |
parent | d9bc0993fde567c9098020b8f79995e8ab3b4f0d (diff) | |
download | public-inbox-cfc2f64069e245a700b60113705be477857c51e5.tar.gz |
This can be useful for users who want to clone and mirror an existing public-inbox. This doesn't have update support, yet, so users will need to run "git fetch && public-inbox-index" for now.
Diffstat (limited to 'lib/PublicInbox/Admin.pm')
-rw-r--r-- | lib/PublicInbox/Admin.pm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/PublicInbox/Admin.pm b/lib/PublicInbox/Admin.pm index 3b38a5a3..b21fb241 100644 --- a/lib/PublicInbox/Admin.pm +++ b/lib/PublicInbox/Admin.pm @@ -273,8 +273,8 @@ EOM $idx->{nidx} // 0; # returns number processed } -sub progress_prepare ($) { - my ($opt) = @_; +sub progress_prepare ($;$) { + my ($opt, $dst) = @_; # public-inbox-index defaults to quiet, -xcpdb and -compact do not if (defined($opt->{quiet}) && $opt->{quiet} < 0) { @@ -286,7 +286,8 @@ sub progress_prepare ($) { $opt->{1} = $null; # suitable for spawn() redirect } else { $opt->{verbose} ||= 1; - $opt->{-progress} = sub { print STDERR @_ }; + $dst //= *STDERR{GLOB}; + $opt->{-progress} = sub { print $dst @_ }; } } |