From: Zac Medico Date: Tue, 9 Mar 2010 03:58:53 +0000 (-0000) Subject: Bug #303567 - Create implicit dependencies on libc, in order to ensure that X-Git-Tag: v2.1.8.3~12 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d92f3241f9f1f9ffe08c2bd7765efc1dea511a0e;p=portage.git Bug #303567 - Create implicit dependencies on libc, in order to ensure that libc is installed as early as possible. (trunk r15783) svn path=/main/branches/2.1.7/; revision=15785 --- diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py index b83e733bb..fbcf262cd 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