X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FCPANPLUS%2FDist%2FGentoo.pm;h=7f138049d1e21dc72a317d52e20a18292c729d9a;hb=02fbb17472e55a0862fea51d8f4e530a9af9153c;hp=2cd8ddf2c32894656bf92ca2b452ee6b10d9296c;hpb=c85d441c1d1774095779a648ae6156d73d0324e4;p=perl%2Fmodules%2FCPANPLUS-Dist-Gentoo.git diff --git a/lib/CPANPLUS/Dist/Gentoo.pm b/lib/CPANPLUS/Dist/Gentoo.pm index 2cd8ddf..7f13804 100644 --- a/lib/CPANPLUS/Dist/Gentoo.pm +++ b/lib/CPANPLUS/Dist/Gentoo.pm @@ -66,17 +66,19 @@ sub format_available { } if (IPC::Cmd->can_capture_buffer) { - my $output = ''; - my $success = run command => [ qw/emerge --info/ ], - verbose => 0, - buffer => \$output; - if ($success and $output) { - if ($output =~ /^PORTDIR_OVERLAY=(.*)$/m) { - my $o = $1; - $o =~ s/^["']*//; - $o =~ s/["']*$//; - $overlays = [ map abs_path($_), grep length, split /:/, $o ]; + my ($success, $errmsg, $output) = run command => [ qw/emerge --info/ ], + verbose => 0; + if ($success) { + for (@{$output || []}) { + if (/^PORTDIR_OVERLAY=(.*)$/m) { + my $o = $1; + $o =~ s/^["']*//; + $o =~ s/["']*$//; + $overlays = [ map abs_path($_), grep length, split /:/, $o ]; + } } + } else { + error $errmsg; } } @@ -266,6 +268,8 @@ sub prepare { my $file = catfile($stat->eb_dir, $stat->eb_name . '-' . $stat->eb_version . '.ebuild'); + $stat->eb_file($file); + if (-e $file) { my $skip = 1; if ($stat->force) { @@ -285,7 +289,6 @@ sub prepare { return 1; } } - $stat->eb_file($file); $self->SUPER::prepare(%opts);