From c646a13990bc1267ab5f557d72f3c02c08be82ad Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 12 Sep 2011 22:22:09 -0700 Subject: ebuild(1): remove unneeded porttrees modification This code should be unnecessary, as long as the repo is correctly identified for all calls to portdbapi methods like aux_get and findname. Notably, config.setcpv() must be called with a Package instance in order to ensure that it gets the metadata from the correct repository. --- bin/ebuild | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/bin/ebuild b/bin/ebuild index 1408dd32e..95f4e15b8 100755 --- a/bin/ebuild +++ b/bin/ebuild @@ -153,14 +153,9 @@ if ebuild_portdir != vdb_path and \ print("Appending %s to PORTDIR_OVERLAY..." % ebuild_portdir) imp.reload(portage) -# Constrain eclass resolution to the master(s) -# that are specified in layout.conf (using an -# approach similar to repoman's). myrepo = None if ebuild_portdir != vdb_path: 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) @@ -282,7 +277,10 @@ pkg = Package(built=(pkg_type != "ebuild"), cpv=cpv, # Apply package.env and repo-level settings. This allows per-package # FEATURES and other variables (possibly PORTAGE_TMPDIR) to be -# available as soon as possible. +# available as soon as possible. Also, note that the only way to ensure +# that setcpv gets metadata from the correct repository is to pass in +# a Package instance, as we do here (previously we had to modify +# portdb.porttrees in order to accomplish this). tmpsettings.setcpv(pkg) def stale_env_warning(): -- cgit v1.2.3-1-g7c22