def _load_eclasses(self): """Force an update of the internal view of on disk/remote eclasses.""" ec = {} eclass_len = len(".eclass") try: files = listdir_files(self.eclassdir) except (FileNotFoundError, NotADirectoryError): return ImmutableDict() for y in sorted(files): if not y.endswith(".eclass"): continue ys = y[:-eclass_len] ec[intern(ys)] = LazilyHashedPath( pjoin(self.eclassdir, y), eclassdir=self.eclassdir) return ImmutableDict(ec)
def _load_eclasses(self): """Force an update of the internal view of on disk/remote eclasses.""" ec = {} eclass_len = len(".eclass") try: files = listdir_files(self.eclassdir) except EnvironmentError as e: if e.errno not in (errno.ENOENT, errno.ENOTDIR): raise return ImmutableDict() for y in files: if not y.endswith(".eclass"): continue ys = y[:-eclass_len] ec[intern(ys)] = LazilyHashedPath(pjoin(self.eclassdir, y), eclassdir=self.eclassdir) return ImmutableDict(ec)
("sys-libs/libtrash-2.4", (('DEPEND', 'virtual/libc dev-lang/perl'), ('DESCRIPTION', 'provides a trash can by intercepting calls...'), ('EAPI', ''), ('HOMEPAGE', 'http://pages.stern.nyu.edu/~marriaga/software/libtrash/'), ('IUSE', ''), ('KEYWORDS', '~amd64 ~ppc ~x86'), ('LICENSE', 'GPL-2'), ('PDEPEND', ''), ('RDEPEND', 'virtual/libc dev-lang/perl'), ('RESTRICT', ''), ('SLOT', '0'), ('SRC_URI', 'http://pages.stern.nyu.edu/~marriaga/software/blah.tgz'), ('_eclasses_', { 'toolchain-funcs': LazilyHashedPath('/var/gentoo/repos/gentoo/eclass', mtime=1155996352L), 'multilib': LazilyHashedPath('/var/gentoo/repos/gentoo/eclass', mtime=1156014349L), 'eutils': LazilyHashedPath('/var/gentoo/repos/gentoo/eclass', mtime=1155996352L), 'portability': LazilyHashedPath('/var/gentoo/repos/gentoo/eclass', mtime=1141850196L) } ), ('_mtime_', 1000), ), ) class GenericCacheMixin(TestCase): cache_keys = ("DEPENDS", "RDEPEND", "EAPI", "HOMEPAGE", "KEYWORDS", "LICENSE", "PDEPEND", "RESTRICT", "SLOT", "SRC_URI", "_eclasses_", "_mtime_")
def _mk_chf_obj(**kwargs): kwargs.setdefault('mtime', 100) return LazilyHashedPath('/nonexistent/path', **kwargs)
def __init__(self, path): eclass_cache.base.__init__(self, location=path, eclassdir=path) self.eclasses = { "eclass1": LazilyHashedPath(path, mtime=100), "eclass2": LazilyHashedPath(path, mtime=200) }
(('DEPEND', 'virtual/libc dev-lang/perl'), ('DESCRIPTION', 'provides a trash can by intercepting calls...'), ('EAPI', ''), ('HOMEPAGE', 'http://pages.stern.nyu.edu/~marriaga/software/libtrash/'), ('IUSE', ''), ('KEYWORDS', '~amd64 ~ppc ~x86'), ('LICENSE', 'GPL-2'), ('PDEPEND', ''), ('PROVIDE', ''), ('RDEPEND', 'virtual/libc dev-lang/perl'), ('RESTRICT', ''), ('SLOT', '0'), ('SRC_URI', 'http://pages.stern.nyu.edu/~marriaga/software/blah.tgz'), ('_eclasses_', { 'toolchain-funcs': LazilyHashedPath('/usr/portage/eclass', mtime=1155996352L), 'multilib': LazilyHashedPath('/usr/portage/eclass', mtime=1156014349L), 'eutils': LazilyHashedPath('/usr/portage/eclass', mtime=1155996352L), 'portability': LazilyHashedPath('/usr/portage/eclass', mtime=1141850196L) } ), ('_mtime_', 1000), ), ) class GenericCacheMixin(TestCase): cache_keys = ("DEPENDS", "RDEPEND", "EAPI", "HOMEPAGE", "KEYWORDS", "LICENSE", "PDEPEND", "PROVIDE", "RESTRICT", "SLOT", "SRC_URI", "_eclasses_", "_mtime_")