summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-07-31 22:34:03 -0700
committerZac Medico <zmedico@gentoo.org>2010-07-31 22:34:03 -0700
commitf0b826bf4152984030410ff570751a9ad801f1eb (patch)
tree5f2c5963dc8f1c2d9f9ef4ccc272061fa64f9944
parent8da0d7bed2770aad59881fec9aff2bb5548929a5 (diff)
downloadportage-f0b826bf4152984030410ff570751a9ad801f1eb.tar.gz
portage-f0b826bf4152984030410ff570751a9ad801f1eb.tar.bz2
portage-f0b826bf4152984030410ff570751a9ad801f1eb.zip
Just return boolean to indicate whether or not updates have been performed,
since that's all that the calling code currently needs.
-rw-r--r--pym/portage/_global_updates.py18
1 files 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