From 2d7ea0c1eb74878273a9184ba47dc1112b442c88 Mon Sep 17 00:00:00 2001 From: Joshua Roys Date: Tue, 19 Aug 2008 04:45:15 -0400 Subject: [PATCH] Fix 'Play' to correctly pass data to unpack-objects IO::Plumbing was using the bucket() as a line-based data source, which didn't work so well. --- lib/VCS/Git/Torrent/PWP/Message/Play.pm | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/VCS/Git/Torrent/PWP/Message/Play.pm b/lib/VCS/Git/Torrent/PWP/Message/Play.pm index f980287..a3e6317 100644 --- a/lib/VCS/Git/Torrent/PWP/Message/Play.pm +++ b/lib/VCS/Git/Torrent/PWP/Message/Play.pm @@ -12,7 +12,7 @@ L =cut -use IO::Plumbing qw(bucket vent); +use IO::Plumbing qw(hose vent); use Moose; with "VCS::Git::Torrent::PWP::Message"; use Carp; @@ -103,15 +103,17 @@ sub action { my ($start, $end) = @{ $self->reel_sha1_pair }; if ( $self->data_len && $self->data ) { # we got data - my $bucket = bucket($self->data); + my $hose = hose(); my $unpack = $local_peer->torrent->plumb( - [ 'unpack-objects' ], - input => $bucket, - stderr => vent(), + [ 'unpack-objects', '-q' ], + input => $hose, +# stderr => vent(), ); $unpack->execute(); + $hose->print($self->data); + $hose->close(); $unpack->wait(); my $pack_name = $local_peer->torrent->state_dir . @@ -168,12 +170,12 @@ sub action { my $rev_list = $local_peer->torrent->plumb( \@cmd, - stderr => vent(), +# stderr => vent(), ); $rev_list->output($local_peer->torrent->plumb( - [ 'pack-objects', '--stdout' ], - stderr => vent(), + [ 'pack-objects', '--stdout', '-q' ], +# stderr => vent(), )); $pack = $rev_list->terminus->contents; -- 2.11.4.GIT