Add --ask support to action_deselect(). (trunk r13365)
authorZac Medico <zmedico@gentoo.org>
Thu, 30 Apr 2009 07:19:32 +0000 (07:19 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 30 Apr 2009 07:19:32 +0000 (07:19 -0000)
svn path=/main/branches/2.1.6/; revision=13521

pym/_emerge/__init__.py

index 7d22e0277a082e3c41ba48a6992e18b2cf393433..53e14db13e235c44aa2f60644c838401cc815d92 100644 (file)
@@ -13911,6 +13911,13 @@ def action_deselect(settings, trees, opts, atoms):
                        for atom in sorted(discard_atoms):
                                print ">>> Removing %s from \"world\" favorites file..." % \
                                        colorize("INFORM", str(atom))
+
+                       if '--ask' in opts:
+                               prompt = "Would you like to remove these " + \
+                                       "packages from your world favorites?"
+                               if userquery(prompt) == 'No':
+                                       return os.EX_OK
+
                        remaining = set(world_set)
                        remaining.difference_update(discard_atoms)
                        if not pretend: