from portage import _unicode_decode
from portage import _unicode_encode
from portage import OrderedDict
+from _emerge.EbuildMetadataPhase import EbuildMetadataPhase
+from _emerge.TaskScheduler import TaskScheduler
import os as _os
import codecs
if metadata is not None:
return None
- import _emerge
- process = _emerge.EbuildMetadataPhase(cpv=cpv, ebuild_path=ebuild_path,
+ process = EbuildMetadataPhase(cpv=cpv, ebuild_path=ebuild_path,
ebuild_mtime=emtime, metadata_callback=self._metadata_callback,
portdb=self, repo_path=repo_path, settings=self.doebuild_settings)
return process
if eapi is not None and not portage.eapi_is_supported(eapi):
mydata['EAPI'] = eapi
+ self._metadata_callback(
+ mycpv, myebuild, mylocation, mydata, emtime)
else:
- myret = doebuild(myebuild, "depend",
- self.doebuild_settings["ROOT"], self.doebuild_settings,
- dbkey=mydata, tree="porttree", mydbapi=self)
- if myret != os.EX_OK:
+ sched = TaskScheduler()
+ proc = EbuildMetadataPhase(cpv=mycpv, ebuild_path=myebuild,
+ ebuild_mtime=emtime,
+ metadata_callback=self._metadata_callback, portdb=self,
+ repo_path=mylocation, scheduler=sched.sched_iface,
+ settings=self.doebuild_settings)
+
+ sched.add(proc)
+ sched.run()
+
+ if proc.returncode != os.EX_OK:
self._broken_ebuilds.add(myebuild)
raise KeyError(mycpv)
- self._metadata_callback(
- mycpv, myebuild, mylocation, mydata, emtime)
+ mydata.update(proc.metadata)
if mydata.get("INHERITED", False):
mydata["_eclasses_"] = self._repo_info[mylocation