From 7344c6b7476d29d2655c805771d69f268042a615 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 14 Feb 2008 07:30:57 +0000 Subject: 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 --- pym/_emerge/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'pym/_emerge') 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) -- cgit v1.2.3-1-g7c22