summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico2011-08-31 02:31:48 (GMT)
committerZac Medico2011-08-31 02:31:48 (GMT)
commitc47394cb28a841d5b7399f548c2507a85a158bdd (patch)
tree36be505a630206827c6919dea4f6d93468b44763
parentc7ff6c61e86127068ba6abe6aaa094e56c2d7555 (diff)
Respect package.env buildpkg FEATURES settings.
This will fix bug #318897.
-rw-r--r--pym/_emerge/EbuildBuild.py2
-rw-r--r--pym/_emerge/actions.py3
-rw-r--r--pym/_emerge/main.py8
3 files changed, 9 insertions, 4 deletions
diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index 0144cfc..2b0f412 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -225,7 +225,7 @@ class EbuildBuild(CompositeTask):
system_set.findAtomForPackage(pkg) and \
not opts.buildpkg
- if opts.buildpkg or self._issyspkg:
+ if opts.buildpkg or "buildpkg" in features or self._issyspkg:
self._buildpkg = True
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 882a2db..3477c19 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2731,6 +2731,9 @@ def adjust_config(myopts, settings):
settings["EMERGE_WARNING_DELAY"] = str(EMERGE_WARNING_DELAY)
settings.backup_changes("EMERGE_WARNING_DELAY")
+ if "--buildpkg" in myopts:
+ settings.features.add("buildpkg")
+
if "--quiet" in myopts or "--quiet-build" in myopts:
settings["PORTAGE_QUIET"]="1"
settings.backup_changes("PORTAGE_QUIET")
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 84c4c58..343fd58 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1545,6 +1545,11 @@ def emerge_main(args=None):
settings, trees, mtimedb = load_emerge_config(trees=trees)
portdb = trees[settings["ROOT"]]["porttree"].dbapi
+ # NOTE: adjust_configs() can map options to FEATURES, so any relevant
+ # options adjustments should be made prior to calling adjust_configs().
+ if "--buildpkgonly" in myopts:
+ myopts["--buildpkg"] = True
+
adjust_configs(myopts, trees)
apply_priorities(settings)
@@ -1587,9 +1592,6 @@ def emerge_main(args=None):
if "--usepkgonly" in myopts:
myopts["--usepkg"] = True
- if "buildpkg" in settings.features or "--buildpkgonly" in myopts:
- myopts["--buildpkg"] = True
-
if "--buildpkgonly" in myopts:
# --buildpkgonly will not merge anything, so
# it cancels all binary package options.