Suppress "for /" and "to /" in status messages when ROOT=/. Thanks to
authorZac Medico <zmedico@gentoo.org>
Fri, 25 Jul 2008 22:48:57 +0000 (22:48 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 25 Jul 2008 22:48:57 +0000 (22:48 -0000)
Thargor for the suggestion.

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

pym/_emerge/__init__.py

index 649ce2c02b83dd40d4747abb5d28fcc7d47c455a..9c82a2b7abefb711fc1d550cb38eea4ee078b0ab 100644 (file)
@@ -3379,14 +3379,17 @@ class MergeListItem(CompositeTask):
                if build_opts.fetchonly:
                        action_desc = "Fetching"
 
-               if not build_opts.pretend:
+               msg = "%s (%s of %s) %s" % \
+                       (action_desc,
+                       colorize("MERGE_LIST_PROGRESS", str(pkg_count.curval)),
+                       colorize("MERGE_LIST_PROGRESS", str(pkg_count.maxval)),
+                       colorize("GOOD", pkg.cpv))
 
-                       self.statusMessage("%s (%s of %s) %s %s %s" % \
-                               (action_desc,
-                               colorize("MERGE_LIST_PROGRESS", str(pkg_count.curval)),
-                               colorize("MERGE_LIST_PROGRESS", str(pkg_count.maxval)),
-                               colorize("GOOD", pkg.cpv), preposition, pkg.root))
+               if pkg.root != "/":
+                       msg += " %s %s" % (preposition, pkg.root)
 
+               if not build_opts.pretend:
+                       self.statusMessage(msg)
                        logger.log(" >>> emerge (%s of %s) %s to %s" % \
                                (pkg_count.curval, pkg_count.maxval, pkg.cpv, pkg.root))
 
@@ -3487,12 +3490,15 @@ class PackageMerge(AsynchronousTask):
                        action_desc = "Installing"
                        preposition = "to"
 
+               msg = "%s %s" % (action_desc, colorize("GOOD", pkg.cpv))
+
+               if pkg.root != "/":
+                       msg += " %s %s" % (preposition, pkg.root)
+
                if not self.merge.build_opts.fetchonly and \
                        not self.merge.build_opts.pretend and \
                        not self.merge.build_opts.buildpkgonly:
-                       self.merge.statusMessage("%s %s %s %s" % \
-                               (action_desc, colorize("GOOD", pkg.cpv),
-                               preposition, pkg.root))
+                       self.merge.statusMessage(msg)
 
                self.returncode = self.merge.merge()
                self.wait()