}
if (IPC::Cmd->can_capture_buffer) {
- my ($success, $errmsg, $output) = run command => [ qw/emerge --info/ ],
- verbose => 0;
+ my $buffers;
+ my ($success, $errmsg) = run command => [ qw/emerge --info/ ],
+ verbose => 0,
+ buffer => \$buffers;
if ($success) {
- for (@{$output || []}) {
- if (/^PORTDIR_OVERLAY=(.*)$/m) {
- $overlays = [ map abs_path($_), split ' ', _unquote($1) ];
- }
- if (/^ACCEPT_KEYWORDS=(.*)$/m) {
- $default_keywords = [ split ' ', _unquote($1) ];
- }
- if (/^DISTDIR=(.*)$/m) {
- $default_distdir = abs_path(_unquote($1));
- }
- if (/^PORTDIR=(.*)$/m) {
- $main_portdir = abs_path(_unquote($1));
- }
+ if ($buffers =~ /^PORTDIR_OVERLAY=(.*)$/m) {
+ $overlays = [ map 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));
+ }
+ if ($buffers =~ /^PORTDIR=(.*)$/m) {
+ $main_portdir = abs_path(_unquote($1));
}
} else {
error $errmsg;