From: Vincent Pit Date: Thu, 16 Dec 2010 13:52:51 +0000 (+0100) Subject: Abort completely when IPC::Cmd can't capture buffers X-Git-Tag: v0.11~1 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=4833def75ffdc1fbaa90242f72cc42c4feb0eac3;p=perl%2Fmodules%2FCPANPLUS-Dist-Gentoo.git Abort completely when IPC::Cmd can't capture buffers --- diff --git a/lib/CPANPLUS/Dist/Gentoo.pm b/lib/CPANPLUS/Dist/Gentoo.pm index 73c6197..9a41af6 100644 --- a/lib/CPANPLUS/Dist/Gentoo.pm +++ b/lib/CPANPLUS/Dist/Gentoo.pm @@ -223,6 +223,15 @@ my $format_available; sub format_available { return $format_available if defined $format_available; + unless (IPC::Cmd->can_capture_buffer) { + my $msg = 'IPC::Cmd must be able to capture buffers.'; + unless (do { local $@; eval { require IPC::Run; 1 } }) { + $msg .= ' Try installing IPC::Run (dev-perl/IPC-Run on Gentoo).'; + } + __PACKAGE__->_abort($msg); + return $format_available = 0; + } + for my $prog (qw) { unless (IPC::Cmd::can_run($prog)) { __PACKAGE__->_abort("$prog is required to write ebuilds"); @@ -230,7 +239,7 @@ sub format_available { } } - if (IPC::Cmd->can_capture_buffer) { + { my $buffers; my ($success, $errmsg) = IPC::Cmd::run( command => [ qw ],