use strict;
use warnings;
-use Cwd qw/abs_path/;
+use Cwd ();
use List::Util qw/reduce/;
use File::Copy ();
use File::Path ();
use File::Spec;
-use IPC::Cmd qw/run can_run/;
+use IPC::Cmd ();
use Parse::CPAN::Meta ();
use CPANPLUS::Error ();
return $format_available if defined $format_available;
for my $prog (qw/emerge ebuild/) {
- unless (can_run($prog)) {
+ unless (IPC::Cmd::can_run($prog)) {
__PACKAGE__->_abort("$prog is required to write ebuilds");
return $format_available = 0;
}
if (IPC::Cmd->can_capture_buffer) {
my $buffers;
- my ($success, $errmsg) = run command => [ qw/emerge --info/ ],
- verbose => 0,
- buffer => \$buffers;
+ my ($success, $errmsg) = IPC::Cmd::run(
+ command => [ qw/emerge --info/ ],
+ verbose => 0,
+ buffer => \$buffers,
+ );
if ($success) {
if ($buffers =~ /^PORTDIR_OVERLAY=(.*)$/m) {
- $overlays = [ map abs_path($_), split ' ', $unquote->($1) ];
+ $overlays = [ map Cwd::abs_path($_), split ' ', $unquote->($1) ];
}
if ($buffers =~ /^ACCEPT_KEYWORDS=(.*)$/m) {
$default_keywords = [ split ' ', $unquote->($1) ];
}
if ($buffers =~ /^DISTDIR=(.*)$/m) {
- $default_distdir = abs_path($unquote->($1));
+ $default_distdir = Cwd::abs_path($unquote->($1));
}
if ($buffers =~ /^PORTDIR=(.*)$/m) {
- $main_portdir = abs_path($unquote->($1));
+ $main_portdir = Cwd::abs_path($unquote->($1));
}
} else {
__PACKAGE__->_abort($errmsg);
$stat->footer($footer);
my $overlay = delete $opts{overlay};
- $overlay = (defined $overlay) ? abs_path $overlay : '/usr/local/portage';
+ $overlay = (defined $overlay) ? Cwd::abs_path($overlay) : '/usr/local/portage';
$stat->overlay($overlay);
my $distdir = delete $opts{distdir};
- $distdir = (defined $distdir) ? abs_path $distdir : $default_distdir;
+ $distdir = (defined $distdir) ? Cwd::abs_path($distdir) : $default_distdir;
$stat->distdir($distdir);
return $FAIL->("distdir isn't writable") if $stat->do_manifest && !-w $distdir;
my ($success, $errmsg, $output) = do {
local $ENV{PORTDIR_OVERLAY} = join ' ', @{$stat->portdir_overlay};
local $ENV{PORTAGE_RO_DISTDIRS} = $stat->distdir;
- run command => $cmd, verbose => $verbose;
+ IPC::Cmd::run(
+ command => $cmd,
+ verbose => $verbose,
+ );
};
unless ($success) {