X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=blobdiff_plain;f=script%2Fpublic-inbox-fetch;h=f9bac4e3f582013824b98d98bde60808cbf61d73;hp=5d303574c8b140c0a19fed8522393ffe9f7668c9;hb=4eee5af6011cc8cdefb66c9729952c7eff5c0b0b;hpb=b45a1dffa647f6427d0c900fcc55753db7a1994c diff --git a/script/public-inbox-fetch b/script/public-inbox-fetch index 5d303574..f9bac4e3 100755 --- a/script/public-inbox-fetch +++ b/script/public-inbox-fetch @@ -16,12 +16,15 @@ options: --torsocks VAL whether or not to wrap git and curl commands with torsocks (default: `auto') Must be one of: `auto', `no' or `yes' + -T NAME Name of remote(s) to try (may be repeated) + default: `origin' and `_grokmirror' + --exit-code exit with 127 if no updates --verbose | -v increase verbosity (may be repeated) --quiet | -q increase verbosity (may be repeated) -C DIR chdir to specified directory EOF -GetOptions($opt, qw(help|h quiet|q verbose|v+ C=s@ c=s@ - no-torsocks torsocks=s)) or die $help; +GetOptions($opt, qw(help|h quiet|q verbose|v+ C=s@ c=s@ try-remote|T=s@ + no-torsocks torsocks=s exit-code)) or die $help; if ($opt->{help}) { print $help; exit }; require PublicInbox::Fetch; # loads Admin PublicInbox::Admin::do_chdir(delete $opt->{C}); @@ -33,3 +36,4 @@ my $lei = bless { 0 => *STDIN{GLOB}, 1 => *STDOUT{GLOB}, 2 => *STDERR{GLOB}, }, 'PublicInbox::LEI'; PublicInbox::Fetch->do_fetch($lei, '.'); +exit(($lei->{child_error} // 0) >> 8);