summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-01-18 15:28:49 -0800
committerZac Medico <zmedico@gentoo.org>2011-01-18 15:28:49 -0800
commitd0b573483ee7460df5f139e407d08835af6dce3f (patch)
treebb1b8f2c73ca5bf3be884c6af7a0c64c086073c6
parentfd66b004d8b562813993a580591a76e7ea6ea9ce (diff)
downloadportage-d0b573483ee7460df5f139e407d08835af6dce3f.tar.gz
portage-d0b573483ee7460df5f139e407d08835af6dce3f.tar.bz2
portage-d0b573483ee7460df5f139e407d08835af6dce3f.zip
depgraph: avoid updates more
The fix from bug #351828 broke some of the update avoidance behavior from bug #275945, and this patch should restore it.
-rw-r--r--pym/_emerge/depgraph.py23
-rw-r--r--pym/portage/tests/resolver/test_simple.py5
2 files changed, 15 insertions, 13 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index a6f17dbd2..737547626 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2954,7 +2954,8 @@ class depgraph(object):
continue
reinstall_for_flags = None
- if not pkg.installed or matched_packages:
+ if not pkg.installed or \
+ (matched_packages and not avoid_update):
# Only enforce visibility on installed packages
# if there is at least one other visible package
# available. By filtering installed masked packages
@@ -5486,18 +5487,22 @@ class _dep_check_composite_db(dbapi):
myopts = self._depgraph._frozen_config.myopts
use_ebuild_visibility = myopts.get(
'--use-ebuild-visibility', 'n') != 'n'
+ avoid_update = "--update" not in myopts and \
+ "remove" not in self._depgraph._dynamic_config.myparams
usepkgonly = "--usepkgonly" in myopts
- if not use_ebuild_visibility and usepkgonly:
- return False
- else:
- try:
- pkg_eb = self._depgraph._pkg(
- pkg.cpv, "ebuild", pkg.root_config, myrepo=pkg.repo)
- except portage.exception.PackageNotFound:
+ if not avoid_update:
+ if not use_ebuild_visibility and usepkgonly:
return False
else:
- if not self._depgraph._pkg_visibility_check(pkg_eb):
+ try:
+ pkg_eb = self._depgraph._pkg(
+ pkg.cpv, "ebuild", pkg.root_config,
+ myrepo=pkg.repo)
+ except portage.exception.PackageNotFound:
return False
+ else:
+ if not self._depgraph._pkg_visibility_check(pkg_eb):
+ return False
in_graph = self._depgraph._dynamic_config._slot_pkg_map[
self._root].get(pkg.slot_atom)
diff --git a/pym/portage/tests/resolver/test_simple.py b/pym/portage/tests/resolver/test_simple.py
index c3ca9f4d5..b8d403db4 100644
--- a/pym/portage/tests/resolver/test_simple.py
+++ b/pym/portage/tests/resolver/test_simple.py
@@ -31,14 +31,11 @@ class SimpleResolverTestCase(TestCase):
options = {"--noreplace": True},
success = True,
mergelist = []),
-
- # This triggers a replacement since the dev-libs/B-1.1 ebuild
- # is not available in the portage tree (see bug #351828).
ResolverPlaygroundTestCase(
["dev-libs/B"],
options = {"--noreplace": True},
success = True,
- mergelist = ["dev-libs/B-1.2"]),
+ mergelist = []),
ResolverPlaygroundTestCase(
["dev-libs/B"],
options = {"--update": True},