print "Use " + colorize("GOOD", "eselect news") + " to read news items."
print
-def post_emerge(settings, mtimedb, retval, vardbapi):
+def post_emerge(trees, mtimedb, retval):
"""
Misc. things to run at the end of a merge session.
Commit mtimeDB
Display preserved libs warnings
Exit Emerge
-
- @param settings: Configuration settings (typically portage.settings)
- @type settings: portage.config()
+
+ @param trees: A dictionary mapping each ROOT to it's package databases
+ @type trees: dict
@param mtimedb: The mtimeDB to store data needed across merge invocations
@type mtimedb: MtimeDB class instance
@param retval: Emerge's return value
@returns:
1. Calls sys.exit(retval)
"""
- target_root = settings["ROOT"]
+ for target_root in trees:
+ if len(trees) > 1 and target_root != "/":
+ break
+ vardbapi = trees[target_root]["vartree"].dbapi
+ settings = vardbapi.settings
info_mtimes = mtimedb["info"]
# Load the most current variables from ${ROOT}/etc/profile.env
if 1 == unmerge(settings, myopts, vartree, myaction, myfiles,
mtimedb["ldpath"]):
if "--pretend" not in myopts:
- post_emerge(settings, mtimedb, 0, trees[settings["ROOT"]]["vartree"].dbapi)
+ post_emerge(trees, mtimedb, os.EX_OK)
elif "depclean"==myaction:
validate_ebuild_environment(trees)
action_depclean(settings, trees, mtimedb["ldpath"],
myopts, spinner)
if "--pretend" not in myopts:
- post_emerge(settings, mtimedb, 0, trees[settings["ROOT"]]["vartree"].dbapi)
+ post_emerge(trees, mtimedb, os.EX_OK)
# "update", "system", or just process files:
else:
validate_ebuild_environment(trees)
action_build(settings, trees, mtimedb,
myopts, myaction, myfiles, spinner)
if "--pretend" not in myopts:
- post_emerge(settings, mtimedb, 0, trees[settings["ROOT"]]["vartree"].dbapi)
+ post_emerge(trees, mtimedb, os.EX_OK)
else:
display_news_notification(settings)