commit:     107dca9a3171e4870038769aef66612209ecd423
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue May  1 17:27:06 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue May  1 17:27:06 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=107dca9a

QueryCommand: handle empty *ROOT values for EAPI 7

The absence of a trailing slash in EAPI 7 means that it's
valid for *ROOT values to be empty, so translate the empty
value to a single slash where appropriate. This solves
errors like the following:

    best_version: Invalid ROOT: ./

See: 6cb70f9ef0e7 ("Strip trailing slash from D, ED, ROOT, EROOT in EAPI 7")

 pym/portage/package/ebuild/_ipc/QueryCommand.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/portage/package/ebuild/_ipc/QueryCommand.py 
b/pym/portage/package/ebuild/_ipc/QueryCommand.py
index 351c95628..fa6d1ea16 100644
--- a/pym/portage/package/ebuild/_ipc/QueryCommand.py
+++ b/pym/portage/package/ebuild/_ipc/QueryCommand.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2013 Gentoo Foundation
+# Copyright 2010-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import unicode_literals
@@ -49,7 +49,7 @@ class QueryCommand(IpcCommand):
                db = self.get_db()
                eapi = self.settings.get('EAPI')
 
-               root = normalize_path(root).rstrip(os.path.sep) + os.path.sep
+               root = normalize_path(root or os.sep).rstrip(os.sep) + os.sep
                if root not in db:
                        return ('', '%s: Invalid ROOT: %s\n' % (cmd, root), 3)
 

Reply via email to