user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Eric Wong <e@yhbt.net>
To: meta@public-inbox.org
Subject: [PATCH 2/2] make Filesys::Notify::Simple optional
Date: Fri, 10 Jan 2020 08:49:32 +0000	[thread overview]
Message-ID: <20200110084932.20955-3-e@yhbt.net> (raw)
In-Reply-To: <20200110084932.20955-1-e@yhbt.net>

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};
 }

      parent reply	other threads:[~2020-01-10  8:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-10  8:49 [PATCH 0/2] Plack and Filesys::Notify::Simple are optional Eric Wong
2020-01-10  8:49 ` [PATCH 1/2] make Plack optional for non-WWW and non-httpd users Eric Wong
2020-01-10  8:49 ` Eric Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200110084932.20955-3-e@yhbt.net \
    --to=e@yhbt.net \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).