summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-09-21 20:03:03 -0700
committerZac Medico <zmedico@gentoo.org>2011-09-21 20:03:03 -0700
commitc85965f6d0493bab84d6b7a615d39678df9d53ba (patch)
tree4be58dc6c27df65159b02cfba9ec45d91d8b9ac6 /pym
parent339b0ac7f3b1f5e82b427a3cde6c021c406d5b71 (diff)
downloadportage-c85965f6d0493bab84d6b7a615d39678df9d53ba.tar.gz
portage-c85965f6d0493bab84d6b7a615d39678df9d53ba.tar.bz2
portage-c85965f6d0493bab84d6b7a615d39678df9d53ba.zip
Tweak automatic --binpkg-respect-use behavior.
If --binpkg-respect-use is not explicitly specified, we enable the behavior automatically (like requested in bug #297549), as long as it doesn't strongly conflict with other options that have been specified. Strongly conflicting options currently include --usepkgonly and --rebuilt-binaries.
Diffstat (limited to 'pym')
-rw-r--r--pym/_emerge/create_depgraph_params.py11
-rw-r--r--pym/_emerge/depgraph.py9
-rw-r--r--pym/_emerge/main.py9
3 files changed, 22 insertions, 7 deletions
diff --git a/pym/_emerge/create_depgraph_params.py b/pym/_emerge/create_depgraph_params.py
index 221c440ef..d94ad89b3 100644
--- a/pym/_emerge/create_depgraph_params.py
+++ b/pym/_emerge/create_depgraph_params.py
@@ -64,6 +64,17 @@ def create_depgraph_params(myopts, myaction):
'--update' in myopts:
myparams['rebuilt_binaries'] = True
+ binpkg_respect_use = myopts.get('--binpkg-respect-use')
+ if binpkg_respect_use is not None:
+ myparams['binpkg_respect_use'] = binpkg_respect_use
+ elif '--usepkgonly' not in myopts and \
+ myopts.get('--rebuilt-binaries') is not True:
+ # If --binpkg-respect-use is not explicitly specified, we enable
+ # the behavior automatically (like requested in bug #297549), as
+ # long as it doesn't strongly conflict with other options that
+ # have been specified.
+ myparams['binpkg_respect_use'] = 'auto'
+
if myopts.get("--selective") == "n":
# --selective=n can be used to remove selective
# behavior that may have been implied by some
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index e8d96f4fe..a4f6c3ddc 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -552,7 +552,8 @@ class depgraph(object):
"""
if not self._dynamic_config.ignored_binaries \
or '--quiet' in self._frozen_config.myopts \
- or "--binpkg-respect-use" in self._frozen_config.myopts:
+ or self._dynamic_config.myparams.get(
+ "binpkg_respect_use") in ("y", "n"):
return
self._show_merge_list()
@@ -796,7 +797,8 @@ class depgraph(object):
"""Return a set of flags that trigger reinstallation, or None if there
are no such flags."""
if "--newuse" in self._frozen_config.myopts or \
- self._frozen_config.myopts.get("--binpkg-respect-use", True) == True:
+ self._dynamic_config.myparams.get(
+ "binpkg_respect_use") in ("y", "auto"):
flags = set(orig_iuse.symmetric_difference(
cur_iuse).difference(forced_flags))
flags.update(orig_iuse.intersection(orig_use).symmetric_difference(
@@ -3967,7 +3969,8 @@ class depgraph(object):
if built and not useoldpkg and (not installed or matched_pkgs_ignore_use) and \
("--newuse" in self._frozen_config.myopts or \
"--reinstall" in self._frozen_config.myopts or \
- self._frozen_config.myopts.get("--binpkg-respect-use", True) == True):
+ (not installed and self._dynamic_config.myparams.get(
+ "binpkg_respect_use") in ("y", "auto"))):
iuses = pkg.iuse.all
old_use = self._pkg_use_enabled(pkg)
if myeb:
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index d2fc0ac5f..f4ea36c7b 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -968,10 +968,11 @@ def parse_opts(tmpcmdline, silent=False):
if myoptions.deselect in true_y:
myoptions.deselect = True
- if myoptions.binpkg_respect_use in true_y:
- myoptions.binpkg_respect_use = True
- else:
- myoptions.binpkg_respect_use = None
+ if myoptions.binpkg_respect_use is not None:
+ if myoptions.binpkg_respect_use in true_y:
+ myoptions.binpkg_respect_use = 'y'
+ else:
+ myoptions.binpkg_respect_use = 'n'
if myoptions.complete_graph in true_y:
myoptions.complete_graph = True