print " "+green("*")+" Processed",icount,"info files."
+def display_news_notification(settings):
+ target_root = settings["ROOT"]
+ NEWS_PATH = os.path.join("metadata", "news")
+ 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:
+ 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
def post_emerge(settings, mtimedb, retval):
"""
Misc. things to run at the end of a merge session.
Update Config Files
Update News Items
Commit mtimeDB
+ Display preserved libs warnings
Exit Emerge
@param settings: Configuration settings (typically portage.settings)
chk_updated_cfg_files(target_root, config_protect)
- NEWS_PATH = os.path.join( "metadata", "news" )
- UNREAD_PATH = os.path.join( target_root, NEWS_LIB_PATH, 'news')
- porttree = portdbapi( porttree_root = settings["PORTDIR"], mysettings = settings )
- newsReaderDisplay = False
-
- for repo in porttree.getRepositories():
- unreadItems = checkUpdatedNewsItems(target_root, NEWS_PATH, UNREAD_PATH, repo)
- if unreadItems:
- 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."
+ display_news_notification(settings)
from portage.dbapi.vartree import PreservedLibsRegistry
plib_registry = PreservedLibsRegistry(os.path.join(target_root, CACHE_PATH, "preserved_libs_registry"))
if plib_registry.hasEntries():
- print
print colorize("WARN", "!!!") + " existing preserved libs:"
plibdata = plib_registry.getPreservedLibs()
for cpv in plibdata.keys():
print red(" * ")+"configuration files."
print red(" * ")+"To update portage, run 'emerge portage'."
print
+
+ display_news_notification(settings)
def action_metadata(settings, portdb, myopts):
portage.writemsg_stdout("\n>>> Updating Portage cache: ")
# "update", "system", or just process files:
else:
validate_ebuild_environment(trees)
+ if "--pretend" not in myopts:
+ display_news_notification(settings)
action_build(settings, trees, mtimedb,
myopts, myaction, myfiles, spinner)
if "--pretend" not in myopts:
post_emerge(settings, mtimedb, 0)
+ else:
+ display_news_notification(settings)
if __name__ == "__main__":
retval = emerge_main()