From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id F1BC41F45A for ; Mon, 20 Apr 2020 09:33:38 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] drop needless `eval {}' around Config->new Date: Mon, 20 Apr 2020 09:33:38 +0000 Message-Id: <20200420093338.27941-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: It hasn't been needed since commit 089cca37fa036411 ("config: ignore missing config files"). And we actually want to propagate errors when we can't start new processes or if git(1) is missing. --- lib/PublicInbox/Admin.pm | 2 +- script/public-inbox-convert | 2 +- script/public-inbox-edit | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/PublicInbox/Admin.pm b/lib/PublicInbox/Admin.pm index 336b7d4c..60f4f40d 100644 --- a/lib/PublicInbox/Admin.pm +++ b/lib/PublicInbox/Admin.pm @@ -71,7 +71,7 @@ sub resolve_inboxes ($;$$) { my ($argv, $opt, $cfg) = @_; $opt ||= {}; - $cfg //= eval { PublicInbox::Config->new }; + $cfg //= PublicInbox::Config->new; if ($opt->{all}) { my $cfgfile = PublicInbox::Config::default_file(); $cfg or die "--all specified, but $cfgfile not readable\n"; diff --git a/script/public-inbox-convert b/script/public-inbox-convert index e13c13f4..4c220b36 100755 --- a/script/public-inbox-convert +++ b/script/public-inbox-convert @@ -24,7 +24,7 @@ my $old_dir = shift(@ARGV) or die $usage; my $new_dir = shift(@ARGV) or die $usage; die "$new_dir exists\n" if -d $new_dir; die "$old_dir not a directory\n" unless -d $old_dir; -my $config = eval { PublicInbox::Config->new }; +my $config = PublicInbox::Config->new; $old_dir = abs_path($old_dir); my $old; if ($config) { diff --git a/script/public-inbox-edit b/script/public-inbox-edit index 28b1b5e8..42f914a8 100755 --- a/script/public-inbox-edit +++ b/script/public-inbox-edit @@ -22,7 +22,7 @@ my @opt = qw(mid|m=s file|F=s raw); GetOptions($opt, @PublicInbox::AdminEdit::OPT, @opt) or die "bad command-line args\n$usage\n"; -my $cfg = eval { PublicInbox::Config->new }; +my $cfg = PublicInbox::Config->new; my $editor = $ENV{MAIL_EDITOR}; # e.g. "mutt -f" unless (defined $editor) { my $k = 'publicinbox.mailEditor';