Merged from trunk -r15795:15815
authorFabian Groffen <grobian@gentoo.org>
Thu, 11 Mar 2010 18:39:54 +0000 (18:39 -0000)
committerFabian Groffen <grobian@gentoo.org>
Thu, 11 Mar 2010 18:39:54 +0000 (18:39 -0000)
   | 15802   | Use ewarn output style to add some color.                    |
   | zmedico |                                                              |

   | 15803   | Add periods.                                                 |
   | zmedico |                                                              |

   | 15804   | Merge libc asap for all roots instead of just ROOT="/".      |
   | zmedico |                                                              |

   | 15809   | Disable implicit libc deps for ROOT != "/" since it's        |
   | zmedico | probably not needed.                                         |

   | 15810   | Only create implicit libc deps when the version changes.     |
   | zmedico |                                                              |

   | 15813   | Only try to merge portage asap when the new version is       |
   | zmedico | different.                                                   |

svn path=/main/branches/prefix/; revision=15817

pym/_emerge/Scheduler.py
pym/_emerge/depgraph.py
pym/_emerge/sync/old_tree_timestamp.py

index c35c2eabac6c04f4ccd6f2597cf523ea3a9b35e0..404a4483b93c4d87697d4ffe94011d55e164d96e 100644 (file)
@@ -425,6 +425,7 @@ class Scheduler(PollScheduler):
                list contains both a new-style virtual and an old-style PROVIDE
                virtual, the new-style virtual is used.
                """
+               implicit_libc_roots = set([self._running_root.root])
                libc_set = InternalPackageSet([LIBC_PACKAGE_ATOM])
                norm_libc_pkgs = {}
                virt_libc_pkgs = {}
@@ -434,7 +435,8 @@ class Scheduler(PollScheduler):
                                continue
                        if pkg.installed:
                                continue
-                       if pkg.operation == 'merge':
+                       if pkg.root in implicit_libc_roots and \
+                               pkg.operation == 'merge':
                                if libc_set.findAtomForPackage(pkg):
                                        if pkg.category == 'virtual':
                                                d = virt_libc_pkgs
@@ -449,6 +451,16 @@ class Scheduler(PollScheduler):
                # Prefer new-style virtuals over old-style PROVIDE virtuals.
                libc_pkg_map = norm_libc_pkgs.copy()
                libc_pkg_map.update(virt_libc_pkgs)
+
+               # Only add a dep when the version changes.
+               for libc_pkg in list(libc_pkg_map.values()):
+                       if libc_pkg.root_config.trees['vartree'].dbapi.cpv_exists(
+                               libc_pkg.cpv):
+                               del libc_pkg_map[pkg.root]
+
+               if not libc_pkg_map:
+                       return
+
                libc_pkgs = set(libc_pkg_map.values())
                earlier_libc_pkgs = set()
 
@@ -458,7 +470,8 @@ class Scheduler(PollScheduler):
                                continue
                        if pkg.installed:
                                continue
-                       if pkg.operation == 'merge':
+                       if pkg.root in implicit_libc_roots and \
+                               pkg.operation == 'merge':
                                if pkg in libc_pkgs:
                                        earlier_libc_pkgs.add(pkg)
                                else:
index 7d3504167ce0086746b492c4cf15719eb59b1e78..366aa3cb88a531f84ea053d0caaa2b840ed167f0 100644 (file)
@@ -3341,7 +3341,9 @@ class depgraph(object):
                if replacement_portage == running_portage:
                        replacement_portage = None
 
-               if replacement_portage is not None:
+               if replacement_portage is not None and \
+                       (running_portage is None or \
+                       (running_portage.cpv != replacement_portage.cpv)):
                        # update from running_portage to replacement_portage asap
                        asap_nodes.append(replacement_portage)
 
@@ -3363,12 +3365,16 @@ class depgraph(object):
 
                # Merge libc asap, in order to account for implicit
                # dependencies. See bug #303567.
-               libc_pkg = self._dynamic_config.mydbapi[running_root].match_pkgs(
-                       portage.const.LIBC_PACKAGE_ATOM)
-               if libc_pkg:
-                       libc_pkg = libc_pkg[0]
-                       if libc_pkg.operation == 'merge':
-                               asap_nodes.append(libc_pkg)
+               for root in (running_root,):
+                       libc_pkg = self._dynamic_config.mydbapi[root].match_pkgs(
+                               portage.const.LIBC_PACKAGE_ATOM)
+                       if libc_pkg:
+                               libc_pkg = libc_pkg[0]
+                               if libc_pkg.operation == 'merge':
+                                       # Only add a dep when the version changes.
+                                       if not libc_pkg.root_config.trees[
+                                               'vartree'].dbapi.cpv_exists(libc_pkg.cpv):
+                                               asap_nodes.append(libc_pkg)
 
                def gather_deps(ignore_priority, mergeable_nodes,
                        selected_nodes, node):
index 9bd070c139cf0ca484eb416af07752e3c11c6bbe..00d671c2936a801f4410f0870bd53f0d36615a6c 100644 (file)
@@ -9,7 +9,8 @@ import time
 from portage import os
 from portage.exception import PortageException
 from portage.localization import _
-from portage.util import grabfile, writemsg_level, writemsg_stdout
+from portage.output import EOutput
+from portage.util import grabfile, writemsg_level
 
 def have_english_locale():
        lang, enc = locale.getdefaultlocale()
@@ -87,13 +88,12 @@ def old_tree_timestamp_warn(portdir, settings):
                return False
 
        if (unixtime - 86400 * warnsync) > lastsync:
+               out = EOutput()
                if have_english_locale():
-                       writemsg_stdout(">>> Last emerge --sync was %s ago\n" % \
-                               whenago(unixtime - lastsync), noiselevel=-1)
+                       out.ewarn("Last emerge --sync was %s ago." % \
+                               whenago(unixtime - lastsync))
                else:
-                       writemsg_stdout(">>> %s\n" % \
-                               _("Last emerge --sync was %s") % \
-                               time.strftime('%c', time.localtime(lastsync)),
-                               noiselevel=-1)
+                       out.ewarn(_("Last emerge --sync was %s.") % \
+                               time.strftime('%c', time.localtime(lastsync)))
                return True
        return False