Bug #268724 - Show a warning message for --unmerge operations and suggest
authorZac Medico <zmedico@gentoo.org>
Tue, 2 Mar 2010 20:38:11 +0000 (20:38 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 2 Mar 2010 20:38:11 +0000 (20:38 -0000)
--depclean <atom> instead. (trunk r15393)

svn path=/main/branches/2.1.7/; revision=15615

pym/_emerge/actions.py

index 66a47da8f69b072cbcea16bc28b00417fbd07be4..b9a5b1c53b15a3a4ed0dc038dc9c5b76f758c495 100644 (file)
@@ -2104,6 +2104,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.