summaryrefslogtreecommitdiffstats
path: root/pym/_emerge/Scheduler.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-03-09 04:55:37 +0000
committerZac Medico <zmedico@gentoo.org>2010-03-09 04:55:37 +0000
commit41cd3586530eb54d6c907fbac820c948a569b1ac (patch)
tree65cec30c74dcd60b98d8e26f39b6f86f6a8fece5 /pym/_emerge/Scheduler.py
parent2160424429015b1e507b83b8bdee19d1b000a812 (diff)
downloadportage-41cd3586530eb54d6c907fbac820c948a569b1ac.tar.gz
portage-41cd3586530eb54d6c907fbac820c948a569b1ac.tar.bz2
portage-41cd3586530eb54d6c907fbac820c948a569b1ac.zip
If _implicit_libc_deps() finds both a new-style virtual and an old-style
PROVIDE virtual, use the new-style virtual. svn path=/main/trunk/; revision=15789
Diffstat (limited to 'pym/_emerge/Scheduler.py')
-rw-r--r--pym/_emerge/Scheduler.py40
1 files changed, 32 insertions, 8 deletions
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 7a802c3f0..24679b2ac 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -417,10 +417,13 @@ class Scheduler(PollScheduler):
def _implicit_libc_deps(self):
"""
Create implicit dependencies on libc, in order to ensure that libc
- is installed as early as possible (see bug #303567).
+ is installed as early as possible (see bug #303567). If the merge
+ list contains both a new-style virtual and an old-style PROVIDE
+ virtual, the new-style virtual is used.
"""
libc_set = InternalPackageSet([LIBC_PACKAGE_ATOM])
- libc_pkgs = {}
+ norm_libc_pkgs = {}
+ virt_libc_pkgs = {}
for pkg in self._mergelist:
if not isinstance(pkg, Package):
# a satisfied blocker
@@ -429,15 +432,36 @@ class Scheduler(PollScheduler):
continue
if pkg.operation == 'merge':
if libc_set.findAtomForPackage(pkg):
- if pkg.root in libc_pkgs:
+ if pkg.category == 'virtual':
+ d = virt_libc_pkgs
+ else:
+ d = norm_libc_pkgs
+ if pkg.root in d:
raise AssertionError(
"found 2 libc matches: %s and %s" % \
- (libc_pkgs[pkg.root], pkg))
- libc_pkgs[pkg.root] = pkg
+ (d[pkg.root], pkg))
+ d[pkg.root] = pkg
+
+ # Prefer new-style virtuals over old-style PROVIDE virtuals.
+ libc_pkg_map = norm_libc_pkgs.copy()
+ libc_pkg_map.update(virt_libc_pkgs)
+ libc_pkgs = set(libc_pkg_map.values())
+ earlier_libc_pkgs = set()
+
+ for pkg in self._mergelist:
+ if not isinstance(pkg, Package):
+ # a satisfied blocker
+ continue
+ if pkg.installed:
+ continue
+ if pkg.operation == 'merge':
+ if pkg in libc_pkgs:
+ earlier_libc_pkgs.add(pkg)
else:
- earlier_libc = libc_pkgs.get(pkg.root)
- if earlier_libc is not None:
- self._digraph.add(earlier_libc, pkg,
+ my_libc = libc_pkg_map.get(pkg.root)
+ if my_libc is not None and \
+ my_libc in earlier_libc_pkgs:
+ self._digraph.add(my_libc, pkg,
priority=DepPriority(buildtime=True))
class _pkg_failure(portage.exception.PortageException):