diff options
author | 2013-09-11 09:09:15 +0200 | |
---|---|---|
committer | 2013-09-11 09:09:15 +0200 | |
commit | 8912c242402f6a14ae31857bb4b75d950a371b06 (patch) | |
tree | c0ccb3062ed73e183db337606b043bd6bc197db9 /Portage.pm | |
parent | Portage.pm: Use portageq to determine not only EPREFIX, but PORTDIR and PORTD... (diff) | |
download | ufed-8912c242402f6a14ae31857bb4b75d950a371b06.tar.gz ufed-8912c242402f6a14ae31857bb4b75d950a371b06.tar.bz2 ufed-8912c242402f6a14ae31857bb4b75d950a371b06.zip |
Updated the fix for bug #478318 - It is more reliable now.
Diffstat (limited to 'Portage.pm')
-rw-r--r-- | Portage.pm | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -264,24 +264,28 @@ sub _add_temp } -# Determine the value for EPREFIX and save it -# in $_EPREFIX. This is done using 'portageq'. +# Determine the values for EPREFIX, PORTDIR +# and PORTDIR_OVERLAY. These are saved in +# $_EPREFIX, $_PORTDIR and $_PORTDIR_OVERLAY. +# This is done using 'portageq'. # Other output from portageq is printed on # STDERR. # No parameters accepted. sub _determine_eprefix_portdir { my $tmp = "/tmp/ufed_$$.tmp"; my @res = map { - my $x=$_; + my $x = $_; chomp $x; - $x =~ s/^.*'([^']*)'.*$/$1/; + $x =~ s/'//g; $x } qx{portageq envvar -v EPREFIX PORTDIR PORTDIR_OVERLAY 2>$tmp}; - if (scalar @res) { - $_EPREFIX = $res[0]; - $_PORTDIR = $res[1]; - $_PORTDIR_OVERLAY = $res[2]; + while (my $res = shift @res) { + if ($res =~ /^(.*)=(.*)$/) { + "EPREFIX" eq $1 and $_EPREFIX = $2; + "PORTDIR" eq $1 and $_PORTDIR = $2; + "PORTDIR_OVERLAY" eq $1 and $_PORTDIR_OVERLAY = $2; + } debugMsg("EPREFIX='${_EPREFIX}'"); debugMsg("PORTDIR='${_PORTDIR}'"); debugMsg("PORTDIR_OVERLAY='${_PORTDIR_OVERLAY}'"); @@ -296,7 +300,6 @@ sub _determine_eprefix_portdir { } -e $tmp and unlink $tmp; - chomp($_EPREFIX); return; } |