summaryrefslogtreecommitdiffstats
path: root/pym/portage/repository
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-06-02 17:36:33 -0700
committerZac Medico <zmedico@gentoo.org>2011-06-02 17:36:33 -0700
commitcf92c061d62ab13205a59d082d2e4ffd918c1c39 (patch)
tree72c0b25775646d43225e1319e72a1566410bc941 /pym/portage/repository
parent0fa2e1a1f0d47c4ed82cc4e4a6ee23c04adeac65 (diff)
downloadportage-cf92c061d62ab13205a59d082d2e4ffd918c1c39.tar.gz
portage-cf92c061d62ab13205a59d082d2e4ffd918c1c39.tar.bz2
portage-cf92c061d62ab13205a59d082d2e4ffd918c1c39.zip
repository/config: PORTDIR/overlay priority tweak
This ensures compatibility with previous portage versions for cases in which the user has added PORTDIR to PORTDIR_OVERLAY as a means to modify its priority relative to overlays when selecting ebuilds.
Diffstat (limited to 'pym/portage/repository')
-rw-r--r--pym/portage/repository/config.py28
1 files changed, 18 insertions, 10 deletions
diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index eb44b17f8..c5b779051 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -242,21 +242,25 @@ class RepoConfigLoader(object):
if old_location is not None and old_location != repo.location:
ignored_map.setdefault(repo.name, []).append(old_location)
ignored_location_map[old_location] = repo.name
+ if old_location == portdir:
+ portdir = repo.user_location
prepos[repo.name].update(repo)
+ repo = prepos[repo.name]
else:
prepos[repo.name] = repo
- repo = prepos[repo.name]
- if repo.priority is None:
- if ov == portdir and portdir not in port_ov:
- repo.priority = -1000
- else:
- repo.priority = base_priority
- base_priority += 1
+ if ov == portdir and portdir not in port_ov:
+ repo.priority = -1000
+ else:
+ repo.priority = base_priority
+ base_priority += 1
else:
writemsg(_("!!! Invalid PORTDIR_OVERLAY"
" (not a dir): '%s'\n") % ov, noiselevel=-1)
+
+ return portdir
+
def repo_priority(r):
"""
Key funtion for comparing repositories by priority.
@@ -274,11 +278,15 @@ class RepoConfigLoader(object):
ignored_location_map = {}
portdir = settings.get('PORTDIR', '')
- if portdir and portdir.strip():
- portdir = os.path.realpath(portdir)
portdir_overlay = settings.get('PORTDIR_OVERLAY', '')
parse(paths, prepos, ignored_map, ignored_location_map)
- add_overlays(portdir, portdir_overlay, prepos, ignored_map, ignored_location_map)
+ # If PORTDIR_OVERLAY contains a repo with the same repo_name as
+ # PORTDIR, then PORTDIR is overridden.
+ portdir = add_overlays(portdir, portdir_overlay, prepos,
+ ignored_map, ignored_location_map)
+ if portdir and portdir.strip():
+ portdir = os.path.realpath(portdir)
+
ignored_repos = tuple((repo_name, tuple(paths)) \
for repo_name, paths in ignored_map.items())