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 = {}
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
# 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()
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:
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)
# 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):
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()
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