Add --ask support to action_deselect().
authorZac Medico <zmedico@gentoo.org>
Sun, 19 Apr 2009 06:19:24 +0000 (06:19 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 19 Apr 2009 06:19:24 +0000 (06:19 -0000)
svn path=/main/trunk/; revision=13365

pym/_emerge/__init__.py

index 004d13fdf258d5c98d6e5a5de88fb52b651e41b5..38ba1764574234cd7a43f6c520d38e2d0b9c45c7 100644 (file)
@@ -14087,6 +14087,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: