From 221fcbcdb9a33081269f0ecdf6428b67705f029b Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 18 Nov 2006 13:28:36 +0000 Subject: [PATCH] For bug #155559, force depclean dep_check calls to preference installed packages. svn path=/main/trunk/; revision=5085 --- bin/emerge | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/bin/emerge b/bin/emerge index cfa1b1995..ae2c7a06e 100755 --- a/bin/emerge +++ b/bin/emerge @@ -3887,6 +3887,19 @@ def action_depclean(settings, trees, ldpath_mtimes, unresolveable = {} aux_keys = ["DEPEND", "RDEPEND", "PDEPEND"] + fake_vardb = portage.fakedbapi(settings=settings) + fakedb_auxkeys = aux_keys[:] + fakedb_auxkeys.append("SLOT") + for cpv in myvarlist: + try: + # Prefer live ebuild metadata when available. + aux_vals = portdb.aux_get(cpv, fakedb_auxkeys) + except KeyError: + aux_vals = vardb.aux_get(cpv, fakedb_auxkeys) + fake_vardb.cpv_inject(cpv, metadata=dict(zip(fakedb_auxkeys, aux_vals))) + # HACK: Ensure that installed packages are preferenced by dep_check(). + trees[settings["ROOT"]]["porttree"].dbapi = fake_vardb + while remaining_atoms: atom, parent, priority = remaining_atoms.pop() pkgs = vardb.match(atom) @@ -3920,6 +3933,9 @@ def action_depclean(settings, trees, ldpath_mtimes, for atom in atoms: remaining_atoms.append((atom, pkg, priority)) + # Restore the portdb back to normal (see fake_vardb above). + trees[settings["ROOT"]]["porttree"].dbapi = portdb + if "--quiet" not in myopts: print "\b\b... done!\n" -- 2.26.2