about summary refs log tree commit homepage
path: root/lib/PublicInbox/Admin.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-02-06 12:18:40 +0000
committerEric Wong <e@80x24.org>2021-02-07 03:34:32 +0000
commitcfc2f64069e245a700b60113705be477857c51e5 (patch)
treebfcf20bdd19357bbd6399798b351e9a5bbe9c97e /lib/PublicInbox/Admin.pm
parentd9bc0993fde567c9098020b8f79995e8ab3b4f0d (diff)
downloadpublic-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.pm7
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 @_ };
         }
 }