diff options
author | Zac Medico <zmedico@gentoo.org> | 2012-05-08 23:38:47 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2012-05-09 00:09:22 -0700 |
commit | 20817801dd4ef0117bcc7b33c90650da1e920385 (patch) | |
tree | c2e30f858b87e9d1504774a8e84791aff149453c /pym/portage/dbapi | |
parent | die: fix ${T}/build.log{,.gz} message (diff) | |
download | portage-20817801dd4ef0117bcc7b33c90650da1e920385.tar.gz portage-20817801dd4ef0117bcc7b33c90650da1e920385.tar.bz2 portage-20817801dd4ef0117bcc7b33c90650da1e920385.zip |
Parse EAPI with pattern from PMS section 7.3.1.
This implements the specification that was approved in Gentoo's council
meeting on May 8, 2012 (see bug #402167). The parse-eapi-ebuild-head
FEATURES setting is now enabled by default, and causes non-conformant
ebuilds to be treated as invalid. This behavior will soon become
enabled unconditionally.
Diffstat (limited to 'pym/portage/dbapi')
-rw-r--r-- | pym/portage/dbapi/porttree.py | 42 |
1 files changed, 13 insertions, 29 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index bdb87f13e..16962b566 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -485,38 +485,22 @@ class portdbapi(dbapi): raise KeyError(mycpv) self.doebuild_settings.setcpv(mycpv) - eapi = None - - if eapi is None and \ - 'parse-eapi-ebuild-head' in self.doebuild_settings.features: - with io.open(_unicode_encode(myebuild, - encoding=_encodings['fs'], errors='strict'), - mode='r', encoding=_encodings['repo.content'], - errors='replace') as f: - eapi = portage._parse_eapi_ebuild_head(f) - - if eapi is not None: - self.doebuild_settings.configdict['pkg']['EAPI'] = eapi - - if eapi is not None and not portage.eapi_is_supported(eapi): - mydata = self._metadata_callback( - mycpv, mylocation, {'EAPI':eapi}, ebuild_hash) - else: - proc = EbuildMetadataPhase(cpv=mycpv, eapi=eapi, - ebuild_hash=ebuild_hash, - metadata_callback=self._metadata_callback, portdb=self, - repo_path=mylocation, - scheduler=PollScheduler().sched_iface, - settings=self.doebuild_settings) - proc.start() - proc.wait() + proc = EbuildMetadataPhase(cpv=mycpv, + ebuild_hash=ebuild_hash, + metadata_callback=self._metadata_callback, portdb=self, + repo_path=mylocation, + scheduler=PollScheduler().sched_iface, + settings=self.doebuild_settings) + + proc.start() + proc.wait() - if proc.returncode != os.EX_OK: - self._broken_ebuilds.add(myebuild) - raise KeyError(mycpv) + if proc.returncode != os.EX_OK: + self._broken_ebuilds.add(myebuild) + raise KeyError(mycpv) - mydata = proc.metadata + mydata = proc.metadata mydata["repository"] = self.repositories.get_name_for_location(mylocation) mydata["_mtime_"] = ebuild_hash.mtime |