diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-11-18 13:28:36 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-11-18 13:28:36 +0000 |
commit | 221fcbcdb9a33081269f0ecdf6428b67705f029b (patch) | |
tree | fb71f6f5e6528283953215461193021aad155f7c | |
parent | c87889cb59a1ac1125328c90834b0c3860985b24 (diff) | |
download | portage-221fcbcdb9a33081269f0ecdf6428b67705f029b.tar.gz portage-221fcbcdb9a33081269f0ecdf6428b67705f029b.tar.bz2 portage-221fcbcdb9a33081269f0ecdf6428b67705f029b.zip |
For bug #155559, force depclean dep_check calls to preference installed packages.
svn path=/main/trunk/; revision=5085
-rwxr-xr-x | bin/emerge | 16 |
1 files changed, 16 insertions, 0 deletions
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" |