From ef98d53989ed79e668d9ebfd06bd2aca69412c1f Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 13 Sep 2010 16:43:39 -0700 Subject: [PATCH] In depgraph._load_vdb(), after calling FakeVartree.sync(), update self._frozen_config.pkgsettings so that it has populated virtuals. This solves allows us to avoid triggering an AssertionError reported at http://forums.gentoo.org/viewtopic-t-844519.html with the following traceback: Calculating dependencies... done! Traceback (most recent call last): File "/usr/bin/emerge", line 43, in retval = emerge_main() File "/usr/lib/portage/pym/_emerge/main.py", line 1683, in emerge_main myopts, myaction, myfiles, spinner) File "/usr/lib/portage/pym/_emerge/actions.py", line 204, in action_build settings, trees, mtimedb, myopts, myparams, spinner) File "/usr/lib/portage/pym/_emerge/depgraph.py", line 6047, in resume_depgraph myparams, spinner) File "/usr/lib/portage/pym/_emerge/depgraph.py", line 6070, in _resume_depgraph skip_masked=skip_masked) File "/usr/lib/portage/pym/_emerge/depgraph.py", line 5617, in _loadResumeCommand if not self._add_pkg(task, None): File "/usr/lib/portage/pym/_emerge/depgraph.py", line 893, in _add_pkg pkgsettings.setinst(pkg.cpv, pkg.metadata) File "/usr/lib/portage/pym/portage/package/ebuild/config.py", line 1757, in setinst self._virtuals_manager.add_depgraph_virtuals(mycpv, virts) File "/usr/lib/portage/pym/portage/package/ebuild/_config/VirtualsManager.py", line 199, in add_depgraph_virtuals self.getvirtuals() File "/usr/lib/portage/pym/portage/package/ebuild/_config/VirtualsManager.py", line 156, in getvirtuals self._compile_virtuals() File "/usr/lib/portage/pym/portage/package/ebuild/_config/VirtualsManager.py", line 131, in _compile_virtuals "any query about virtuals" AssertionError: _populate_treeVirtuals() must be called before any query about virtuals --- pym/_emerge/depgraph.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 252975418..b1cbc2b44 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -328,6 +328,11 @@ class depgraph(object): # backtracking depgraphs that share the same frozen_config. fake_vartree.sync() + # FakeVartree.sync() populates virtuals, and we want + # self.pkgsettings to have them populated too. + self._frozen_config.pkgsettings[myroot] = \ + portage.config(clone=fake_vartree.settings) + if preload_installed_pkgs: vardb = fake_vartree.dbapi fakedb = self._dynamic_config._graph_trees[ -- 2.26.2