from portage import digraph
from portage import _unicode_decode
from portage.cache.cache_errors import CacheError
-from portage.const import GLOBAL_CONFIG_PATH, NEWS_LIB_PATH
+from portage.const import GLOBAL_CONFIG_PATH, NEWS_LIB_PATH, EPREFIX
from portage.const import _ENABLE_DYN_LINK_MAP, _ENABLE_SET_CONFIG
from portage.dbapi.dep_expand import dep_expand
- from portage.dep import Atom, extended_cp_match, _get_useflag_re
+ from portage.dbapi._expand_new_virt import expand_new_virt
+ from portage.dep import Atom, extended_cp_match
from portage.exception import InvalidAtom
from portage.output import blue, bold, colorize, create_color_func, darkgreen, \
red, yellow
SUPPORTED_FEATURES = frozenset([
"assume-digests", "binpkg-logs", "buildpkg", "buildsyspkg", "candy",
"ccache", "chflags", "collision-protect", "compress-build-logs",
- "digest", "distcc", "distlocks", "fakeroot",
+ "digest", "distcc", "distlocks", "ebuild-locks", "fakeroot",
"fail-clean", "fixpackages", "force-mirror", "getbinpkg",
"installsources", "keeptemp", "keepwork", "fixlafiles", "lmirror",
+ "macossandbox", "macosprefixsandbox", "macosusersandbox",
"metadata-transfer", "mirror", "multilib-strict", "news",
- "noauto", "noclean", "nodoc", "noinfo", "noman", "nostrip",
- "notitles", "parallel-fetch", "parse-eapi-ebuild-head",
+ "noauto", "noclean", "nodoc", "noinfo", "noman",
+ "nostrip", "notitles", "parallel-fetch", "parallel-install",
+ "parse-eapi-ebuild-head",
"prelink-checksums", "preserve-libs",
"protect-owned", "python-trace", "sandbox",
"selinux", "sesandbox", "severe", "sfperms",
self._linkmap = None
if _ENABLE_DYN_LINK_MAP:
- self._linkmap = LinkageMap(self)
+ chost = self.settings.get('CHOST')
+ if not chost:
+ chost = 'lunix?' # this happens when profiles are not available
+ if chost.find('darwin') >= 0:
+ self._linkmap = LinkageMapMachO(self)
+ elif chost.find('interix') >= 0 or chost.find('winnt') >= 0:
+ self._linkmap = LinkageMapPeCoff(self)
+ elif chost.find('aix') >= 0:
+ self._linkmap = LinkageMapXCoff(self)
+ else:
+ self._linkmap = LinkageMap(self)
self._owners = self._owners_db(self)
+ self._cached_counter = None
+
def getpath(self, mykey, filename=None):
# This is an optimized hotspot, so don't use unicode-wrapped
# os module and don't use os.path.join().
# have to call scanelf for preserved libs here as they aren't
# registered in NEEDED.ELF.2 files
plibs = set()
- if self._dbapi._plib_registry and self._dbapi._plib_registry.getPreservedLibs():
- args = [EPREFIX + "/usr/bin/scanelf", "-qF", "%a;%F;%S;%r;%n"]
- for items in self._dbapi._plib_registry.getPreservedLibs().values():
+ if preserve_paths is not None:
+ plibs.update(preserve_paths)
+ if self._dbapi._plib_registry and \
+ self._dbapi._plib_registry.hasEntries():
+ for cpv, items in \
+ self._dbapi._plib_registry.getPreservedLibs().items():
+ if exclude_pkgs is not None and cpv in exclude_pkgs:
+ # These preserved libs will either be unmerged,
+ # rendering them irrelevant, or they will be
+ # preserved in the replacement package and are
+ # already represented via the preserve_paths
+ # parameter.
+ continue
plibs.update(items)
- args.extend(os.path.join(root, x.lstrip("." + os.sep)) \
- for x in items)
+ if plibs:
- args = ["/usr/bin/scanelf", "-qF", "%a;%F;%S;%r;%n"]
++ args = [EPREFIX + "/usr/bin/scanelf", "-qF", "%a;%F;%S;%r;%n"]
+ args.extend(os.path.join(root, x.lstrip("." + os.sep)) \
+ for x in plibs)
try:
proc = subprocess.Popen(args, stdout=subprocess.PIPE)
except EnvironmentError as e: