def onUpdate(maxval, curval):
if curval > 0:
writemsg_stdout("#")
- vardb.update_ents(myupd, onUpdate=onUpdate)
+ vardb.update_ents(myupd, onUpdate=onUpdate, repo=repo_name)
if bindb:
def onUpdate(maxval, curval):
if curval > 0:
writemsg_stdout("*")
- bindb.update_ents(myupd, onUpdate=onUpdate)
+ bindb.update_ents(myupd, onUpdate=onUpdate, repo=repo_name)
else:
do_upgrade_packagesmessage = 1
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
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()
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: