]> Sergey Matveev's repositories - public-inbox.git/commitdiff
make Filesys::Notify::Simple optional
authorEric Wong <e@yhbt.net>
Fri, 10 Jan 2020 08:49:32 +0000 (08:49 +0000)
committerEric Wong <e@yhbt.net>
Sat, 11 Jan 2020 21:16:31 +0000 (21:16 +0000)
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
ci/deps.perl
lib/PublicInbox/WatchMaildir.pm

index 6b20385a56838708719ad44cea75ed3c2e523de9..94ec16c65fb16bc3c0433fe85e2b738e7c655a08 100644 (file)
@@ -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,
index 08722e1c41902275704a85b97f99be258192831d..93cc5d25623ad19cd169fb9ed5a221bf5f571a56 100755 (executable)
@@ -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
index dfb987e85dd5718648223206e13434b36ff5ca61..cf1dfa7656704bc3dcdeb637dd4a6e522a1fd4b3 100644 (file)
@@ -202,7 +202,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};
 }