summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-03-26 00:38:23 -0700
committerZac Medico <zmedico@gentoo.org>2011-03-26 00:38:23 -0700
commita1a23d2bc25a324b24c180dc982d9442229dc9eb (patch)
tree97b73db4b8837931808785c77ed1582d1a39589a
parentdc6a4c122e827baf28729caf2dbb32576072d88f (diff)
downloadportage-a1a23d2bc25a324b24c180dc982d9442229dc9eb.tar.gz
portage-a1a23d2bc25a324b24c180dc982d9442229dc9eb.tar.bz2
portage-a1a23d2bc25a324b24c180dc982d9442229dc9eb.zip
unmerge: fix PORTAGE_BACKGROUND logic
-rw-r--r--pym/_emerge/actions.py7
-rw-r--r--pym/portage/dbapi/vartree.py13
2 files changed, 15 insertions, 5 deletions
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index f79f9279d..53d18804f 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2623,6 +2623,13 @@ def action_uninstall(settings, trees, ldpath_mtimes,
sched._background = sched._background_mode()
sched._status_display.quiet = True
+ if sched._background:
+ sched.settings.unlock()
+ sched.settings["PORTAGE_BACKGROUND"] = "1"
+ sched.settings.backup_changes("PORTAGE_BACKGROUND")
+ sched.settings.lock()
+ sched.pkgsettings[root] = portage.config(clone=sched.settings)
+
if action in ('clean', 'unmerge') or \
(action == 'prune' and "--nodeps" in opts):
# When given a list of atoms, unmerge them in the order given.
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index c90d86b63..98f578f43 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -1477,12 +1477,15 @@ class dblink(object):
# We create a scheduler instance and use it to
# log unmerge output separately from merge output.
self._scheduler = PollScheduler().sched_iface
- if self.settings.get("PORTAGE_BACKGROUND_UNMERGE") == "1":
- self.settings["PORTAGE_BACKGROUND"] = "1"
- self.settings.backup_changes("PORTAGE_BACKGROUND")
+ if self.settings.get("PORTAGE_BACKGROUND") == "subprocess":
+ if self.settings.get("PORTAGE_BACKGROUND_UNMERGE") == "1":
+ self.settings["PORTAGE_BACKGROUND"] = "1"
+ self.settings.backup_changes("PORTAGE_BACKGROUND")
+ background = True
+ else:
+ self.settings.pop("PORTAGE_BACKGROUND", None)
+ elif self.settings.get("PORTAGE_BACKGROUND") == "1":
background = True
- else:
- self.settings.pop("PORTAGE_BACKGROUND", None)
self.vartree.dbapi._bump_mtime(self.mycpv)
showMessage = self._display_merge