Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package perl-Future-IO for openSUSE:Factory 
checked in at 2023-02-16 16:56:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Future-IO (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Future-IO.new.22824 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Future-IO"

Thu Feb 16 16:56:01 2023 rev:2 rq:1066005 version:0.12

Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Future-IO/perl-Future-IO.changes    
2022-08-16 18:38:04.350447726 +0200
+++ /work/SRC/openSUSE:Factory/.perl-Future-IO.new.22824/perl-Future-IO.changes 
2023-02-16 16:56:13.638790659 +0100
@@ -1,0 +2,17 @@
+Wed Feb  1 03:06:16 UTC 2023 - Tina Müller <[email protected]>
+
+- updated to 0.12
+   see /usr/share/doc/packages/perl-Future-IO/Changes
+
+  0.12    2023-01-31
+          [CHANGES]
+           * Added `Future::IO::System`, containing a system()-like and a
+             qx()-like method
+           * Added `->sysread_until_eof` method
+           * Update to perl v5.14 `package NAME VERSION` syntax
+           * Use `await` notation in method minisynopsis lines
+
+          [BUGFIXES]
+           * Need to work harder to set LocalAddr during socket tests
+
+-------------------------------------------------------------------

Old:
----
  Future-IO-0.11.tar.gz

New:
----
  Future-IO-0.12.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-Future-IO.spec ++++++
--- /var/tmp/diff_new_pack.tL9Xd3/_old  2023-02-16 16:56:14.298793297 +0100
+++ /var/tmp/diff_new_pack.tL9Xd3/_new  2023-02-16 16:56:14.306793329 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package perl-Future-IO
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 %define cpan_name Future-IO
 Name:           perl-Future-IO
-Version:        0.11
+Version:        0.12
 Release:        0
 License:        Artistic-1.0 OR GPL-1.0-or-later
 Summary:        Future-returning IO methods

++++++ Future-IO-0.11.tar.gz -> Future-IO-0.12.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Future-IO-0.11/Build.PL new/Future-IO-0.12/Build.PL
--- old/Future-IO-0.11/Build.PL 2022-01-07 02:46:03.000000000 +0100
+++ new/Future-IO-0.12/Build.PL 2023-01-31 16:43:41.000000000 +0100
@@ -1,3 +1,4 @@
+use v5;
 use strict;
 use warnings;
 
@@ -10,7 +11,7 @@
       'Struct::Dumb' => 0,
       'Time::HiRes' => 0,
 
-      'perl' => '5.010', # //
+      'perl' => '5.014',
    },
    test_requires => {
       'Test::Identity' => 0,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Future-IO-0.11/Changes new/Future-IO-0.12/Changes
--- old/Future-IO-0.11/Changes  2022-01-07 02:46:03.000000000 +0100
+++ new/Future-IO-0.12/Changes  2023-01-31 16:43:41.000000000 +0100
@@ -1,5 +1,16 @@
 Revision history for Future-IO
 
+0.12    2023-01-31
+        [CHANGES]
+         * Added `Future::IO::System`, containing a system()-like and a
+           qx()-like method
+         * Added `->sysread_until_eof` method
+         * Update to perl v5.14 `package NAME VERSION` syntax
+         * Use `await` notation in method minisynopsis lines
+
+        [BUGFIXES]
+         * Need to work harder to set LocalAddr during socket tests
+
 0.11    2022-01-07
         [CHANGES]
          * Added ->connect and ->accept for socket-based code
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Future-IO-0.11/LICENSE new/Future-IO-0.12/LICENSE
--- old/Future-IO-0.11/LICENSE  2022-01-07 02:46:03.000000000 +0100
+++ new/Future-IO-0.12/LICENSE  2023-01-31 16:43:41.000000000 +0100
@@ -1,4 +1,4 @@
-This software is copyright (c) 2022 by Paul Evans <[email protected]>.
+This software is copyright (c) 2023 by Paul Evans <[email protected]>.
 
 This is free software; you can redistribute it and/or modify it under
 the same terms as the Perl 5 programming language system itself.
@@ -12,7 +12,7 @@
 
 --- The GNU General Public License, Version 1, February 1989 ---
 
-This software is Copyright (c) 2022 by Paul Evans <[email protected]>.
+This software is Copyright (c) 2023 by Paul Evans <[email protected]>.
 
 This is free software, licensed under:
 
@@ -272,7 +272,7 @@
 
 --- The Artistic License 1.0 ---
 
-This software is Copyright (c) 2022 by Paul Evans <[email protected]>.
+This software is Copyright (c) 2023 by Paul Evans <[email protected]>.
 
 This is free software, licensed under:
 
@@ -292,21 +292,21 @@
 
   - "Package" refers to the collection of files distributed by the Copyright
     Holder, and derivatives of that collection of files created through
-    textual modification. 
+    textual modification.
   - "Standard Version" refers to such a Package if it has not been modified,
     or has been modified in accordance with the wishes of the Copyright
-    Holder. 
+    Holder.
   - "Copyright Holder" is whoever is named in the copyright or copyrights for
-    the package. 
+    the package.
   - "You" is you, if you're thinking about copying or distributing this 
Package.
   - "Reasonable copying fee" is whatever you can justify on the basis of media
     cost, duplication charges, time of people involved, and so on. (You will
     not be required to justify it to the Copyright Holder, but only to the
-    computing community at large as a market that must bear the fee.) 
+    computing community at large as a market that must bear the fee.)
   - "Freely Available" means that no fee is charged for the item itself, though
     there may be fees involved in handling the item. It also means that
     recipients of the item may redistribute it under the same conditions they
-    received it. 
+    received it.
 
 1. You may make and give away verbatim copies of the source form of the
 Standard Version of this Package without restriction, provided that you
@@ -373,7 +373,7 @@
 
 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
 WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
-MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
 The End
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Future-IO-0.11/MANIFEST new/Future-IO-0.12/MANIFEST
--- old/Future-IO-0.11/MANIFEST 2022-01-07 02:46:03.000000000 +0100
+++ new/Future-IO-0.12/MANIFEST 2023-01-31 16:43:41.000000000 +0100
@@ -2,12 +2,14 @@
 Changes
 lib/Future/IO.pm
 lib/Future/IO/ImplBase.pm
+lib/Future/IO/System.pm
 lib/Test/Future/IO/Impl.pm
 MANIFEST                       This list of files
 t/00use.t
 t/01sleep.t
 t/02sysread.t
 t/03sysread_exactly.t
+t/03sysread_until_eof.t
 t/04syswrite.t
 t/05syswrite_exactly.t
 t/06connect.t
@@ -15,6 +17,7 @@
 t/10sleep+sysread.t
 t/20impl-override.t
 t/21impl-before-load.t
+t/30system.t
 t/99pod.t
 README
 LICENSE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Future-IO-0.11/META.json new/Future-IO-0.12/META.json
--- old/Future-IO-0.11/META.json        2022-01-07 02:46:03.000000000 +0100
+++ new/Future-IO-0.12/META.json        2023-01-31 16:43:41.000000000 +0100
@@ -24,7 +24,7 @@
             "Future" : "0",
             "Struct::Dumb" : "0",
             "Time::HiRes" : "0",
-            "perl" : "5.010"
+            "perl" : "5.014"
          }
       },
       "test" : {
@@ -37,15 +37,19 @@
    "provides" : {
       "Future::IO" : {
          "file" : "lib/Future/IO.pm",
-         "version" : "0.11"
+         "version" : "0.12"
       },
       "Future::IO::ImplBase" : {
          "file" : "lib/Future/IO/ImplBase.pm",
-         "version" : "0.11"
+         "version" : "0.12"
+      },
+      "Future::IO::System" : {
+         "file" : "lib/Future/IO/System.pm",
+         "version" : "0.12"
       },
       "Test::Future::IO::Impl" : {
          "file" : "lib/Test/Future/IO/Impl.pm",
-         "version" : "0.11"
+         "version" : "0.12"
       }
    },
    "release_status" : "stable",
@@ -54,6 +58,6 @@
          "http://dev.perl.org/licenses/";
       ]
    },
-   "version" : "0.11",
-   "x_serialization_backend" : "JSON::PP version 4.04"
+   "version" : "0.12",
+   "x_serialization_backend" : "JSON::PP version 4.07"
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Future-IO-0.11/META.yml new/Future-IO-0.12/META.yml
--- old/Future-IO-0.11/META.yml 2022-01-07 02:46:03.000000000 +0100
+++ new/Future-IO-0.12/META.yml 2023-01-31 16:43:41.000000000 +0100
@@ -17,19 +17,22 @@
 provides:
   Future::IO:
     file: lib/Future/IO.pm
-    version: '0.11'
+    version: '0.12'
   Future::IO::ImplBase:
     file: lib/Future/IO/ImplBase.pm
-    version: '0.11'
+    version: '0.12'
+  Future::IO::System:
+    file: lib/Future/IO/System.pm
+    version: '0.12'
   Test::Future::IO::Impl:
     file: lib/Test/Future/IO/Impl.pm
-    version: '0.11'
+    version: '0.12'
 requires:
   Future: '0'
   Struct::Dumb: '0'
   Time::HiRes: '0'
-  perl: '5.010'
+  perl: '5.014'
 resources:
   license: http://dev.perl.org/licenses/
-version: '0.11'
+version: '0.12'
 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Future-IO-0.11/README new/Future-IO-0.12/README
--- old/Future-IO-0.11/README   2022-01-07 02:46:03.000000000 +0100
+++ new/Future-IO-0.12/README   2023-01-31 16:43:41.000000000 +0100
@@ -64,17 +64,18 @@
 
  accept
 
-       $f = Future::IO->accept( $fh )
+       $socketfh = await Future::IO->accept( $fh );
 
     Since version 0.11.
 
     Returns a Future that will become done when a new connection has been
     accepted on the given filehandle, which should represent a listen-mode
-    socket.
+    socket. The returned future will yield the newly-accepted client socket
+    filehandle.
 
  alarm
 
-       $f = Future::IO->alarm( $epoch )
+       await Future::IO->alarm( $epoch );
 
     Since version 0.08.
 
@@ -84,7 +85,7 @@
 
  connect
 
-       $f = Future::IO->connect( $fh, $name )
+       await Future::IO->connect( $fh, $name );
 
     Since version 0.11.
 
@@ -93,16 +94,14 @@
 
  sleep
 
-       $f = Future::IO->sleep( $secs )
+       await Future::IO->sleep( $secs );
 
     Returns a Future that will become done a fixed delay from now, given in
     seconds. This value may be fractional.
 
  sysread
 
-       $f = Future::IO->sysread( $fh, $length )
-    
-          $bytes = $f->get
+       $bytes = await Future::IO->sysread( $fh, $length );
 
     Returns a Future that will become done when at least one byte can be
     read from the given filehandle. It may return up to $length bytes. On
@@ -115,9 +114,7 @@
 
  sysread_exactly
 
-       $f = Future::IO->sysread_exactly( $fh, $length )
-    
-          $bytes = $f->get
+       $bytes = await Future::IO->sysread_exactly( $fh, $length );
 
     Since version 0.03.
 
@@ -131,11 +128,19 @@
 
     This may make more than one sysread() call.
 
+ sysread_until_eof
+
+       $f = Future::IO->sysread_until_eof( $fh )
+
+    Since version 0.12.
+
+    Returns a Future that will become done when the given filehandle
+    reaches the EOF condition. The returned future will yield all of the
+    bytes read up until that point.
+
  syswrite
 
-       $f = Future::IO->syswrite( $fh, $bytes )
-    
-          $written_len = $f->get
+       $written_len = await Future::IO->syswrite( $fh, $bytes );
 
     Since version 0.04.
 
@@ -149,9 +154,7 @@
 
  syswrite_exactly
 
-       $f = Future::IO->syswrite_exactly( $fh, $bytes )
-    
-          $written_len = $f->get
+       $written_len = await Future::IO->syswrite_exactly( $fh, $bytes );
 
     Since version 0.04.
 
@@ -164,9 +167,7 @@
 
  waitpid
 
-       $f = Future::IO->waitpid( $pid )
-    
-          $wstatus = $f->get
+       $wstatus = await Future::IO->waitpid( $pid );
 
     Since version 0.09.
 
@@ -184,7 +185,7 @@
 
  override_impl
 
-       Future::IO->override_impl( $impl )
+       Future::IO->override_impl( $impl );
 
     Sets a new implementation for Future::IO, replacing the minimal default
     internal implementation. This can either be a package name or an object
@@ -202,7 +203,7 @@
 
  HAVE_MULTIPLE_FILEHANDLES
 
-       $has = Future::IO->HAVE_MULTIPLE_FILEHANDLES
+       $has = Future::IO->HAVE_MULTIPLE_FILEHANDLES;
 
     Since version 0.11.
 
@@ -212,7 +213,7 @@
 
  await
 
-       $f = $f->await
+       $f = $f->await;
 
     Since version 0.07.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Future-IO-0.11/lib/Future/IO/ImplBase.pm 
new/Future-IO-0.12/lib/Future/IO/ImplBase.pm
--- old/Future-IO-0.11/lib/Future/IO/ImplBase.pm        2022-01-07 
02:46:03.000000000 +0100
+++ new/Future-IO-0.12/lib/Future/IO/ImplBase.pm        2023-01-31 
16:43:41.000000000 +0100
@@ -3,13 +3,11 @@
 #
 #  (C) Paul Evans, 2019-2021 -- [email protected]
 
-package Future::IO::ImplBase;
+package Future::IO::ImplBase 0.12;
 
-use strict;
+use v5.14;
 use warnings;
 
-our $VERSION = '0.11';
-
 use Errno qw( EAGAIN EWOULDBLOCK EINPROGRESS );
 use Socket qw( SOL_SOCKET SO_ERROR );
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Future-IO-0.11/lib/Future/IO/System.pm 
new/Future-IO-0.12/lib/Future/IO/System.pm
--- old/Future-IO-0.11/lib/Future/IO/System.pm  1970-01-01 01:00:00.000000000 
+0100
+++ new/Future-IO-0.12/lib/Future/IO/System.pm  2023-01-31 16:43:41.000000000 
+0100
@@ -0,0 +1,244 @@
+#  You may distribute under the terms of either the GNU General Public License
+#  or the Artistic License (the same terms as Perl itself)
+#
+#  (C) Paul Evans, 2023 -- [email protected]
+
+package Future::IO::System 0.12;
+
+use v5.14;
+use warnings;
+
+use Carp;
+
+use Future::IO;
+
+=head1 NAME
+
+C<Future::IO::System> - C<system()>-like methods for L<Future::IO>
+
+=head1 SYNOPSIS
+
+   use Future::IO;
+   use Future::IO::System;
+
+   my $f = Future::IO::System->system( "cmd", "args go", "here" );
+   # $f will become done when the command completes
+
+   my $f = Future::IO::System->system_out( "cmd", "-v" );
+   my ( $status, $out ) = $f->get;
+
+   # $status will contain the exit code and $out will contain what it wrote
+   # to STDOUT
+
+=head1 DESCRIPTION
+
+This package contains a selection of methods that behave like the core
+C<system()> and related functions, running asynchronously via L<Future::IO>.
+
+In particular, the L</system> behaves somewhat like C<CORE::system()> and
+L</system_out> behaves somewhat like L<qx()>.
+
+=head2 Portability
+
+In order for this module to work at all, the underlying C<Future::IO>
+implementation must support the L<Future::IO/waitpid> method. The default
+minimal implementation included with the module does not, but most of the
+additional implementations from CPAN will.
+
+In addition, the operation of this module uses techniques that only really
+work on full POSIX systems (such as Linux, Mac OS X, the various BSDs, etc).
+It is unlikely to work in places like MSWin32.
+
+=cut
+
+# TODO: Print at least some sort of warning if loaded on one of the weird
+# non-POSIX OSes
+
+=head1 METHODS
+
+=cut
+
+=head2 run
+
+   ( $exitcode, ... ) = await Future::IO::System->run(
+      argv => [ $path, @args ],
+      ...
+   );
+
+I<Since version 0.12.>
+
+Runs the given C<$path> with the given C<@args> as a sub-process, optionally
+with some additional filehandles set up as determined by the other arguments.
+The returned L<Future> will yield the C<waitpid()> exit code from the process
+when it terminates, and optionally the bytes read from the other filehandles
+that were set up.
+
+Takes the following named arguments
+
+=over 4
+
+=item argv => ARRAY
+
+An array reference containing the path and arguments to pass to C<exec()> in
+the child process.
+
+=item in => STRING
+
+If defined, create a pipe and assign the reading end to the child process's
+STDIN filehandle. The given string will then be written to the pipe, after
+which the pipe will be closed.
+
+=item want_out => BOOL
+
+If true, create a pipe and assign the writing end to the child process's
+STDOUT filehandle. The returned future will additionally contain all the bytes
+read from it until EOF.
+
+=item want_err => BOOL
+
+If true, create a pipe and assign the writing end to the child process's
+STDERR filehandle. The returned future will additionally contain all the bytes
+read from it until EOF.
+
+=back
+
+The remaining methods in this class are simplified wrappers of this one.
+
+=cut
+
+sub run
+{
+   shift;
+   my %params = @_;
+
+   my $argv     = $params{argv};
+   my $want_in  = defined $params{in};
+   my $want_out = $params{want_out};
+   my $want_err = $params{want_err};
+
+   my @infh;
+   pipe( $infh[0], $infh[1] ) or croak "Cannot pipe() - $!"
+      if $want_in;
+
+   my @outfh;
+   pipe( $outfh[0], $outfh[1] ) or croak "Cannot pipe() - $!"
+      if $want_out;
+
+   my @errfh;
+   pipe( $errfh[0], $errfh[1] ) or croak "Cannot pipe() - $!"
+      if $want_err;
+
+   defined( my $pid = fork() )
+      or croak "Cannot fork() - $!";
+
+   if( $pid ) {
+      # parent
+
+      my @f;
+      push @f, Future::IO->waitpid( $pid );
+
+      if( $want_in ) {
+         close $infh[0];
+         push @f, Future::IO->syswrite_exactly( $infh[1], $params{in} )
+            ->then( sub { close $infh[1]; Future->done() } );
+      }
+
+      if( $want_out ) {
+         close $outfh[1];
+         push @f, Future::IO->sysread_until_eof( $outfh[0] );
+      }
+
+      if( $want_err ) {
+         close $errfh[1];
+         push @f, Future::IO->sysread_until_eof( $errfh[0] );
+      }
+
+      return Future->needs_all( @f );
+   }
+   else {
+      # child
+
+      if( $want_in ) {
+         close $infh[1];
+         POSIX::dup2( $infh[0]->fileno, 0 );
+      }
+
+      if( $want_out ) {
+         close $outfh[0];
+         POSIX::dup2( $outfh[1]->fileno, 1 );
+      }
+
+      if( $want_err ) {
+         close $errfh[0];
+         POSIX::dup2( $errfh[1]->fileno, 2 );
+      }
+
+      exec( @$argv ) or
+         POSIX::_exit( -1 );
+   }
+}
+
+=head2 system
+
+   $exitcode = await Future::IO::System->system( $path, @args );
+
+I<Since version 0.12.>
+
+Runs the given C<$path> with the given C<@args> as a sub-process with no extra
+filehandles.
+
+=cut
+
+sub system
+{
+   my $self = shift;
+   my @argv = @_;
+
+   return $self->run( argv => \@argv );
+}
+
+=head2 system_out
+
+   ( $exitcode, $out ) = await Future::IO::System->system_out( $path, @args );
+
+I<Since version 0.12.>
+
+Runs the given C<$path> with the given C<@args> as a sub-process with a new
+pipe as its STDOUT filehandle. The returned L<Future> will additionally yield
+the bytes read from the STDOUT pipe.
+
+=cut
+
+sub system_out
+{
+   my $self = shift;
+   my @argv = @_;
+
+   return $self->run( argv => \@argv, want_out => 1 );
+}
+
+=head1 TODO
+
+=over 4
+
+=item *
+
+Add some OS portability guard warnings when loading the module on platforms
+not known to support it.
+
+=item *
+
+Consider what other features of modules like L<IPC::Run> or
+L<IO::Async::Process> to support here. Try not to go overboard.
+
+=back
+
+=cut
+
+=head1 AUTHOR
+
+Paul Evans <[email protected]>
+
+=cut
+
+0x55AA;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Future-IO-0.11/lib/Future/IO.pm 
new/Future-IO-0.12/lib/Future/IO.pm
--- old/Future-IO-0.11/lib/Future/IO.pm 2022-01-07 02:46:03.000000000 +0100
+++ new/Future-IO-0.12/lib/Future/IO.pm 2023-01-31 16:43:41.000000000 +0100
@@ -1,15 +1,12 @@
 #  You may distribute under the terms of either the GNU General Public License
 #  or the Artistic License (the same terms as Perl itself)
 #
-#  (C) Paul Evans, 2019-2021 -- [email protected]
+#  (C) Paul Evans, 2019-2023 -- [email protected]
 
-package Future::IO;
+package Future::IO 0.12;
 
-use strict;
+use v5.14;
 use warnings;
-use 5.010;  # //
-
-our $VERSION = '0.11';
 
 use Carp;
 
@@ -20,6 +17,9 @@
 
 our $IMPL;
 
+our $MAX_READLEN = 8192;
+our $MAX_WRITELEN = 8192;
+
 =head1 NAME
 
 C<Future::IO> - Future-returning IO methods
@@ -97,12 +97,13 @@
 
 =head2 accept
 
-   $f = Future::IO->accept( $fh )
+   $socketfh = await Future::IO->accept( $fh );
 
 I<Since version 0.11.>
 
 Returns a L<Future> that will become done when a new connection has been
 accepted on the given filehandle, which should represent a listen-mode socket.
+The returned future will yield the newly-accepted client socket filehandle.
 
 =cut
 
@@ -116,7 +117,7 @@
 
 =head2 alarm
 
-   $f = Future::IO->alarm( $epoch )
+   await Future::IO->alarm( $epoch );
 
 I<Since version 0.08.>
 
@@ -143,7 +144,7 @@
 
 =head2 connect
 
-   $f = Future::IO->connect( $fh, $name )
+   await Future::IO->connect( $fh, $name );
 
 I<Since version 0.11.>
 
@@ -162,7 +163,7 @@
 
 =head2 sleep
 
-   $f = Future::IO->sleep( $secs )
+   await Future::IO->sleep( $secs );
 
 Returns a L<Future> that will become done a fixed delay from now, given in
 seconds. This value may be fractional.
@@ -179,9 +180,7 @@
 
 =head2 sysread
 
-   $f = Future::IO->sysread( $fh, $length )
-
-      $bytes = $f->get
+   $bytes = await Future::IO->sysread( $fh, $length );
 
 Returns a L<Future> that will become done when at least one byte can be read
 from the given filehandle. It may return up to C<$length> bytes. On EOF, the
@@ -204,9 +203,7 @@
 
 =head2 sysread_exactly
 
-   $f = Future::IO->sysread_exactly( $fh, $length )
-
-      $bytes = $f->get
+   $bytes = await Future::IO->sysread_exactly( $fh, $length );
 
 I<Since version 0.03.>
 
@@ -232,29 +229,62 @@
       return $IMPL->$code( $fh, $length );
    }
 
-   return _sysread_into_buffer( $IMPL, $fh, $length, '' );
+   return _sysread_into_buffer( $IMPL, $fh, $length, \(my $buffer = '') );
 }
 
 sub _sysread_into_buffer
 {
-   my ( $IMPL, $fh, $length, $bytes ) = @_;
+   my ( $IMPL, $fh, $length, $bufref ) = @_;
 
-   $IMPL->sysread( $fh, $length - length $bytes )->then( sub {
+   $IMPL->sysread( $fh, $length - length $$bufref )->then( sub {
       my ( $more ) = @_;
       return Future->done() if !defined $more; # EOF
 
-      $bytes .= $more;
+      $$bufref .= $more;
 
-      return Future->done( $bytes ) if length $bytes >= $length;
-      return _sysread_into_buffer( $IMPL, $fh, $length, $bytes );
+      return Future->done( $$bufref ) if length $$bufref >= $length;
+      return _sysread_into_buffer( $IMPL, $fh, $length, $bufref );
    });
 }
 
-=head2 syswrite
+=head2 sysread_until_eof
+
+   $f = Future::IO->sysread_until_eof( $fh )
+
+I<Since version 0.12.>
+
+Returns a L<Future> that will become done when the given filehandle reaches
+the EOF condition. The returned future will yield all of the bytes read up
+until that point.
+
+=cut
+
+sub sysread_until_eof
+{
+   shift;
+   my ( $fh ) = @_;
 
-   $f = Future::IO->syswrite( $fh, $bytes )
+   $IMPL //= "Future::IO::_DefaultImpl";
+
+   return _sysread_until_eof( $IMPL, $fh, \(my $buffer = '') );
+}
+
+sub _sysread_until_eof
+{
+   my ( $IMPL, $fh, $bufref ) = @_;
+
+   $IMPL->sysread( $fh, $MAX_READLEN )->then( sub {
+      my ( $more ) = @_;
+      return Future->done( $$bufref ) if !defined $more;
 
-      $written_len = $f->get
+      $$bufref .= $more;
+      return _sysread_until_eof( $IMPL, $fh, $bufref );
+   });
+}
+
+=head2 syswrite
+
+   $written_len = await Future::IO->syswrite( $fh, $bytes );
 
 I<Since version 0.04.>
 
@@ -278,9 +308,7 @@
 
 =head2 syswrite_exactly
 
-   $f = Future::IO->syswrite_exactly( $fh, $bytes )
-
-      $written_len = $f->get
+   $written_len = await Future::IO->syswrite_exactly( $fh, $bytes );
 
 I<Since version 0.04.>
 
@@ -304,27 +332,25 @@
       return $IMPL->$code( $fh, $bytes );
    }
 
-   return _syswrite_from_buffer( $IMPL, $fh, $bytes, length $bytes );
+   return _syswrite_from_buffer( $IMPL, $fh, \$bytes, length $bytes );
 }
 
 sub _syswrite_from_buffer
 {
-   my ( $IMPL, $fh, $bytes, $len ) = @_;
+   my ( $IMPL, $fh, $bufref, $len ) = @_;
 
-   $IMPL->syswrite( $fh, $bytes )->then( sub {
+   $IMPL->syswrite( $fh, substr $$bufref, 0, $MAX_WRITELEN )->then( sub {
       my ( $written_len ) = @_;
-      substr $bytes, 0, $written_len, "";
+      substr $$bufref, 0, $written_len, "";
 
-      return Future->done( $len ) if !length $bytes;
-      return _syswrite_from_buffer( $IMPL, $fh, $bytes, $len );
+      return Future->done( $len ) if !length $$bufref;
+      return _syswrite_from_buffer( $IMPL, $fh, $bufref, $len );
    });
 }
 
 =head2 waitpid
 
-   $f = Future::IO->waitpid( $pid )
-
-      $wstatus = $f->get
+   $wstatus = await Future::IO->waitpid( $pid );
 
 I<Since version 0.09.>
 
@@ -352,7 +378,7 @@
 
 =head2 override_impl
 
-   Future::IO->override_impl( $impl )
+   Future::IO->override_impl( $impl );
 
 Sets a new implementation for C<Future::IO>, replacing the minimal default
 internal implementation. This can either be a package name or an object
@@ -384,7 +410,7 @@
 
 =head2 HAVE_MULTIPLE_FILEHANDLES
 
-   $has = Future::IO->HAVE_MULTIPLE_FILEHANDLES
+   $has = Future::IO->HAVE_MULTIPLE_FILEHANDLES;
 
 I<Since version 0.11.>
 
@@ -556,7 +582,7 @@
 
 =head2 await
 
-   $f = $f->await
+   $f = $f->await;
 
 I<Since version 0.07.>
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Future-IO-0.11/lib/Test/Future/IO/Impl.pm 
new/Future-IO-0.12/lib/Test/Future/IO/Impl.pm
--- old/Future-IO-0.11/lib/Test/Future/IO/Impl.pm       2022-01-07 
02:46:03.000000000 +0100
+++ new/Future-IO-0.12/lib/Test/Future/IO/Impl.pm       2023-01-31 
16:43:41.000000000 +0100
@@ -3,18 +3,17 @@
 #
 #  (C) Paul Evans, 2021 -- [email protected]
 
-package Test::Future::IO::Impl;
+package Test::Future::IO::Impl 0.12;
 
-use strict;
+use v5.14;
 use warnings;
 
-our $VERSION = '0.11';
-
 use Test::More;
 use Test::Builder;
 
 use Errno qw( EINVAL EPIPE );
 use IO::Handle;
+use Socket qw( pack_sockaddr_in INADDR_LOOPBACK );
 use Time::HiRes qw( time );
 
 use Exporter 'import';
@@ -109,6 +108,7 @@
 
    my $serversock = IO::Socket::INET->new(
       Type      => Socket::SOCK_STREAM(),
+      LocalAddr => "localhost",
       LocalPort => 0,
       Listen    => 1,
    ) or die "Cannot socket()/listen() - $@";
@@ -117,7 +117,12 @@
 
    my $f = Future::IO->accept( $serversock );
 
-   my $sockname = $serversock->sockname;
+   # Some platforms have assigned 127.0.0.1 here; others have left 0.0.0.0
+   # If it's still 0.0.0.0, then guess that maybe connecting to 127.0.0.1 will
+   # work
+   my $sockname = ( $serversock->sockhost ne "0.0.0.0" )
+      ? $serversock->sockname
+      : pack_sockaddr_in( $serversock->sockport, INADDR_LOOPBACK );
 
    my $clientsock = IO::Socket::INET->new(
       Type => Socket::SOCK_STREAM(),
@@ -141,11 +146,17 @@
 
    my $serversock = IO::Socket::INET->new(
       Type      => Socket::SOCK_STREAM(),
+      LocalAddr => "localhost",
       LocalPort => 0,
       Listen    => 1,
    ) or die "Cannot socket()/listen() - $@";
 
-   my $sockname = $serversock->sockname;
+   # Some platforms have assigned 127.0.0.1 here; others have left 0.0.0.0
+   # If it's still 0.0.0.0, then guess that maybe connecting to 127.0.0.1 will
+   # work
+   my $sockname = ( $serversock->sockhost ne "0.0.0.0" )
+      ? $serversock->sockname
+      : pack_sockaddr_in( $serversock->sockport, INADDR_LOOPBACK );
 
    # ->connect success
    {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Future-IO-0.11/t/00use.t new/Future-IO-0.12/t/00use.t
--- old/Future-IO-0.11/t/00use.t        2022-01-07 02:46:03.000000000 +0100
+++ new/Future-IO-0.12/t/00use.t        2023-01-31 16:43:41.000000000 +0100
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-use strict;
+use v5.14;
 use warnings;
 
 use Test::More;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Future-IO-0.11/t/01sleep.t 
new/Future-IO-0.12/t/01sleep.t
--- old/Future-IO-0.11/t/01sleep.t      2022-01-07 02:46:03.000000000 +0100
+++ new/Future-IO-0.12/t/01sleep.t      2023-01-31 16:43:41.000000000 +0100
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-use strict;
+use v5.14;
 use warnings;
 
 use Test::More;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Future-IO-0.11/t/02sysread.t 
new/Future-IO-0.12/t/02sysread.t
--- old/Future-IO-0.11/t/02sysread.t    2022-01-07 02:46:03.000000000 +0100
+++ new/Future-IO-0.12/t/02sysread.t    2023-01-31 16:43:41.000000000 +0100
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-use strict;
+use v5.14;
 use warnings;
 
 use Test::More;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Future-IO-0.11/t/03sysread_exactly.t 
new/Future-IO-0.12/t/03sysread_exactly.t
--- old/Future-IO-0.11/t/03sysread_exactly.t    2022-01-07 02:46:03.000000000 
+0100
+++ new/Future-IO-0.12/t/03sysread_exactly.t    2023-01-31 16:43:41.000000000 
+0100
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-use strict;
+use v5.14;
 use warnings;
 
 use Test::More;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Future-IO-0.11/t/03sysread_until_eof.t 
new/Future-IO-0.12/t/03sysread_until_eof.t
--- old/Future-IO-0.11/t/03sysread_until_eof.t  1970-01-01 01:00:00.000000000 
+0100
+++ new/Future-IO-0.12/t/03sysread_until_eof.t  2023-01-31 16:43:41.000000000 
+0100
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+
+use v5.14;
+use warnings;
+
+use Test::More;
+
+use IO::Handle;
+
+use Future::IO;
+
+# ->sysread_until_eof
+{
+   pipe my ( $rd, $wr ) or die "Cannot pipe() - $!";
+
+   $wr->autoflush();
+   $wr->print( "BYTES" );
+
+   my $f = Future::IO->sysread_until_eof( $rd );
+
+   $wr->print( " HERE" );
+   $wr->close;
+
+   is( scalar $f->get, "BYTES HERE", 'Future::IO->sysread_until_eof eventually 
yields all the bytes' );
+}
+
+done_testing;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Future-IO-0.11/t/04syswrite.t 
new/Future-IO-0.12/t/04syswrite.t
--- old/Future-IO-0.11/t/04syswrite.t   2022-01-07 02:46:03.000000000 +0100
+++ new/Future-IO-0.12/t/04syswrite.t   2023-01-31 16:43:41.000000000 +0100
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-use strict;
+use v5.14;
 use warnings;
 
 use Test::More;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Future-IO-0.11/t/05syswrite_exactly.t 
new/Future-IO-0.12/t/05syswrite_exactly.t
--- old/Future-IO-0.11/t/05syswrite_exactly.t   2022-01-07 02:46:03.000000000 
+0100
+++ new/Future-IO-0.12/t/05syswrite_exactly.t   2023-01-31 16:43:41.000000000 
+0100
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-use strict;
+use v5.14;
 use warnings;
 
 use Test::More;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Future-IO-0.11/t/06connect.t 
new/Future-IO-0.12/t/06connect.t
--- old/Future-IO-0.11/t/06connect.t    2022-01-07 02:46:03.000000000 +0100
+++ new/Future-IO-0.12/t/06connect.t    2023-01-31 16:43:41.000000000 +0100
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-use strict;
+use v5.14;
 use warnings;
 
 use Test::More;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Future-IO-0.11/t/07accept.t 
new/Future-IO-0.12/t/07accept.t
--- old/Future-IO-0.11/t/07accept.t     2022-01-07 02:46:03.000000000 +0100
+++ new/Future-IO-0.12/t/07accept.t     2023-01-31 16:43:41.000000000 +0100
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-use strict;
+use v5.14;
 use warnings;
 
 use Test::More;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Future-IO-0.11/t/10sleep+sysread.t 
new/Future-IO-0.12/t/10sleep+sysread.t
--- old/Future-IO-0.11/t/10sleep+sysread.t      2022-01-07 02:46:03.000000000 
+0100
+++ new/Future-IO-0.12/t/10sleep+sysread.t      2023-01-31 16:43:41.000000000 
+0100
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-use strict;
+use v5.14;
 use warnings;
 
 use Test::More;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Future-IO-0.11/t/20impl-override.t 
new/Future-IO-0.12/t/20impl-override.t
--- old/Future-IO-0.11/t/20impl-override.t      2022-01-07 02:46:03.000000000 
+0100
+++ new/Future-IO-0.12/t/20impl-override.t      2023-01-31 16:43:41.000000000 
+0100
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-use strict;
+use v5.14;
 use warnings;
 
 use Test::More;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Future-IO-0.11/t/21impl-before-load.t 
new/Future-IO-0.12/t/21impl-before-load.t
--- old/Future-IO-0.11/t/21impl-before-load.t   2022-01-07 02:46:03.000000000 
+0100
+++ new/Future-IO-0.12/t/21impl-before-load.t   2023-01-31 16:43:41.000000000 
+0100
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-use strict;
+use v5.14;
 use warnings;
 
 use Test::More;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Future-IO-0.11/t/30system.t 
new/Future-IO-0.12/t/30system.t
--- old/Future-IO-0.11/t/30system.t     1970-01-01 01:00:00.000000000 +0100
+++ new/Future-IO-0.12/t/30system.t     2023-01-31 16:43:41.000000000 +0100
@@ -0,0 +1,72 @@
+#!/usr/bin/perl
+
+use v5.14;
+use warnings;
+
+use Test::More;
+
+use IO::Handle;
+
+use Future::IO;
+use Future::IO::System;
+
+sub load_impl_supporting_waitpid
+{
+   # We need a Future::IO impl that can ->waitpid
+   foreach my $impl (qw(
+         Future::IO::Impl::UV
+         Future::IO::Impl::Glib
+         Future::IO::Impl::IOAsync
+      )) {
+      eval { require "$impl.pm" =~ s{::}{/}gr; 1 } and return;
+   }
+
+   plan skip_all => "Unable to find a Future::IO impl that supports ->waitpid";
+}
+
+load_impl_supporting_waitpid();
+
+# system
+{
+   my $f = Future::IO::System->system( $^X, "-e", "exit 5" );
+
+   is( scalar $f->get, 5<<8, 'Future::IO::System->system future yields exit 
status' );
+}
+
+# system_out
+{
+   my $f = Future::IO::System->system_out( $^X, "-e", "print qq(Hello, 
world\\n)" );
+
+   my ( $exitcode, $out ) = $f->get;
+   is( $exitcode, 0, 'exitcode from ->system_out Future' );
+   is( $out, "Hello, world\n", 'out from ->system_out Future' );
+}
+
+# run with in+out
+{
+   my $f = Future::IO::System->run(
+      argv     => [ $^X, "-e", "print uc( scalar <STDIN> );" ],
+      in       => "hello, world",
+      want_out => 1,
+   );
+
+   my ( $exitcode, $out ) = $f->get;
+   is( $exitcode, 0, 'exitcode from ->run+in+out Future' );
+   is( $out, "HELLO, WORLD", 'out from ->run+in+out Future' );
+}
+
+# run with out+err
+{
+   my $f = Future::IO::System->run(
+      argv     => [ $^X, "-e", "print qq(OUT\\n); print STDERR qq(ERR\\n);" ],
+      want_out => 1,
+      want_err => 1,
+   );
+
+   my ( $exitcode, $out, $err ) = $f->get;
+   is( $exitcode, 0, 'exitcode from ->run+out+err Future' );
+   is( $out, "OUT\n", 'out from ->run+out+err Future' );
+   is( $err, "ERR\n", 'err from ->run+out+err Future' );
+}
+
+done_testing;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Future-IO-0.11/t/99pod.t new/Future-IO-0.12/t/99pod.t
--- old/Future-IO-0.11/t/99pod.t        2022-01-07 02:46:03.000000000 +0100
+++ new/Future-IO-0.12/t/99pod.t        2023-01-31 16:43:41.000000000 +0100
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-use strict;
+use v5.14;
 use warnings;
 
 use Test::More;

Reply via email to