summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-10-05 20:06:04 -0700
committerZac Medico <zmedico@gentoo.org>2010-10-05 20:06:04 -0700
commit565d525f20d4390299bd8037e990968ef1f299c1 (patch)
tree1ab6471aab9f15b661ad8ecef575697feba3cf99
parentd4e73f691a2d6ffa045f8c8eaaa81875f6c96273 (diff)
downloadportage-565d525f20d4390299bd8037e990968ef1f299c1.tar.gz
portage-565d525f20d4390299bd8037e990968ef1f299c1.tar.bz2
portage-565d525f20d4390299bd8037e990968ef1f299c1.zip
Fix ebuild(1) to handle layout.conf masters.
-rwxr-xr-xbin/ebuild14
1 files changed, 9 insertions, 5 deletions
diff --git a/bin/ebuild b/bin/ebuild
index 12375a55d..ae793ac4d 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -149,9 +149,13 @@ if ebuild_portdir != vdb_path and \
print("Appending %s to PORTDIR_OVERLAY..." % ebuild_portdir)
portage.close_portdbapi_caches()
imp.reload(portage)
-del portage.portdb.porttrees[1:]
-if ebuild_portdir != portage.portdb.porttree_root:
- portage.portdb.porttrees.append(ebuild_portdir)
+
+# Constrain eclass resolution to the master(s)
+# that are specified in layout.conf (using an
+# approach similar to repoman's).
+myrepo = portage.portdb.getRepositoryName(ebuild_portdir)
+repo_info = portage.portdb._repo_info[ebuild_portdir]
+portage.portdb.porttrees = list(repo_info.eclass_db.porttrees)
if not os.path.exists(ebuild):
print("'%s' does not exist." % ebuild)
@@ -167,7 +171,7 @@ if not portage.catpkgsplit(cpv):
if ebuild.startswith(vdb_path):
mytree = "vartree"
- portage_ebuild = portage.db[portage.root][mytree].dbapi.findname(cpv)
+ portage_ebuild = portage.db[portage.root][mytree].dbapi.findname(cpv, myrepo=myrepo)
if os.path.realpath(portage_ebuild) != ebuild:
print("!!! Portage seems to think that %s is at %s" % (cpv, portage_ebuild))
@@ -176,7 +180,7 @@ if ebuild.startswith(vdb_path):
else:
mytree = "porttree"
- portage_ebuild = portage.portdb.findname(cpv)
+ portage_ebuild = portage.portdb.findname(cpv, myrepo=myrepo)
if not portage_ebuild or portage_ebuild != ebuild:
print("!!! %s does not seem to have a valid PORTDIR structure." % ebuild)