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,AWL,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 C6FEE1FD4D for ; Fri, 10 Jan 2020 08:49:32 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/2] make Filesys::Notify::Simple optional Date: Fri, 10 Jan 2020 08:49:32 +0000 Message-Id: <20200110084932.20955-3-e@yhbt.net> In-Reply-To: <20200110084932.20955-1-e@yhbt.net> References: <20200110084932.20955-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: It's only used by us in public-inbox-watch, and maybe not for long. It's in most installations because Plack pulls it in though, but Plack is no longer required. --- Makefile.PL | 2 +- ci/deps.perl | 5 ++--- lib/PublicInbox/WatchMaildir.pm | 3 ++- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index 6b20385a..94ec16c6 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -132,7 +132,7 @@ WriteMakefile( # Filesys::Notify::Simple is pulled in by Plack, but also # needed by public-inbox-watch (for now) - 'Filesys::Notify::Simple' => 0, + # 'Filesys::Notify::Simple' => 0, # TODO: this should really be made optional... 'URI::Escape' => 0, diff --git a/ci/deps.perl b/ci/deps.perl index 08722e1c..93cc5d25 100755 --- a/ci/deps.perl +++ b/ci/deps.perl @@ -14,8 +14,7 @@ my @test_essential = qw(Test::Simple); # we actually use Test::More # package profiles my $profiles = { # the smallest possible profile for testing - # TODO: trim this, Plack pulls in Filesys::Notify::Simple, - # and we don't need that for mda-only installs + # TODO: trim URI::Escape from this, maybe essential => [ qw( git perl @@ -26,7 +25,6 @@ my $profiles = { Email::MIME::ContentType Encode ExtUtils::MakeMaker - Filesys::Notify::Simple URI::Escape ), @test_essential ], @@ -36,6 +34,7 @@ my $profiles = { BSD::Resource DBD::SQLite DBI + Filesys::Notify::Simple IO::Compress::Gzip Inline::C Net::Server diff --git a/lib/PublicInbox/WatchMaildir.pm b/lib/PublicInbox/WatchMaildir.pm index 8a8c1262..5d0515e0 100644 --- a/lib/PublicInbox/WatchMaildir.pm +++ b/lib/PublicInbox/WatchMaildir.pm @@ -203,7 +203,8 @@ sub watch { # lazy load here, we may support watching via IMAP IDLE # in the future... - require Filesys::Notify::Simple; + eval { require Filesys::Notify::Simple } or + die "Filesys::Notify::Simple is currently required for $0\n"; my $fsn = Filesys::Notify::Simple->new([@{$self->{mdir}}, $scandir]); $fsn->wait($cb) until $self->{quit}; }