From: Zac Medico Date: Sun, 16 Oct 2011 20:26:46 +0000 (-0700) Subject: EbuildMetadataPhase: avoid redundant EAPI parsing X-Git-Tag: v2.2.0_alpha68~15 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1272f5c55baa5c6d68d5ab3a1dceef69cc47e69b;p=portage.git EbuildMetadataPhase: avoid redundant EAPI parsing --- diff --git a/pym/_emerge/EbuildMetadataPhase.py b/pym/_emerge/EbuildMetadataPhase.py index 2fbd29eb7..06cabe7d1 100644 --- a/pym/_emerge/EbuildMetadataPhase.py +++ b/pym/_emerge/EbuildMetadataPhase.py @@ -20,7 +20,7 @@ class EbuildMetadataPhase(SubProcess): used to extract metadata from the ebuild. """ - __slots__ = ("cpv", "ebuild_hash", "fd_pipes", "metadata_callback", + __slots__ = ("cpv", "eapi", "ebuild_hash", "fd_pipes", "metadata_callback", "metadata", "portdb", "repo_path", "settings") + \ ("_raw_metadata",) @@ -33,7 +33,9 @@ class EbuildMetadataPhase(SubProcess): settings.setcpv(self.cpv) ebuild_path = self.ebuild_hash.location - eapi = None + # the caller can pass in eapi in order to avoid + # redundant _parse_eapi_ebuild_head calls + eapi = self.eapi if eapi is None and \ 'parse-eapi-ebuild-head' in settings.features: eapi = portage._parse_eapi_ebuild_head( diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index 13c27e979..0ade59a19 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -528,7 +528,7 @@ class portdbapi(dbapi): mydata = self._metadata_callback( mycpv, mylocation, {'EAPI':eapi}, ebuild_hash) else: - proc = EbuildMetadataPhase(cpv=mycpv, + proc = EbuildMetadataPhase(cpv=mycpv, eapi=eapi, ebuild_hash=ebuild_hash, metadata_callback=self._metadata_callback, portdb=self, repo_path=mylocation,