ebuild_portdir = os.path.realpath(
os.path.dirname(os.path.dirname(os.path.dirname(ebuild))))
ebuild = os.path.join(ebuild_portdir, *ebuild.split(os.path.sep)[-3:])
-vdb_path = os.path.join(portage.settings['ROOT'], VDB_PATH)
+vdb_path = os.path.join(portage.settings['EROOT'], VDB_PATH)
# Make sure that portdb.findname() returns the correct ebuild.
if ebuild_portdir != vdb_path and \
print("!!! %s does not follow correct package syntax." % (cpv))
sys.exit(1)
-if ebuild.startswith(os.path.join(portage.root, portage.const.VDB_PATH)):
+if ebuild.startswith(vdb_path):
mytree = "vartree"
portage_ebuild = portage.db[portage.root][mytree].dbapi.findname(cpv)