Merged from trunk 7342:7351
authorFabian Groffen <grobian@gentoo.org>
Sun, 22 Jul 2007 09:46:25 +0000 (09:46 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sun, 22 Jul 2007 09:46:25 +0000 (09:46 -0000)
   +------------------------------------------------------------------------+
   | 7343    | Make --prune pull in the system set since that could pull in |
   | zmedico | some slots that wouldn't be pulled in otherwise.             |
   |---------+--------------------------------------------------------------|
   | 7344    | Prevent a potential KeyError when removing world from the    |
   | zmedico | digraph for --prune display.                                 |
   |---------+--------------------------------------------------------------|
   | 7345    | Document --depclean and --prune enhancements.                |
   | zmedico |                                                              |
   |---------+--------------------------------------------------------------|
   | 7349    | Make --update imply --oneshot since people often us it to    |
   | zmedico | update things when they don't want to add them to world.     |
   |         | Thanks to jakub for the suggestion.                          |
   |---------+--------------------------------------------------------------|
   | 7351    | Fix the reverse dependency display for --prune when there is |
   | zmedico | now real parent.                                             |
   +------------------------------------------------------------------------+

svn path=/main/branches/prefix/; revision=7353

man/emerge.1
pym/emerge/__init__.py
pym/emerge/help.py

index 6d6d7ca47226d61e06eb31e65b88ace8a7620cbd..f7400763aabe2835fef98c25cd8e9f02cb214519 100644 (file)
@@ -90,18 +90,23 @@ has completed.  This usually entails configuration file setup or other similar
 setups that the user may wish to run.
 .TP
 .BR \-\-depclean
-Determines all packages installed on the system that have no 
-explicit reason for being there.  \fBemerge\fR generates a list 
-of packages which it expects to be installed by checking the 
-\fBsystem\fR package list and the \fBworld\fR file.  It then 
-compares that list to the list of packages which are actually 
-installed; the differences are listed as unnecessary packages 
-and then unmerged after a short timeout.  \fBWARNING: Removing some 
+Cleans the system by removing packages that are not associated
+with explicitly merged packages. Depclean works by creating the
+full dependency tree from the system list and the world file,
+then comparing it to installed packages. Packages installed, but
+not associated with an explicit merge are listed as candidates
+for unmerging. Inexperienced users are advised to use \fB\-\-pretend\fR
+with this option in order to see a preview of which packages
+will be uninstalled. \fBWARNING: Removing some
 packages may cause packages which link to the removed package 
-to stop working and complain about missing libraries.\fR 
-Re\-emerge the complaining package to fix this issue.  Also see
+to stop working and complain about missing libraries.\fR
+Rebuild the complaining package to fix this issue.  Also see
 \fB\-\-with\-bdeps\fR for behavior with respect to build time dependencies that
-are not strictly required.
+are not strictly required. Depclean serves as a dependency aware
+version of \fB\-\-unmerge\fR. When given one or more atoms, it will
+unmerge matched packages that have no reverse dependencies. Use
+\fB\-\-depclean\fR together with \fB\-\-verbose\fR to show reverse
+dependencies.
 .TP
 .BR "\-\-help " (\fB\-h\fR)
 Displays help information for emerge.  Adding one of the additional
@@ -128,7 +133,9 @@ PORTDIR_OVERLAY.  In order to generate cache for overlays, use \fB\-\-regen\fR.
 \fBWARNING: This action can remove important packages!\fR  Removes all but the
 highest installed version of a package from your system. This action doesn't
 verify the possible binary compatibility between versions and can thus remove
-essential dependencies from your system.
+essential dependencies from your system. Use \fB\-\-prune\fR together with
+\fB\-\-verbose\fR to show reverse dependencies or with \fB\-\-nodeps\fR to
+ignore all dependencies.
 .TP
 .BR \-\-regen
 Causes portage to check and update the dependency cache of all ebuilds in the 
@@ -178,8 +185,9 @@ description of PORTDIR_OVERLAY for a method to avoid deletions.
 \fBWARNING: This action can remove important packages!\fR Removes
 all matching packages.  This does no checking of dependencies, so
 it may remove packages necessary for the proper operation of your
-system.  Its arguments can be \fIebuilds\fR, \fIsets\fR, or
-\fIatoms\fR.
+system.  Its arguments can be \fIatoms\fR or
+\fIebuilds\fR. For a dependency aware version of \fB\-\-unmerge\fR,
+use \fB\-\-depclean\fR or \fB\-\-prune\fR.
 .TP
 .BR "\-\-update " (\fB\-u\fR)
 Updates packages to the best version available, which may not always be the 
index dbd84672e1ccdea66dc4b6ab0352b57433c4b9d3..6ed424f503c4dbb4d51cd5a0fb7f89b9aed2fcfa 100644 (file)
@@ -1569,7 +1569,9 @@ class depgraph(object):
                                                        greedy_atoms.append((myarg, myslot_atom))
                        arg_atoms = greedy_atoms
 
-               oneshot = "--oneshot" in self.myopts or "--onlydeps" in self.myopts
+               oneshot = "--oneshot" in self.myopts or \
+                       "--onlydeps" in self.myopts or \
+                       "--update" in self.myopts
                """ These are used inside self.create() in order to ensure packages
                that happen to match arguments are not incorrectly marked as nomerge."""
                args_set = self._sets["args"]
@@ -5412,6 +5414,9 @@ def action_depclean(settings, trees, ldpath_mtimes,
                        if vardb.match(atom):
                                remaining_atoms.append((atom, 'system', hard))
        elif action == "prune":
+               for atom in syslist:
+                       if vardb.match(atom):
+                               remaining_atoms.append((atom, 'system', hard))
                # Pull in everything that's installed since we don't want to prune a
                # package if something depends on it.
                remaining_atoms.extend((atom, 'world', hard) for atom in vardb.cp_all())
@@ -5553,6 +5558,11 @@ def action_depclean(settings, trees, ldpath_mtimes,
 
        def show_parents(child_node):
                parent_nodes = graph.parent_nodes(child_node)
+               if not parent_nodes:
+                       # With --prune, the highest version can be pulled in without any
+                       # real parent since all installed packages are pulled in.  In that
+                       # case there's nothing to show here.
+                       return
                parent_nodes.sort()
                msg = []
                msg.append("  %s pulled in by:\n" % str(child_node))
@@ -5587,7 +5597,8 @@ def action_depclean(settings, trees, ldpath_mtimes,
        elif action == "prune":
                # Prune really uses all installed instead of world.  It's not a real
                # reverse dependency so don't display it as such.
-               graph.remove("world")
+               if graph.contains("world"):
+                       graph.remove("world")
                for atom in args_set:
                        for pkg in vardb.match(atom):
                                if not fakedb.cpv_exists(pkg):
index def367fd5e1683211e9c65291332d600cce168fa..d7000aa1557a1b314ddc215551ac766a51bdc1d9 100644 (file)
@@ -64,10 +64,17 @@ def help(myaction,myopts,havecolor=1):
                print "              full dependency tree from the system list and the world file,"
                print "              then comparing it to installed packages. Packages installed, but"
                print "              not associated with an explicit merge are listed as candidates"
-               print "              for unmerging."+turquoise(" WARNING: This can seriously affect your system by")
-               print "              "+turquoise("removing packages that may have been linked against, but due to")
-               print "              "+turquoise("changes in USE flags may no longer be part of the dep tree. Use")
-               print "              "+turquoise("caution when employing this feature.")
+               print "              for unmerging. Inexperienced users are advised to use --pretend"
+               print "              with this option in order to see a preview of which packages will"
+               print "              be uninstalled. "+turquoise(" WARNING: Removing some packages may cause")
+               print "              "+turquoise("packages which link to the removed package to stop working and")
+               print "              "+turquoise("complain about missing libraries. Rebuild the complaining package")
+               print "              "+turquoise("to fix this issue.")+" Also see --with-bdeps for behavior with"
+               print "              respect to build time dependencies that are not strictly"
+               print "              required. Depclean serves as a dependency aware version of"
+               print "              --unmerge. When given one or more atoms, it will unmerge matched"
+               print "              packages that have no reverse dependencies. Use --depclean"
+               print "              together with --verbose to show reverse dependencies."
                print
                print "       "+green("--info")
                print "              Displays important portage variables that will be exported to"
@@ -90,8 +97,9 @@ def help(myaction,myopts,havecolor=1):
                print "              Removes all but the highest installed version of a package"
                print "              from your system. This action doesn't verify the possible binary"
                print "              compatibility between versions and can thus remove essential"
-               print "              dependencies from your system."
-               print "              The argument format is the same as for the "+bold("--clean")+" action."
+               print "              dependencies from your system. Use --prune together with"
+               print "              --verbose to show reverse dependencies or with --nodeps to"
+               print "              ignore all dependencies."
                print
                print "       "+green("--regen")
                print "              Causes portage to check and update the dependency cache of all"
@@ -137,9 +145,11 @@ def help(myaction,myopts,havecolor=1):
                print
                print "       "+green("--unmerge")+" ("+green("-C")+" short option)"
                print "              "+turquoise("WARNING: This action can remove important packages!")
-               print "              Removes all matching packages "+bold("completely")+" from"
-               print "              your system. Specify arguments using the dependency specification"
-               print "              format described in the "+bold("--clean")+" action above."
+               print "              Removes all matching packages. This does no checking of"
+               print "              dependencies, so it may remove packages necessary for the proper"
+               print "              operation of your system. Its arguments can be atoms or"
+               print "              ebuilds. For a dependency aware version of --unmerge, use"
+               print "              --depclean or --prune."
                print
                print "       "+green("--update")+" ("+green("-u")+" short option)"
                print "              Updates packages to the best version available, which may not"