summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-03-09 03:52:55 +0000
committerZac Medico <zmedico@gentoo.org>2010-03-09 03:52:55 +0000
commitc2fd4570c55ab1d59d4fb0ac5536cf214990272e (patch)
tree630b3c4b443dd760432a04d143f1dd3210b8ef0f /pym
parentcd9e494b36b4ae554c88173309e9d4a054946e8c (diff)
downloadportage-c2fd4570c55ab1d59d4fb0ac5536cf214990272e.tar.gz
portage-c2fd4570c55ab1d59d4fb0ac5536cf214990272e.tar.bz2
portage-c2fd4570c55ab1d59d4fb0ac5536cf214990272e.zip
Bug #303567 - Create implicit dependencies on libc, in order to ensure that
libc is installed as early as possible. svn path=/main/trunk/; revision=15783
Diffstat (limited to 'pym')
-rw-r--r--pym/_emerge/Scheduler.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index a97adc041..c7484e335 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -18,6 +18,7 @@ from portage import _encodings
from portage import _unicode_decode
from portage import _unicode_encode
from portage.cache.mappings import slot_dict_class
+from portage.const import LIBC_PACKAGE_ATOM
from portage.elog.messages import eerror
from portage.output import colorize, create_color_func, darkgreen, red
bad = create_color_func("BAD")
@@ -351,6 +352,7 @@ class Scheduler(PollScheduler):
self._find_system_deps()
self._prune_digraph()
self._prevent_builddir_collisions()
+ self._implicit_libc_deps()
def _find_system_deps(self):
"""
@@ -412,6 +414,32 @@ class Scheduler(PollScheduler):
priority=DepPriority(buildtime=True))
cpv_map[pkg.cpv].append(pkg)
+ 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).
+ """
+ libc_set = InternalPackageSet([LIBC_PACKAGE_ATOM])
+ libc_pkgs = {}
+ for pkg in self._mergelist:
+ if not isinstance(pkg, Package):
+ # a satisfied blocker
+ continue
+ if pkg.installed:
+ continue
+ if pkg.operation == 'merge':
+ if libc_set.findAtomForPackage(pkg):
+ if pkg.root in libc_pkgs:
+ raise AssertionError(
+ "found 2 libc matches: %s and %s" % \
+ (libc_pkgs[pkg.root]), pkg)
+ libc_pkgs[pkg.root] = pkg
+ else:
+ earlier_libc = libc_pkgs.get(pkg.root)
+ if earlier_libc is not None:
+ self._digraph.add(earlier_libc, pkg,
+ priority=DepPriority(buildtime=True))
+
class _pkg_failure(portage.exception.PortageException):
"""
An instance of this class is raised by unmerge() when