summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-02-14 07:30:57 +0000
committerZac Medico <zmedico@gentoo.org>2008-02-14 07:30:57 +0000
commit7344c6b7476d29d2655c805771d69f268042a615 (patch)
tree46e54b84d2fbdd1b24fb10ac8abeb29bc7624793
parent78a733f6f39e17b72194c1e2dd21d3920ed018e2 (diff)
downloadportage-7344c6b7476d29d2655c805771d69f268042a615.tar.gz
portage-7344c6b7476d29d2655c805771d69f268042a615.tar.bz2
portage-7344c6b7476d29d2655c805771d69f268042a615.zip
Fix package selection logic in order to prevent downgrade in cases
when selective is True and the currently installed version does not have a matching ebuild in the tree. For example, this type of situation is likely to occur if the user somehow obtains a binary package that has a newer version than any of the ebuilds in the portage tree. If package maintainers want to encourage a downgrade in a case like this then they should use package.mask so that the user receives a warning about the installed package being masked. svn path=/main/trunk/; revision=9336
-rw-r--r--pym/_emerge/__init__.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index e5e48fe48..d16c4fc20 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -2514,10 +2514,12 @@ class depgraph(object):
for db, pkg_type, built, installed, db_keys in dbs:
if existing_node:
break
- if installed and not find_existing_node and \
+ if not selective and installed and not find_existing_node and \
(matched_packages or empty):
- # We only need to select an installed package here
- # if there is no other choice.
+ # We only need to select an installed package in the
+ # following cases:
+ # 1) there is no other choice
+ # 2) selective is True
continue
if hasattr(db, "xmatch"):
cpv_list = db.xmatch("match-all", atom)