Only show extra whitespace where there are some news items to display.
authorZac Medico <zmedico@gentoo.org>
Fri, 18 May 2007 22:17:33 +0000 (22:17 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 18 May 2007 22:17:33 +0000 (22:17 -0000)
svn path=/main/trunk/; revision=6551

pym/emerge/__init__.py

index 6e091ab513eeacedea2393b3c5b081bfd7394b84..9fead5459429d80624d4685949d848481465611a 100644 (file)
@@ -3730,20 +3730,22 @@ def display_news_notification(settings):
        UNREAD_PATH = os.path.join(target_root, NEWS_LIB_PATH, "news")
        porttree = portdbapi(porttree_root=settings["PORTDIR"], mysettings=settings)
        newsReaderDisplay = False
-       
-       print
+
        for repo in porttree.getRepositories():
                unreadItems = checkUpdatedNewsItems(target_root, NEWS_PATH, UNREAD_PATH, repo)
                if unreadItems:
+                       if not newsReaderDisplay:
+                               newsReaderDisplay = True
+                               print
                        print colorize("WARN", " * IMPORTANT:"),
                        print "%s news items need reading for repository '%s'." % (unreadItems, repo)
-                       newsReaderDisplay = True
+                       
        
        if newsReaderDisplay:
                print colorize("WARN", " *"),
                print "Use " + colorize("GOOD", "eselect news") + " to read news items."
+               print
 
-       print
 def post_emerge(settings, mtimedb, retval):
        """
        Misc. things to run at the end of a merge session.