summaryrefslogtreecommitdiffstats
path: root/pym/portage/dbapi/__init__.py
diff options
context:
space:
mode:
authorMichał Górny <gentoo@mgorny.alt.pl>2010-07-08 11:06:28 +0200
committerZac Medico <zmedico@gentoo.org>2010-07-27 16:13:16 -0700
commitb32efe2d1eb1a9a7c52f3ec18abd3d5db4ab8767 (patch)
tree1a12691d0ba99e50db7e5ffe72a6ea5c51a2b18b /pym/portage/dbapi/__init__.py
parentad54ccc5c9dff04ffa47daf87f1364e6ec17a9ef (diff)
downloadportage-b32efe2d1eb1a9a7c52f3ec18abd3d5db4ab8767.tar.gz
portage-b32efe2d1eb1a9a7c52f3ec18abd3d5db4ab8767.tar.bz2
portage-b32efe2d1eb1a9a7c52f3ec18abd3d5db4ab8767.zip
Limit repository-wide dbentry updates.
Update dbentries only when the repository the package comes from matches the repository update comes from.
Diffstat (limited to 'pym/portage/dbapi/__init__.py')
-rw-r--r--pym/portage/dbapi/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/pym/portage/dbapi/__init__.py b/pym/portage/dbapi/__init__.py
index c2e7989b8..88af46ba8 100644
--- a/pym/portage/dbapi/__init__.py
+++ b/pym/portage/dbapi/__init__.py
@@ -197,7 +197,7 @@ class dbapi(object):
else:
writemsg("!!! Invalid db entry: %s\n" % mypath, noiselevel=-1)
- def update_ents(self, updates, onProgress=None, onUpdate=None):
+ def update_ents(self, updates, onProgress=None, onUpdate=None, repo=None):
"""
Update metadata of all packages for package moves.
@param updates: A list of move commands
@@ -208,6 +208,8 @@ class dbapi(object):
for packages that are modified by updates.
@type onUpdate: a callable that takes 2 integer arguments:
maxval and curval
+ @param repo: Name of the repository which packages should be updated
+ @type repo: string
"""
cpv_all = self.cpv_all()
cpv_all.sort()
@@ -221,6 +223,8 @@ class dbapi(object):
if onProgress:
onProgress(maxval, 0)
for i, cpv in enumerate(cpv_all):
+ if repo and aux_get(cpv, ['repository'])[0] != repo:
+ continue
metadata = dict(zip(update_keys, aux_get(cpv, update_keys)))
metadata_updates = update_dbentries(updates, metadata)
if metadata_updates: