From eb1931d628dcd4517965238a5558f8bbc0859960 Mon Sep 17 00:00:00 2001 From: Paul Varner Date: Tue, 10 Sep 2013 18:00:47 -0500 Subject: Add fallback to using portageq for get_portdir function. Newer versions of portage no longer define PORTDIR in make.defaults or make.conf. This change uses portageq to get the value of PORTDIR if it is not found in make.defaults or make.conf. --- bin/euse | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'bin') diff --git a/bin/euse b/bin/euse index 7efb03f..96d1f9b 100755 --- a/bin/euse +++ b/bin/euse @@ -712,6 +712,10 @@ get_flagstatus_pkg() { # # Outputs: # Location of portage tree root +# +# OBSOLETE: newer versions of portage do not define PORTDIR +# in make.defaults or make.conf anymore. Add fallback to +#portageq to handle that situation. get_portdir() { # Use a subshell so we don't have to protect the variables in # the current scope @@ -725,6 +729,10 @@ get_portdir() { source "${x}" done fi + + if [ -z "${PORTDIR:-}" ]; then + eval $(portageq envvar -v PORTDIR) + fi echo "${PORTDIR}" ) } # }}} -- cgit v1.2.3-65-gdbad