Bug #268724 - Show a warning message for --unmerge operations and suggest
authorZac Medico <zmedico@gentoo.org>
Fri, 19 Feb 2010 20:21:23 +0000 (20:21 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 19 Feb 2010 20:21:23 +0000 (20:21 -0000)
--depclean <atom> instead.

svn path=/main/trunk/; revision=15393

pym/_emerge/actions.py

index 2def0e89e0c2eea44bf7a2d03ec2baacb3c35f48..702ccff983f80ef530e35feec45a269ac1efc938 100644 (file)
@@ -2280,6 +2280,15 @@ def action_uninstall(settings, trees, ldpath_mtimes,
        if files and not valid_atoms:
                return 1
 
+       if action == 'unmerge' and '--quiet' not in opts:
+               msg = "This action can remove important packages! " + \
+                       "In order to be safer, use " + \
+                       "`emerge -pv --depclean <atom>` to check for " + \
+                       "reverse dependencies before removing packages."
+               out = portage.output.EOutput()
+               for line in textwrap.wrap(msg, 72):
+                       out.ewarn(line)
+
        if action in ('clean', 'unmerge') or \
                (action == 'prune' and "--nodeps" in opts):
                # When given a list of atoms, unmerge them in the order given.