diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-07-27 21:30:45 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-07-27 21:30:45 -0700 |
commit | 3569643f9d0f5c7bf6723af3af0f5147a265fe68 (patch) | |
tree | 4d6a7053a3ab16e8fbdd27abc8870a5ded00c6d3 /pym/_emerge | |
parent | d679b5db098641cbd9c4eeed6d4b5b888a6430f9 (diff) | |
download | portage-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/_emerge')
-rw-r--r-- | pym/_emerge/FakeVartree.py | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/pym/_emerge/FakeVartree.py b/pym/_emerge/FakeVartree.py index 22f9f3739..c74092d55 100644 --- a/pym/_emerge/FakeVartree.py +++ b/pym/_emerge/FakeVartree.py @@ -186,8 +186,8 @@ def grab_global_updates(portdb): repo = portdb.getRepositoryPath(repo_name) updpath = os.path.join(repo, "profiles", "updates") if not os.path.isdir(updpath): - # as a backwards-compatibility measure, fallback to PORTDIR - updpath = os.path.join(portdb.porttree_root, "profiles", "updates") + continue + try: rawupdates = grab_updates(updpath) except portage.exception.DirectoryNotFound: @@ -198,16 +198,27 @@ def grab_global_updates(portdb): upd_commands.extend(commands) retupdates[repo_name] = upd_commands + master_repo = portdb.getRepositoryName(portdb.porttree_root) + if master_repo in retupdates: + retupdates['DEFAULT'] = retupdates[master_repo] + return retupdates def perform_global_updates(mycpv, mydb, myupdates): + aux_keys = ["DEPEND", "RDEPEND", "PDEPEND", 'repository'] + aux_dict = dict(zip(aux_keys, mydb.aux_get(mycpv, aux_keys))) + repository = aux_dict.pop('repository') try: - mycommands = myupdates[mydb.aux_get(mycpv, ['repository'])[0]] + mycommands = myupdates[repository] except KeyError: + try: + mycommands = myupdates['DEFAULT'] + except KeyError: + return + + if not mycommands: return - aux_keys = ["DEPEND", "RDEPEND", "PDEPEND"] - aux_dict = dict(zip(aux_keys, mydb.aux_get(mycpv, aux_keys))) updates = update_dbentries(mycommands, aux_dict) if updates: mydb.aux_update(mycpv, updates) |