Fix ebuild(1) to handle layout.conf masters.
authorZac Medico <zmedico@gentoo.org>
Wed, 6 Oct 2010 03:06:04 +0000 (20:06 -0700)
committerZac Medico <zmedico@gentoo.org>
Wed, 6 Oct 2010 23:25:41 +0000 (16:25 -0700)
bin/ebuild

index 12375a55dd17ac571cf39a879910f0b8ea7b498c..d8ab5ef121eb3209be5e7f55d6ca4ec3de7f1d99 100755 (executable)
@@ -149,9 +149,12 @@ 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).
+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)