From f0b826bf4152984030410ff570751a9ad801f1eb Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 31 Jul 2010 22:34:03 -0700 Subject: [PATCH] Just return boolean to indicate whether or not updates have been performed, since that's all that the calling code currently needs. --- pym/portage/_global_updates.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/pym/portage/_global_updates.py b/pym/portage/_global_updates.py index d57b6e7ce..7e6ae3300 100644 --- a/pym/portage/_global_updates.py +++ b/pym/portage/_global_updates.py @@ -27,20 +27,18 @@ def _global_updates(trees, prev_mtimes): @param prev_mtimes: A dictionary containing mtimes of files located in $PORTDIR/profiles/updates/. @type prev_mtimes: dict - @rtype: None or List - @return: None if no were no updates, otherwise a list of update commands - that have been performed. + @rtype: bool + @return: True if update commands have been performed, otherwise False """ # only do this if we're root and not running repoman/ebuild digest + retupd = False if secpass < 2 or \ "SANDBOX_ACTIVE" in os.environ or \ len(trees) != 1: - return 0 + return retupd root = "/" - mysettings = trees["/"]["vartree"].settings - retupd = [] - + mysettings = trees[root]["vartree"].settings portdb = trees[root]["porttree"].dbapi vardb = trees[root]["vartree"].dbapi bindb = trees[root]["bintree"].dbapi @@ -104,7 +102,8 @@ def _global_updates(trees, prev_mtimes): else: for msg in errors: writemsg("%s\n" % msg, noiselevel=-1) - retupd.extend(myupd) + if myupd: + retupd = True master_repo = portdb.getRepositoryName(portdb.porttree_root) if master_repo in repo_map: @@ -215,5 +214,4 @@ def _global_updates(trees, prev_mtimes): # and the old name still matches something (from an overlay)? pass - if retupd: - return retupd + return retupd -- 2.26.2