[SCM] libmessage-passing-perl Debian packaging branch, master, updated. debian/0.111-3-14-g44f6e88

Tomas Doran bobtfish at bobtfish.net
Mon May 6 11:57:54 UTC 2013


The following commit has been merged in the master branch:
commit 2f8cf02f549bf17749a1ee392bffdfde3332ba1f
Author: Tomas Doran <bobtfish at bobtfish.net>
Date:   Sun Mar 3 15:53:49 2013 +0000

    Allow STDIN input to terminate program at EOF

diff --git a/Changes b/Changes
index e8e8cd2..41c3412 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,5 @@
+  - Fix STDIN input to exit on EOF.
+
 0.110
   - Fix v-string to work with perl 5.8. RT#80034
   - Fix issues stopping multiple FileTail inputs being used in the
diff --git a/Makefile.PL b/Makefile.PL
index e12d57a..45d31c8 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -28,6 +28,7 @@ requires 'Try::Tiny';
 requires 'Task::Weaken';
 requires 'Sys::Hostname::Long';
 requires 'DateTime';
+requires 'IO::Handle';
 
 install_script 'script/message-pass';
 
diff --git a/lib/Message/Passing/Input/STDIN.pm b/lib/Message/Passing/Input/STDIN.pm
index 0ddb5c3..77c9145 100644
--- a/lib/Message/Passing/Input/STDIN.pm
+++ b/lib/Message/Passing/Input/STDIN.pm
@@ -4,6 +4,7 @@ use AnyEvent;
 use Try::Tiny;
 use Scalar::Util qw/ weaken /;
 use namespace::clean -except => 'meta';
+use IO::Handle;
 
 with qw/
     Message::Passing::Role::Input
@@ -16,6 +17,7 @@ has reader => (
         my $self = shift;
         weaken($self);
         AnyEvent->io(fh => \*STDIN, poll => 'r', cb => sub {
+            exit 0 if STDIN->eof;
             my $input = <STDIN>;
             return unless defined $input;
             chomp($input);
@@ -45,6 +47,11 @@ Message::Passing::Input::STDIN - STDIN input
 
 =head1 DESCRIPTION
 
+An input which gets messages from STDIN.
+
+Messages are expected to be c<\n> seperated, and if EOF is encountered
+then this input will call C<exit> to terminate the program.
+
 =head1 SEE ALSO
 
 L<Message::Passing>
@@ -61,4 +68,5 @@ the SureVoIP API -
 
 See L<Message::Passing>.
 
-=cut
\ No newline at end of file
+=cut
+

-- 
libmessage-passing-perl Debian packaging



More information about the Pkg-perl-cvs-commits mailing list