summaryrefslogtreecommitdiffstats
path: root/pym/portage/_global_updates.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-07-27 17:45:27 -0700
committerZac Medico <zmedico@gentoo.org>2010-07-27 17:45:27 -0700
commit03aea0b5b8355cbb3599c0272dbcc8c24179a574 (patch)
tree8d1ab607c35af19c200fb8d4ae8dc7a7576c309f /pym/portage/_global_updates.py
parentc70f90b3cf0d55f569783d07202b3819d11dc018 (diff)
downloadportage-03aea0b5b8355cbb3599c0272dbcc8c24179a574.tar.gz
portage-03aea0b5b8355cbb3599c0272dbcc8c24179a574.tar.bz2
portage-03aea0b5b8355cbb3599c0272dbcc8c24179a574.zip
Make dbapi.update_ents() take a dict of {repo_name: list}, since it's
most efficient to process all repos at once.
Diffstat (limited to 'pym/portage/_global_updates.py')
-rw-r--r--pym/portage/_global_updates.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/pym/portage/_global_updates.py b/pym/portage/_global_updates.py
index 214052daf..85c8d8ef4 100644
--- a/pym/portage/_global_updates.py
+++ b/pym/portage/_global_updates.py
@@ -54,6 +54,8 @@ def _global_updates(trees, prev_mtimes):
world_list = grabfile(world_file)
world_modified = False
world_warnings = set()
+ updpath_map = {}
+ repo_map = {}
for repo_name in portdb.getRepositories():
repo = portdb.getRepositoryPath(repo_name)
@@ -62,6 +64,10 @@ def _global_updates(trees, prev_mtimes):
# as a backwards-compatibility measure, fallback to PORTDIR
updpath = os.path.join(portdb.porttree_root, "profiles", "updates")
+ if updpath in updpath_map:
+ repo_map[repo_name] = updpath_map[updpath]
+ continue
+
try:
if mysettings.get("PORTAGE_CALLER") == "fixpackages":
update_data = grab_updates(updpath)
@@ -69,10 +75,11 @@ def _global_updates(trees, prev_mtimes):
update_data = grab_updates(updpath, prev_mtimes)
except DirectoryNotFound:
continue
- myupd = None
+ myupd = []
+ updpath_map[updpath] = myupd
+ repo_map[repo_name] = myupd
if len(update_data) > 0:
do_upgrade_packagesmessage = 0
- myupd = []
timestamps = {}
for mykey, mystat, mycontent in update_data:
writemsg_stdout("\n\n")
@@ -96,6 +103,7 @@ def _global_updates(trees, prev_mtimes):
writemsg("%s\n" % msg, noiselevel=-1)
retupd.extend(myupd)
+ for repo_name, myupd in repo_map.items():
def _world_repo_match(atoma, atomb):
"""
Check whether to perform a world change from atoma to atomb.
@@ -151,18 +159,19 @@ def _global_updates(trees, prev_mtimes):
for mykey, mtime in timestamps.items():
prev_mtimes[mykey] = mtime
+ if repo_map:
# We gotta do the brute force updates for these now.
if mysettings.get("PORTAGE_CALLER") == "fixpackages" or \
"fixpackages" in mysettings.features:
def onUpdate(maxval, curval):
if curval > 0:
writemsg_stdout("#")
- vardb.update_ents(myupd, onUpdate=onUpdate, repo=repo_name)
+ vardb.update_ents(repo_map, onUpdate=onUpdate)
if bindb:
def onUpdate(maxval, curval):
if curval > 0:
writemsg_stdout("*")
- bindb.update_ents(myupd, onUpdate=onUpdate, repo=repo_name)
+ bindb.update_ents(repo_map, onUpdate=onUpdate)
else:
do_upgrade_packagesmessage = 1