aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-03-21 07:16:54 (GMT)
committerZac Medico <zmedico@gentoo.org>2012-03-21 07:16:54 (GMT)
commit500e0567432019835ef56e69d60266f9189c6700 (patch)
treefd99ce199f8ccd51a01e90ca842662824ecccfd7
parentdoebuild_environment: comment on bug #408817 (diff)
downloadportage-500e0567432019835ef56e69d60266f9189c6700.zip
portage-500e0567432019835ef56e69d60266f9189c6700.tar.gz
portage-500e0567432019835ef56e69d60266f9189c6700.tar.bz2
Map emerge --buildpkg=n to FEATURES=-buildpkg.
This will fix bug #409085.
-rw-r--r--pym/_emerge/EbuildBuild.py5
-rw-r--r--pym/_emerge/Scheduler.py2
-rw-r--r--pym/_emerge/actions.py5
-rw-r--r--pym/_emerge/main.py2
4 files changed, 8 insertions, 6 deletions
diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index 27aa7ca..784a3e2 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -228,9 +228,10 @@ class EbuildBuild(CompositeTask):
#buildsyspkg: Check if we need to _force_ binary package creation
self._issyspkg = "buildsyspkg" in features and \
system_set.findAtomForPackage(pkg) and \
- not opts.buildpkg
+ "buildpkg" not in features and \
+ opts.buildpkg != 'n'
- if (opts.buildpkg or "buildpkg" in features or self._issyspkg) \
+ if ("buildpkg" in features or self._issyspkg) \
and not self.opts.buildpkg_exclude.findAtomForPackage(pkg):
self._buildpkg = True
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 62b3589..bde6cf3 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -155,7 +155,7 @@ class Scheduler(PollScheduler):
self._build_opts = self._build_opts_class()
for k in self._build_opts.__slots__:
- setattr(self._build_opts, k, "--" + k.replace("_", "-") in myopts)
+ setattr(self._build_opts, k, myopts.get("--" + k.replace("_", "-")))
self._build_opts.buildpkg_exclude = InternalPackageSet( \
initial_atoms=" ".join(myopts.get("--buildpkg-exclude", [])).split(), \
allow_wildcard=True, allow_repo=True)
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 090d9e1..cd3fd9f 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2727,8 +2727,11 @@ def adjust_config(myopts, settings):
settings["EMERGE_WARNING_DELAY"] = str(EMERGE_WARNING_DELAY)
settings.backup_changes("EMERGE_WARNING_DELAY")
- if "--buildpkg" in myopts:
+ buildpkg = myopts.get("--buildpkg")
+ if buildpkg is True:
settings.features.add("buildpkg")
+ elif buildpkg == 'n':
+ settings.features.discard("buildpkg")
if "--quiet" in myopts:
settings["PORTAGE_QUIET"]="1"
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index c1adced..cf5f332 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1005,8 +1005,6 @@ def parse_opts(tmpcmdline, silent=False):
if myoptions.buildpkg in true_y:
myoptions.buildpkg = True
- else:
- myoptions.buildpkg = None
if myoptions.buildpkg_exclude:
bad_atoms = _find_bad_atoms(myoptions.buildpkg_exclude, less_strict=True)