unmerge: fix PORTAGE_BACKGROUND logic
authorZac Medico <zmedico@gentoo.org>
Sat, 26 Mar 2011 07:38:23 +0000 (00:38 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 26 Mar 2011 07:38:23 +0000 (00:38 -0700)
pym/_emerge/actions.py
pym/portage/dbapi/vartree.py

index f79f9279d0e11c5a5d88b443db1db84145d52a11..53d18804f143950f6abd5907ab9955f7e486177e 100644 (file)
@@ -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.
index c90d86b63a9c1c574c3eb6e6afb0f00e9de269d6..98f578f4395658e9418f032a4dc77f3547788a6d 100644 (file)
@@ -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