summaryrefslogtreecommitdiffstats
path: root/pym/portage/dbapi/__init__.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-07-27 21:30:45 -0700
committerZac Medico <zmedico@gentoo.org>2010-07-27 21:30:45 -0700
commit3569643f9d0f5c7bf6723af3af0f5147a265fe68 (patch)
tree4d6a7053a3ab16e8fbdd27abc8870a5ded00c6d3 /pym/portage/dbapi/__init__.py
parentd679b5db098641cbd9c4eeed6d4b5b888a6430f9 (diff)
downloadportage-3569643f9d0f5c7bf6723af3af0f5147a265fe68.tar.gz
portage-3569643f9d0f5c7bf6723af3af0f5147a265fe68.tar.bz2
portage-3569643f9d0f5c7bf6723af3af0f5147a265fe68.zip
Tweak global updates handling so that updates from $PORTDIR are applied
for all of the following cases: * package is missing repository metadata * package has repository metadata, but the source repository does not have a profiles/updates/ directory * package has repository metadata, but the source repository is not currently accessible via PORTDIR_OVERLAY
Diffstat (limited to 'pym/portage/dbapi/__init__.py')
-rw-r--r--pym/portage/dbapi/__init__.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/pym/portage/dbapi/__init__.py b/pym/portage/dbapi/__init__.py
index b6b9175c6..4799b2582 100644
--- a/pym/portage/dbapi/__init__.py
+++ b/pym/portage/dbapi/__init__.py
@@ -229,9 +229,16 @@ class dbapi(object):
if repo_dict is None:
updates_list = updates
else:
- updates_list = repo_dict.get(repo)
- if updates_list is None:
- continue
+ try:
+ updates_list = repo_dict[repo]
+ except KeyError:
+ try:
+ updates_list = repo_dict['DEFAULT']
+ except KeyError:
+ continue
+
+ if not updates_list:
+ continue
metadata_updates = update_dbentries(updates_list, metadata)
if metadata_updates:
@@ -241,11 +248,12 @@ class dbapi(object):
if onProgress:
onProgress(maxval, i+1)
- def move_slot_ent(self, mylist, repo_name = None):
+ def move_slot_ent(self, mylist, repo_match=None):
"""This function takes a sequence:
Args:
mylist: a sequence of (package, originalslot, newslot)
- repo_name: repository from which update is originated
+ repo_match: callable that takes single repo_name argument
+ and returns True if the update should be applied
Returns:
The number of slotmoves this function did
"""
@@ -260,7 +268,8 @@ class dbapi(object):
slot = self.aux_get(mycpv, ["SLOT"])[0]
if slot != origslot:
continue
- if repo_name and self.aux_get(mycpv, ['repository'])[0] != repo_name:
+ if repo_match is not None \
+ and not repo_match(self.aux_get(mycpv, ['repository'])[0]):
continue
moves += 1
mydata = {"SLOT": newslot+"\n"}