From 0a60f0a859994ca2ed51aa0b20454743f970b956 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 15 Oct 2011 15:55:31 -0700 Subject: [PATCH] EbuildMetadataPhase: fix parse-eapi-ebuild-head This fixes bugs that can only be triggered by egencache since other callers handle parse-eapi-ebuild-head earlier. --- pym/_emerge/EbuildMetadataPhase.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pym/_emerge/EbuildMetadataPhase.py b/pym/_emerge/EbuildMetadataPhase.py index a6630ad10..6ef7c0010 100644 --- a/pym/_emerge/EbuildMetadataPhase.py +++ b/pym/_emerge/EbuildMetadataPhase.py @@ -44,8 +44,9 @@ class EbuildMetadataPhase(SubProcess): if eapi is not None: if not portage.eapi_is_supported(eapi): + self.metadata = {'EAPI' : eapi} self.metadata_callback(self.cpv, - self.repo_path, {'EAPI' : eapi}, self.ebuild_hash) + self.repo_path, self.metadata, self.ebuild_hash) self._set_returncode((self.pid, os.EX_OK << 8)) self.wait() return @@ -117,7 +118,11 @@ class EbuildMetadataPhase(SubProcess): def _set_returncode(self, wait_retval): SubProcess._set_returncode(self, wait_retval) - if self.returncode == os.EX_OK: + # self._raw_metadata is None when _start returns + # early due to an unsupported EAPI detected with + # FEATURES=parse-eapi-ebuild-head + if self.returncode == os.EX_OK and \ + self._raw_metadata is not None: metadata_lines = _unicode_decode(b''.join(self._raw_metadata), encoding=_encodings['repo.content'], errors='replace').splitlines() -- 2.26.2